-
Notifications
You must be signed in to change notification settings - Fork 28.7k
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
[html][css] Investigate cross css/html, multi file support #47331
Comments
"code completion for variables defined in other css files" ¨ |
Do you think this will also allow:
This, along with the better IntelliSense, will allow CSS to become more like other programming languages, where we rely on this sort of help from the IDE. To not break the app, these two will of course require imposing certain limitations on the project to work with these names statically (like what happened in the JS world with methods and modules, to be able to do tree-shaking on them). May even be useful to limit this to only work within a component (as in, an Angular component). Anyway, if used right this can be huge for increasing maintainability of your styles, and will put vscode even further ahead of the game. |
For convenience, here's all possible use cases. CSS IntelliSense within HTML files
The suggested extension in the comments column, caches CSS classes in your repository coming from any CSS or HTML file in your repository. Even though this is better than nothing, it does pollute your suggestion box with CSS classes your HTML doesn't link to and doesn't show IDs. CSS IntelliSense within CSS files
|
may be can try this https://marketplace.visualstudio.com/items?itemName=zitup.classnametocss |
I believe this is a must-have. |
I think providing support for cross css/scss/html, multi file support would also solve this issue at the same time. Note, it also has quite a few more votes than this issue. #28459 |
Please, I want this so bad. This extension did exactly this and worked great for a while but now it's buggy and seems to be abandoned. We need this to be native in VS Code 🙏 |
Hey @diegovogel ... Agreed this really should be added. But for now I have found this extension does what the one you are having trouble with, and does a whole lot more. |
Thanks @onetrev! That works beautifully so far. I've seen countless posts about this same issue where people suggest other extensions that only do autocomplete of classes in HTML, not the other way around. I thought this was another one of those but it pulls from HTML to CSS as well 🎉 |
@aeschli We've spend two days evaluating all available extensions for simple Sass support and none of them work. I'm essentially talking about referencing variables and mixins defined in another file, imported via VS2022 has had support for Go-to-definition for sass files for a number of years. VSCode is failing quite badly on this. |
Approach:
Benefits:
In HTML
In CSS/LESS/SCSS
The text was updated successfully, but these errors were encountered: