talira

CSS Peek

Peek at, jump to and hover over the CSS, SCSS and Less rules for a class or id in VS Code

open sourceMITfree

A VS Code extension that finds the CSS, SCSS and Less definitions of the classes, ids and tags used in HTML, React JSX and TSX, Vue, Svelte, Razor, Pug and other HTML-like templates. It opens the rule inline for quick edits (Peek), jumps to it (Go to Definition) or shows it on hover, and lists selectors through the symbol search. It reads clsx and classnames arguments and imported CSS modules, but doesn't evaluate dynamic values or CSS-in-JS. It runs in desktop VS Code and VS Code for the Web. MIT licensed.

Problems it solves

  • jump from a class name in my HTML to its CSS rule in VS Code
  • see which stylesheet defines a class without searching the project
  • edit a CSS rule inline while I'm in a React component

Features

  • peek, go to definition and hover for CSS selectors
  • CSS, SCSS and Less
  • HTML, JSX/TSX, Vue, Svelte, Razor and Pug templates
  • CSS modules and clsx/classnames arguments
  • workspace symbol search for selectors
  • works in VS Code for the Web

Limitations

  • Doesn't evaluate dynamic class values or CSS-in-JS runtime styles1
  • Only finds styles in the open workspace or an embedded style block1

Alternatives

The same job

These do what CSS Peek does.

  1. HTML CSS Support CSS class, id and custom property completion for HTML in VS Code
  2. Django extension for Visual Studio Code Beautiful syntax and scoped snippets for perfectionists with deadlines

Compare CSS Peek with the top 3