question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

auto-completion for css variables

See original GitHub issue

Is your feature request related to a problem? Please describe. CSS custom properties can have long names and are difficult to type. Even though their definitions are in random CSS files, it would be nice to get auto-completion on them. Having first-class language-tooling support for a theming solution that we are trying push as the best choice in most scenarios would really help with adoption.

Describe the solution you’d like Obviously this feature would be impossible to implement without letting the language tools know where the CSS variables might be defined due to how CSS works. I imagine we could provide an array of filepaths telling the language tools where it should look for the definition of any CSS custom properties. Any custom properties found in that file (or those files, maybe a glob or regex?), regardless of selector, should auto-complete whenever a user types a qualifying set of characters. I imagine we could begin to match on available CSS vars whenever a user has typed var(.

Describe alternatives you’ve considered Do nothing and be sad.

Additional context If I could screenshot this feature I would not be asking for it!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pngwncommented, Sep 6, 2020

And i also cannot fathom how you are quite this fast.

0reactions
yazonnilecommented, Nov 25, 2020

Hello, guys. How can I make this option works?

I have a file ROOT/client/src/lib/styles/variables.css

:root {
  --mainColor: #0f2499;
}

I set client/src/lib/styles/variables.css as an value into option (Svelte-Plugin-CSS-Globals) But nothing happens. No autocompletion. When I type var(--mainCo) - no suggestions

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Variable Autocomplete - Visual Studio Marketplace
Working with CSS Variables is a pain, this extension enhances the Web Development experience by providing advanced features such as autocomplete ...
Read more >
VSCode CSS Variable Autocomplete - DEV Community ‍ ‍
CSS Variable Autocomplete Extension to rescue. The extension will scan all the css-like files(support SASS, LESS, CSS) and create a dictionary ...
Read more >
vunguyentuan/vscode-css-variables - GitHub
Working with CSS Variables is a pain, this extension enhances the Web Development experience by providing advanced features such as autocomplete, color preview ......
Read more >
vscode css variable autocomplete - Reddit
Finally, I'll definitely give it a shoot. Will the autocomplete work with JavaFX's CSS syntax? Upvote 1. Downvote. Reply.
Read more >
Getting started - Pollen CSS
Enable intellisense autocompletion for Pollen in VS Code by installing the CSS Var Complete extension and adding Pollen's CSS in a .vscode/settings.json file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found