Comments (2)
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.
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)
- Support for Color Functional Notation
- Setting to Disable .js / .ts Autocomplete? HOT 8
- How to debug this extension in vscode? HOT 1
- [Bug] should only show css variables suggestion in style block for vue file HOT 1
- Allow CDN links in lookupFiles list HOT 1
- Ctrl + click for references doesn't work properly when extension is enabled
- [Bug] Accepting autocomplete is problematic in daily use HOT 1
- It is not working in *.styl file
- Preview colors for node_module
- Server crashed 5 times!!! HOT 1
- How to add yarn berry packages into cssVariables.lookupFiles list?
- lookupFiles not work with workspace folder HOT 1
- color preview is not rendered HOT 1
- Adds extra hyphens when starting by typing hyphens HOT 2
- Warn if not defined
- No suggestion if try to re-define css variable
- Add ability to add variables that are not in any css files as they'll be generated at run time
- sass预设不同的主题
- [Bug] Extension crashes when getting permission denied
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-css-variables.