CSS Tagged Templates

CSS language features for CSS-in-JS tagged templates in VS Code.

Installation
Install from the Visual Studio Marketplace, or run:
code --install-extension usercao.css-tagged-templates
Features
- Syntax highlighting, including interpolations
- Context-aware completion and hover documentation
- Diagnostics and quick fixes
- Color decorators and color picker
- Folding
- Completion, Go to Definition, Find References, and hover for project CSS custom properties
Supported libraries
styled-components
- Modules:
styled-components
- Tags:
styled (default import), css, keyframes, createGlobalStyle
yak
- Modules:
@yak/react, @yak/solid
- Tags:
styled, css, keyframes, globalStyle
Templates are recognized only when the tag is imported from an enabled module.
Settings
cssTaggedTemplates.validate
- Enable CSS diagnostics.
- Default:
true
cssTaggedTemplates.libraries
- Library profiles to recognize.
- Default:
["styled-components", "yak"]
cssTaggedTemplates.projectIndex.enabled
- Index CSS custom properties in the workspace.
- Default:
true
Known limitations
- Only statically imported tags are recognized; re-exports and
require are not.
- Using it together with vscode-styled-components shows duplicate suggestions; disable one of them.
Development
See docs/DEVELOPMENT.md.
License
MIT
| |