CSS classname autocompletion?


Is there some trick or requirements to getting css classnames to autocomplete/suggest in IDEA?  For example, if I have an html file and it has <link>s to style sheets, I'd like to have those come up as options in the class attribute.  Or does it not work with remotely hosted files?


In .html files, only those CSS classes/IDs that are available in local .css files explicitly linked to HTML via <link> tag are available in completion.  CDN links to online resources, as well as dynamically generated links, can't be resolved.
So you have to download the css and reference it using the relative URL to make the completion work.


 Boo!  I don't like that answer - I want another one.


I know this is a year old, but...  IntelliJ asks to downloads remote files like this locally. Wouldn't it follow that IntelliJ might consider utilizing the locally stored files (if available) for auto-completion?

What other uses to IJ make of the locally stored file?



>IntelliJ asks to downloads remote files like this locally


it does this for .js files - they are downloaded to Idea configuration directory and set up as JavaScript Libraries for completion, etc. (see https://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/)

But this doesn't work for stylesheet references (https://youtrack.jetbrains.com/issue/WEB-10023), you have to download .css manually in browser and save it to your project directory to make completion work


IntelliJ does download the css files locally as well.

However, I realize it does not work. That's the main reason for the comment. Is web-10023 officially a feature request?


>Is web-10023 officially a feature request?



Please sign in to leave a comment.