-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Code Completion for css variables #75
Comments
Can you please add a link to the docs explaining how it works with Styled Components (mainly, where this variable should be visible)? I haven't found anything about using CSS variables in the Style Components docs... Thanks! |
I also didn't find anything in the docs. But I can confirm that css variables work with styled components. Using css variables has some advantages against using JS variables in styled components. Having code completion for them would be a nice feature. |
Styled Components do not change the way CSS custom properties work. It's true in general, since it's stated that all standard CSS is supported. PostCSS specifics do not apply as well, so it's a plain standard CSS feature. The issue is basically boils down to tracking declared custom properties. Since they are propagated to child elements through CSS inheritance it might be impossible to track them intelligently. Resolving all custom properties declared anywhere in the project (tagged literals, object styles, CSS files) seems most practical. |
This depends on the IDE bug https://youtrack.jetbrains.com/issue/WEB-38704. Completion for css variables currently does not work within language injections, which is the generic IDE mechanism this plugin uses to mark parts of code as CSS-like code. |
Hey
Thanks for the plugin!
Would it be possible to add code completion for css variables defined like this?
The text was updated successfully, but these errors were encountered: