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
| Capability | What it gives you |
|---|---|
| Multi-surface styling | Reuse utility classes across extension pages and content scripts |
| PostCSS-based integration | Keep Tailwind in the same CSS transform pipeline as the rest of your project |
| Version flexibility | Support Tailwind v3 and Tailwind v4 plugin patterns |
| Template onboarding | Start from ready-made setups and adapt incrementally |
Template examples
Sidebar + Tailwind + shadcn/ui
Use this template when you want a complete Tailwind setup in a real extension UI surface.
examples/sidebar-shadcn
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 config drift between PostCSS and Tailwind versions.

