GithubHelp home page GithubHelp logo

Comments (2)

countzero1942 avatar countzero1942 commented on May 30, 2024

I found the automatic insertion of the var(--variable) to be problematic as well.

There are cases where you want to redefine css variables in selectors. Then you just need the --variable: insertion, not the var(--variable) insertion.

This should be easy to test for. If at the beginning of a tabbed lined insert --variable: . If after a css property: property: , then insert var(--variable).

Or just have the option to not insert the var(...) along with the css variable name.

This would help out a lot!

from vscode-css-variables.

countzero1942 avatar countzero1942 commented on May 30, 2024

I found a hack to this. Just clone the repo. Open in VS Code. Do npm install to install modules. Find the line of code that wraps the string in var(...) and change it.

Then find the right scripts to run in /package.json. Like npm run build and npm run package. Eventually you will find the minified .js files of index.js and server.js in /packages/vscode-css-variables/dist/.

Now find where the VS Code extension is installed on your computer: e.g. C:\Users\me\.vscode\extensions\vunguyentuan.vscode-css-variables-2.6.3\dist

Next backup the two files, index.js and server.js and copy them over with the new ones. Then start VSCode. No more var(--variable) when trying to redefine the css variable in a selector!

BTW, a couple of notes. When doing npm install I also had to do the recommended npm audit fix --force. And the minified .js file lengths were not exact with the installed ones. Installed: 343KB and 545KB; new ones: 343KB and 543KB.

Also the editor shows 2 errors in the /tsconfig.json file (TypeScript settings), which I ignored. The build scripts also has errors which didn't apparently matter (which I prob could've fixed but didn't): 'rm' is not recognized as an internal or external command from shell command > tsc -p ./ && rm -f .vscode-test/user-

The file to edit is /packages/vscode-css-variables/index.js.

from vscode-css-variables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.