A Visual Studio Code extension that helps you work with OKLCH colors in your CSS files, particularly useful when working with Tailwind CSS and shadcn/ui.
- Color Identification: Hover over any
oklch()
color value to see its corresponding Tailwind color name - Quick Color Replacement: Replace any
oklch()
color with a Tailwind color from a searchable list - Gray Scale Conversion: Convert between different Tailwind gray scales (e.g., Slate to Zinc)
- Color Annotation: Add Tailwind color name comments to your
oklch()
values - Automatic Annotation: Automatically update annotations on color changes
- Annotation Cleanup: Remove all color annotations with a single command
Simply hover over any oklch()
color value in your CSS files to see its corresponding Tailwind color name.
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
) - Type "Shadcn Color Tool: Annotate OKLCH Colors with Tailwind Names" and select the command to add comments
- Type "Shadcn Color Tool: Remove OKLCH Colors" and select the command to remove comments
- Place your cursor on an
oklch()
color value - Use the Quick Fix menu (lightbulb icon) or press
Ctrl+.
(Windows/Linux) orCmd+.
(Mac) - Select "Replace with a Tailwind color"
- Choose your desired color from the searchable list
- Open the Command Palette
- Type "Shadcn Color Tool: Change Base Color" and select the command
- Choose your target gray scale (e.g., Slate, Zinc, etc.)
- All gray scale colors in the current file will be converted to the selected scale
- Visual Studio Code 1.80.0 or higher
This extension contributes the following settings:
shadcn-color-tool.enable
: Enable/disable the extension
None at the moment.
Add inline color swatches for better visual feedback
Initial release of Shadcn Color Tool.
MIT License - see LICENSE.md for details