Skip to content
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

[css] Use CSS custom properties imported via @import #28459

Open
fluxxus opened this issue Jun 11, 2017 · 28 comments
Open

[css] Use CSS custom properties imported via @import #28459

fluxxus opened this issue Jun 11, 2017 · 28 comments
Assignees
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality
Milestone

Comments

@fluxxus
Copy link

fluxxus commented Jun 11, 2017

Is it possible for VS code to recognize CSS variables declared in a separate CSS file that is imported with @import ?

For example, I would like to have a variables.css file that is all about declaring CSS custom properties. Then I would import that file on top of my main css file, and be able to have intellisense support for those variables.

The way things work now, VSCode is not able to recognize those variables. Or maybe I am missing something obvious?

@ramya-rao-a ramya-rao-a added the css-less-scss Issues and items concerning CSS,Less,SCSS styling label Jun 12, 2017
@aeschli aeschli added the feature-request Request for new features or functionality label Jun 14, 2017
@aeschli aeschli changed the title Using CSS custom properties imported via @import [css] Use CSS custom properties imported via @import Jun 14, 2017
@aeschli aeschli added this to the Backlog milestone Jun 14, 2017
@aeschli
Copy link
Contributor

aeschli commented Jun 14, 2017

Currently, the css support does not follow any references

@fluxxus
Copy link
Author

fluxxus commented Jan 30, 2018

@aeschli Just checking to see if maybe this is planned for a future release?

Also, do you maybe know if some plugins offer this functionality?

p.s. I am a bit of a noob with all things github, does it mean that this will be implemented when the milestone green bar becomes full?

@aeschli
Copy link
Contributor

aeschli commented Jan 31, 2018

@madebym We currently have no plans to implement the requested feature. When the issue gets a lot of votes, we would plan it for a milestone. Until then it stays on the backlog.

Sorry, I don't know if there's an extension that adds this.

@fluxxus
Copy link
Author

fluxxus commented Jan 31, 2018

@aeschli Thanks for the reply and the explanation. I understand this is not a big deal, hence the low number of people requesting this.

Once again, thanks for the info.

@mttmccb
Copy link

mttmccb commented Feb 26, 2018

It'd really be nice to see this as browser support for custom properties is pretty good now

@jfhector
Copy link

I'd love to see this happening too.

@VitalyKrenel
Copy link

I vote for the feature too. It's quite confusing when you can not find a variable within suggestions popup while it's declared in one of the linked files, especially when it's in :root pseudo-class (so it's available throughout your project).
Right now it's appeared in suggestions popup only in the file where the custom property is defined.

It would be great if the popup could show on typing -- not only the variable's name and value but also some kind of modifier that explains where the variable is declared: in :root, inherited from parent or it comes right from this selector where it's used (probably in terms of sorting this kind of custom properties should have higher priority).
Also, the modifier mentioning overriding ('Root value is overridden in 'name' selector' or something like this) would be useful.

@philerck
Copy link

philerck commented Apr 5, 2018

Good idea, I need this too.

@osmanc777
Copy link

osmanc777 commented Oct 24, 2018

I would also be delighted if this was implemented in vs code since it would be very helpful and would be the cherry on the cake for this great editor, and it would also be great if it worked both in css and sass since you can also use varialbes css in sass and as in sass we can use partial ( _example.scss ) and in that file also recognize the varibles css or sass 👨🏻‍💻😁👨🏻‍💻

@kieranjohn
Copy link

Great idea! Seems like a possible duplicate of this item #6734

@thewashingtonhua
Copy link

thewashingtonhua commented May 9, 2019

Vote for this feature too. I'm trying to migrate from SCSS to PostCSS and there's this trouble: There's no autocompletion for CSS variables across files. I'll have to manually make sure I'm typing the variable name correctly, or copy & paste every time. (Currently, this is the only thing stands between me and adopting CSS variables.)

Currently VSCode only supports autocompletion for CSS variables defined in the same file. But it won't work if I put all my variables in variables.css and @import in app.modules.css

For SCSS there's scss-scan for autocompleting variables across files. It searches for all variables defined in the project. I've been using it for a long time and I'm feel lucky to have it. It would be really nice if there's something like this for CSS.

@JoshMayberry
Copy link

How do I cast my vote for this feature? I am very interested in it as well.

@octref octref removed their assignment May 1, 2020
@fictivecreations
Copy link

Consider this another vote for this feature.

@mondedelotus
Copy link

Vote for this!

@wilsoniwano
Copy link

Please! 😁

@holtjohnson
Copy link

Google search about this issue led me here. I'm interested in this feature!

@mmdevcodes
Copy link

Another vote from me. Very important.

@ronilaukkarinen
Copy link

This is literally the only thing that is missing in VSCode for me. I always have to check out the variables by looking at the files under variables directory... would save so much time to have this. So consider this as another vote. There's also a similar issue here.

@gmvoliveira
Copy link

Also interested in this feature. +1

@salmanmaqsoodlive
Copy link

this is the only thing missing in VS Code

@goooseman
Copy link

Maybe a configuration property can be introduced, which can be used in the project's .vscode/setting.json to specify variables .css files, which should be imported by VS Code's Intellisense project-wise?

@goooseman
Copy link

There is a plugin to do that: https://github.com/be5invis/vscode-custom-css. But it modifies VS Code's files, so I'm not sure it is safe to use.

@thewashingtonhua
Copy link

So far I been using yanai101/css-var-hint. works for me.

@ennio-tomas
Copy link

Very required feature! +1

@temideep79
Copy link

Yes please autocomplete for custom properties

@onetrev
Copy link

onetrev commented Jul 10, 2023

This extension: CSS Variables now seems the most reliable and functional for supporting this crucial functionality for anyone using CSS Custom Properties.

@BlackSparowYT
Copy link

BlackSparowYT commented Nov 9, 2023

needs to be something included in vscode! +1

@tinynow
Copy link

tinynow commented Mar 15, 2024

How do I cast my vote for this feature? I am very interested in it as well.

Yes - is this the proper venue to vote for this feature??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests