No description
Find a file
Nixieboluo 213e074de5
feat: comprehensive fixes for categorization, parser, and logging
Major improvements:
- Add parser support for Tailwind v4 arbitrary CSS property syntax (property:value)
- Fix categorization for negative values, position classes, grid/flex properties
- Optimize logging output (reduce 90% verbosity, add timing stats)
- Improve debug hover information (more compact format)

Parser enhancements:
- New ArbitraryCSSPropertyMachine for (property:value) syntax
- Support border-(length:--var), bg-(color:--theme), etc.
- All three Tailwind v4 syntaxes now supported: [value], (--var), (property:value)

Categorization fixes:
- Negative spacing: -ml-14, -m-4 → spacing
- Position values: relative, absolute, sticky → layout
- Grid properties: row-span-2, col-span-3 → layout
- Transform classes: -translate-y-1/2 → transforms
- Arbitrary CSS properties: border-(length:--var) → borders

Logging improvements:
- Replace per-line logs with stage summaries
- Add timing statistics for each phase
- Use icons (✓ ⚠ ✗) for better readability
- Reduce debug hover verbosity while keeping key info

Test coverage:
- 503 tests passing (added 40 new tests)
- 100% TypeScript compilation success
- Comprehensive coverage for all new features

Fixes: #categorization #parser #logging #tailwind-v4
2025-10-28 23:07:37 +08:00
.kiro docs: 整理文档结构,移除过时信息 2025-10-26 20:51:10 +08:00
.vscode task 4 2025-10-25 00:56:12 +08:00
agent-docs feat: complete decoration configuration system and cleanup legacy code 2025-10-28 00:28:16 +08:00
src feat: comprehensive fixes for categorization, parser, and logging 2025-10-28 23:07:37 +08:00
test-workspace fix: add support for bg-gradient-* classes in gradient manager 2025-10-27 23:53:03 +08:00
.gitignore docs: add Task 3.4 to reference official implementation 2025-10-25 15:17:23 +08:00
.npmrc task 2 2025-10-24 23:54:17 +08:00
.vscode-test.mjs task 2 2025-10-24 23:54:17 +08:00
.vscodeignore task 2 2025-10-24 23:54:17 +08:00
CHANGELOG.md docs: 整理文档结构,移除过时信息 2025-10-26 20:51:10 +08:00
esbuild.js task 2 2025-10-24 23:54:17 +08:00
eslint.config.mjs task 2 2025-10-24 23:54:17 +08:00
package.json feat: comprehensive fixes for categorization, parser, and logging 2025-10-28 23:07:37 +08:00
PARSER_CSS_PROPERTY_SUPPORT.md feat: comprehensive fixes for categorization, parser, and logging 2025-10-28 23:07:37 +08:00
pnpm-lock.yaml feat: comprehensive fixes for categorization, parser, and logging 2025-10-28 23:07:37 +08:00
pnpm-workspace.yaml feat: integrate Tailwind CSS Language Server 2025-10-25 15:12:09 +08:00
README.md feat: comprehensive fixes for categorization, parser, and logging 2025-10-28 23:07:37 +08:00
test-invalid-patterns.js docs: 整理文档结构,移除过时信息 2025-10-26 20:51:10 +08:00
tsconfig.json fix: Resolve TypeScript build errors 2025-10-26 14:21:21 +08:00
vitest.config.js docs: 整理文档结构,移除过时信息 2025-10-26 20:51:10 +08:00
vitest.config.js.map docs: 整理文档结构,移除过时信息 2025-10-26 20:51:10 +08:00
vitest.config.ts feat: Complete Tailwind parser rewrite with state machine architecture 2025-10-26 14:10:38 +08:00

TailwindCSS Class Enhancer

A VSCode extension that enhances your Tailwind CSS development experience with visual decorations and intelligent previews.

Features

🎨 Color Decorations

Visual underlines for all Tailwind color classes, making it easy to identify colors at a glance.

  • Background colors: bg-blue-500, bg-red-600
  • Text colors: text-gray-900, text-white
  • Border colors: border-green-500, border-t-purple-500
  • Ring colors: ring-blue-500, focus:ring-red-500
  • Gradient stops: from-pink-500, via-yellow-500, to-purple-600
  • Other colors: fill-red-500, stroke-blue-500, placeholder-gray-400

Supports all color formats: hex, rgb, hsl, oklch, oklab, lab, lch.

🌈 Gradient Preview

Hover over gradient classes to see a rich visual preview with:

  • 200x60px gradient preview
  • Gradient type and direction
  • All related classes
  • Generated CSS code

Supports:

  • Linear gradients: bg-linear-to-r, bg-linear-45deg
  • Radial gradients: bg-radial
  • Conic gradients: bg-conic-0deg

🔧 Arbitrary Values

Full support for Tailwind's arbitrary value syntax:

<div class="bg-[#1da1f2] text-[rgb(255,0,0)] w-[100px] p-[17px]">
	Custom values with visual decorations
</div>

Smart Detection

  • Position-aware class queries for accurate information
  • Comprehensive color extraction from CSS
  • Caching for optimal performance
  • Support for modifiers: hover:, dark:, md:, etc.

🐛 Debug Mode

New debug hover feature for development and troubleshooting:

  • Parser Output: See how class names are parsed into components
  • Grouping Data: View categorization and grouping logic
  • Decoration Output: Inspect applied decorations and styles
  • Toggle Command: Easy enable/disable via command palette

Enable debug mode:

Cmd+Shift+P → "Toggle Debug Mode"

Or in settings:

{
	"tailwindHighlighter.debug.hoverInfo": true
}

See [Debug Hover Documentation] for details.

Requirements

Extension Settings

This extension contributes the following settings:

  • tailwindClassEnhancer.highlightStyles.color.enabled: Enable/disable color decorations (default: true)
  • tailwindClassEnhancer.highlightStyles.color.border: Border width for color underlines (default: "2px")
  • tailwindClassEnhancer.scanner.debounceDelay: Delay before scanning after document changes (default: 300)
  • tailwindClassEnhancer.supportedLanguages: File types to scan (default: ["html", "javascriptreact", "typescriptreact", "vue", "svelte"])

Usage

  1. Install the extension
  2. Open a file with Tailwind CSS classes
  3. Color classes will automatically show colored underlines
  4. Hover over gradient classes to see previews
  5. Use Cmd/Ctrl + Shift + P → "Refresh Decorations" to manually refresh

Supported Languages

  • HTML
  • JavaScript/JSX
  • TypeScript/TSX
  • Vue
  • Svelte

Documentation

For detailed documentation, see the agent-docs/ directory:

Development

Setup

# Install dependencies
pnpm install

# Build
pnpm run compile

# Watch mode
pnpm run watch

Testing

Press F5 to launch the extension in development mode. See [Testing Guide] for details.

Known Issues

  • Gradient previews require both gradient type class and stop classes to be present
  • Some complex arbitrary values may not be fully supported

Release Notes

See [CHANGELOG.md] for release history.

Contributing

Contributions are welcome! Please read the documentation in agent-docs/ to understand the architecture.

License

MIT


Enjoy enhanced Tailwind CSS development!