A Visual Studio Code extension that provides intelligent syntax highlighting for Emotion styled components in TypeScript/JavaScript projects.
- Highlights emotion styled components in JSX/TSX files with customizable colors
- AST-based detection for locally declared styled components
- Supports multiple syntaxes: template literals, object syntax, and function calls
- Works with styled-components library as well as @emotion/styled
- Automatic theme-aware colors with fallback support
- Performance optimized with smart caching and early exit strategies
# If you have the .vsix file
code --install-extension emotion-styled-highlighter-0.1.0.vsixgit clone https://github.com/emotion-highlighter/emotion-styled-highlighter.git
cd emotion-styled-highlighter
yarn install
yarn compile
yarn fullInstall  # Packages and installs the extensionThe extension uses a single configuration setting:
{
  "editor.styledComponentHighlighting.enabled": true
}| Value | Description | 
|---|---|
| true | Enable with automatic theme-aware colors (default) | 
| false | Disable highlighting | 
| "#FF69B4" | Enable with custom hex color | 
import styled from '@emotion/styled';
// Template literal
const Button = styled.button`
  background: blue;
`;
// Object syntax
const Container = styled.div({
  padding: '20px'
});
// Function call
const Input = styled('input')`
  border: 1px solid gray;
`;
// Component extension
const PrimaryButton = styled(Button)`
  background: darkblue;
`;Access via Command Palette (Ctrl/Cmd+Shift+P):
- Emotion Highlighter: Clear Cache- Clear the analysis cache
- Emotion Highlighter: Toggle Styled Component Highlighting- Toggle highlighting on/off
Styled components not highlighted?
- Check that your file imports emotion: import styled from '@emotion/styled'
- Verify the extension is enabled
- Try running the "Clear Cache" command
- Ensure your file is a .tsxor.jsxfile
Performance issues?
- Use the "Clear Cache" command
- Check the status bar for cache statistics
- Restart VS Code if issues persist
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests: yarn test
- Submit a pull request
MIT
🎨 Beautiful styled component highlighting for your Emotion projects!

