Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>CSS Reference Counter and PeekNew to Visual Studio Code? Get it now.
CSS Reference Counter and Peek

CSS Reference Counter and Peek

JatinShimpi

| (1) | Free
Shows how many times each CSS selector is used across your project with CodeLens annotations, Ctrl+Click navigation, and Find All References.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CSS Reference Counter and Peek

A VS Code extension that shows how many times each CSS selector is used across your project. It displays an inline reference count above every CSS rule and supports Ctrl+Click navigation from HTML/JSX to CSS declarations.

Features

Inline Usage Count (CodeLens)

Displays implementations: N above each CSS rule in .css and .scss files. Selectors with zero usages are easy to spot, helping you identify and remove dead CSS.

CodeLens showing implementation count above CSS selectors

Go to Definition

Ctrl+Click on a class name inside class="..." or className="..." in HTML, JSX, TSX, or Vue files to jump directly to its CSS declaration.

Go to definition from JSX className to CSS

Multiple Usage Count

Tracks usage across the entire project. A selector used in many places shows the total count.

Usage count of 4 for .page-title

Find All References

Right-click a CSS selector and choose "Find All References" to see every file where that class or ID is used.

Find all references panel showing 12 locations

Smart Scanning

  • On first activation, the extension performs a full background scan with a progress indicator.
  • After that, it updates incrementally as you edit and save files.
  • File creation, deletion, and renames are handled automatically.

Supported Files

CSS declarations are read from .css and .scss files.

Usage is detected in .html, .htm, .jsx, .tsx, .vue, and .svelte files.

Detected Patterns

  • class="foo bar"
  • className="foo" / className={'foo'}
  • classList.add('foo') / .toggle() / .remove()
  • :class="{ foo: true }" (Vue)
  • document.querySelector('.foo')
  • document.getElementById('bar')

Commands

  • CSS Reference Counter: Rescan Workspace - Manually trigger a full workspace rescan.

Settings

  • cssReferenceCounter.includedFileTypes - File extensions to scan for usage. Default: ["html", "htm", "jsx", "tsx", "vue", "svelte"]
  • cssReferenceCounter.excludePatterns - Glob patterns to exclude from scanning. Default: ["**/node_modules/**", "**/dist/**", "**/build/**", "**/.git/**"]

Development

npm install
npm run compile

Press F5 in VS Code to launch the Extension Development Host for testing.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft