CSS Variables Assistant

CSS Variables Assistant

Autocomplete, quick documentation and color swatches for CSS variables, right inside your JetBrains IDE. Works with CSS, SCSS, Sass and LESS.

Downloads
17,194
site.csstokens.css
1/* Pick the accent of this page. */
2:root {
3 --accent: var();
4}
Pick a token and the page followsCSSUTF-82 spaces

Features

Four things the plugin adds to your editor. Every example here is live, so type in it, hover it and flip the switches.

Autocomplete with the values attached

Type var(-- and each suggestion shows its swatch, its resolved value and its dark-theme variant. You pick by what a variable is, not by what it happens to be called.

accept-completion.csstheme.css
1@import "./theme.css";
2
3.button {
4 background: var();
5}
6
  • brand-mint#A8C9AF
  • brand-iris – Primary brand color for interactive elements.#B8A4F4 / 🌙 #CAB9FF
  • brand-peach#E9AC95
Press ⌃. to choose the selected (or first) suggestion and insert a dot afterwards
CSSLFUTF-82 spaces

Quick documentation on hover

Every value a variable takes across themes and media queries, the file and line that declares each one, and its contrast ratio.

background: var(--brand-iris);
--brand-iris
ContextValueTypeSourceWCAG
Default#B8A4F4color2,18:1
Dark#CAB9FFcolor1,77:1

Shown in index order — runtime applied value depends on stylesheet load order and specificity.

Description:

Primary brand color for interactive elements.

Check contrast on WebAIM Contrast Checker

Suggestions sorted by value

--space-sm lands between xs and md, not after lg. Prefer descending or plain A to Z? It is one setting.

Suggestions in order: --space-xs 4px, --space-sm 8px, --space-md 16px, --space-lg 24px, --space-xl 40px

Index as far as you need

Decide how far the plugin looks for variables: your project, your project and everything it imports, or all of node_modules. Re-index from settings at any time.

  • src/styles/tokens.css24 variablesin your project
  • src/components/button.scss6 variablesin your project
  • node_modules/@acme/design/_tokens.scss46 variablesimported by button.scss
  • node_modules/bootstrap/dist/css/bootstrap.cssnot indexednever imported

76 variables indexed from 3 of 4 files

Follow a value home

A token is often an alias of an alias. The plugin follows imports and references across files and shows every step, down to the file and line where the value is declared.

01-imports-and-math.scssSCSS
@use "./scss/components" as controls;
.button {
background: controls.$button-background;
padding: controls.$button-padding;
border-radius: controls.$button-radius;
font-size: controls.$button-font-size;
}
controls.$button-background

↗ shows a resolved value - hover it to see every step (resolution chain)

ContextValueTypeSourceWCAG
Defaultcolor2,18:1
Check contrast on WebAIM Contrast Checker

Hover Value or Source. Click or tap to keep it open.

Explore the source files
scss/_components.scss
@use "./semantic" as *;
$button-background: $action-color;
$button-padding: ($space-medium * 2);
$button-radius: $radius-control;
$button-font-size: $type-label;
Resolved value#B8A4F4

Browse the example project. The plugin shows the source in its hover popup.

scss/_components.scss, line 3

One color. Three source files.

Follow the button token through its semantic alias to the original color.

Interactive examples based on CSS Variables Assistant 1.9.4 in IntelliJ IDEA. Your values come from your project.

Screenshots

The plugin at work in the IDE, as published on JetBrains Marketplace.

1 / 9

JetBrains Marketplace

Free and open source. Install it without leaving your IDE, in about a minute.

  1. Open the plugin Marketplace

    In your IDE, go to SettingsPluginsMarketplace.

  2. Search for CSS Variables Assistant

    Select it in the results and choose Install.

  3. Type var(-- in a stylesheet

    Restart the IDE if it asks. Suggestions appear as soon as indexing has finished.