When Tailwind CSS is a good fit
- You need fast UI iteration across multiple extension surfaces.
- You prefer utility-first styling with shared tokens.
- You want consistent styling patterns across page and content-script entries.
Tailwind capabilities
Template examples
Sidebar + Tailwind + shadcn/ui
Use this template when you want a complete Tailwind setup in a real extension UI surface.
Usage with an existing extension
Installation
Install the required dependencies:Configuration
Createpostcss.config.js:
tailwindcss as the PostCSS plugin and keep a tailwind.config.js content list.
Tailwind v4 vs v3 quick setup
Tailwind content paths (v3 style)
Usage
Create a global stylesheet and import Tailwind:Create the global CSS file
In a page script (popup/options/new-tab)
In a content script
content_scripts/.
Best practices
- Keep Tailwind source imports in shared style entry files (
styles/globals.css). - Ensure your content scanning includes
pages/,scripts/, andsrc/when relevant. - In monorepos, verify Tailwind content paths resolve from the extension project root.
- Use templates when possible to avoid configuration drift between PostCSS and Tailwind versions.

