Skip to content

Add Tailwind 4 plugin for automatic MCU color variable mapping#60

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-tailwind-plugin-automation
Draft

Add Tailwind 4 plugin for automatic MCU color variable mapping#60
Copilot wants to merge 4 commits intomainfrom
copilot/add-tailwind-plugin-automation

Conversation

Copy link

Copilot AI commented Jan 24, 2026

Users previously had to manually copy 180+ lines of @theme CSS variable mappings and manually add custom color definitions. This plugin automates both.

Changes

Plugin implementation (src/tailwind-plugin.js)

  • Maps all --mcu-* CSS variables to Tailwind theme colors (background, surface, primary, secondary, tertiary, error, neutral variants)
  • Generates shade mappings (50-950) for all color palettes
  • Accepts customColors array parameter for dynamic custom color registration
  • Converts camelCase color names to kebab-case for CSS variable compatibility

Package configuration

  • Exported plugin at react-mcu/tailwind-plugin with TypeScript definitions
  • Added post-build script to copy .d.ts files after tsup's DTS build phase

Documentation

  • Added plugin usage examples to README with and without custom colors

Usage

Before:

@import "react-mcu/tailwind.css";
/* + manually add custom color mappings */

After:

@import "tailwindcss";
@plugin "react-mcu/tailwind-plugin" {
  customColors: ["myCustomColor1", "myCustomColor2"];
}

Enables: bg-primary, text-on-surface, bg-myCustomColor1-500, etc.

Original prompt

code un plugin tailwind 4 qui automatise les instructions du readme (section tailwind) pour qu'un utilisateur tw puisse directemwbt @plugin dans son css - gere la transmission de parametres (au besoin inspire toi des plugin officiels tailwind pour voir comment ils code t ca proprement


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 24, 2026 17:19
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Tailwind 4 plugin for README instruction automation Add Tailwind 4 plugin for automatic MCU color variable mapping Jan 24, 2026
Copilot AI requested a review from abernier January 24, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants