willofindie / vscode-cssvar

VSCode extension to support CSS Variables Intellisense
https://marketplace.visualstudio.com/items?itemName=phoenisx.cssvar
MIT License
243 stars 4 forks source link

[Bug] Failed to parse CSS variables in file with @import #107

Closed tojeiro-me closed 1 year ago

tojeiro-me commented 1 year ago

CSSVar doesn't parse CSS variables in files with @import Removing the @import everything works as expected. Error: Failed to parse CSS variables in files:

phoenisx commented 1 year ago

Can you share for which @import url you are getting the error? I can verify if the issue that I am able to replicate is the same as yours or not.

tojeiro-me commented 1 year ago

I'm using postcss-import and had the previous file imported with @import "reset"; I tested with @import "https://unpkg.com/plasttic-reset@2.0"; and got the same error :( I also added "cssvar.postcssPlugins": ["postcss-import", "postcss-custom-properties", "postcss-nested", "postcss-preset-env", "postcss-media-minmax", "postcss-mixins", "postcss-simple-vars", "autoprefixer", "postcss-discard-empty", "cssnano", "postcss-merge-rules"], "cssvar.files": ["./src/assets/css/tokens.css"] to settings.json. And tried removing the postcss-import from postcss.config. This plugin is important for me because I use the atomic design methodology through @mixins, and parsing the tokens file makes the workflow much smoother.

phoenisx commented 1 year ago

This should get fixed in v2.6.3