Loading...
Loading...
WHEN: User is writing HTML/templates with Tailwind CSS classes, styling components, configuring Tailwind themes, asking about Tailwind utilities or patterns, or working with any project that uses Tailwind CSS WHEN NOT: Non-Tailwind CSS questions, general HTML/CSS without Tailwind context, questions about other CSS frameworks (Bootstrap, etc.)
npx skill4agent add gopherguides/gopher-ai tailwind-best-practicesmcp__tailwindcss__search_tailwind_docsmcp__tailwindcss__get_tailwind_utilitiesmcp__tailwindcss__get_tailwind_colorsmcp__tailwindcss__convert_css_to_tailwindmcp__tailwindcss__generate_component_template| Topic | URL |
|---|---|
| Installation | https://tailwindcss.com/docs/installation |
| Using Vite | https://tailwindcss.com/docs/installation/using-vite |
| Using PostCSS | https://tailwindcss.com/docs/installation/using-postcss |
| Tailwind CLI | https://tailwindcss.com/docs/installation/tailwind-cli |
| Editor Setup | https://tailwindcss.com/docs/editor-setup |
| Upgrade Guide | https://tailwindcss.com/docs/upgrade-guide |
| Topic | URL |
|---|---|
| Utility Classes | https://tailwindcss.com/docs/styling-with-utility-classes |
| Hover, Focus, States | https://tailwindcss.com/docs/hover-focus-and-other-states |
| Responsive Design | https://tailwindcss.com/docs/responsive-design |
| Dark Mode | https://tailwindcss.com/docs/dark-mode |
| Theme Variables | https://tailwindcss.com/docs/theme |
| Colors | https://tailwindcss.com/docs/colors |
| Custom Styles | https://tailwindcss.com/docs/adding-custom-styles |
| Functions & Directives | https://tailwindcss.com/docs/functions-and-directives |
| Topic | URL |
|---|---|
| Padding | https://tailwindcss.com/docs/padding |
| Margin | https://tailwindcss.com/docs/margin |
| Space Between | https://tailwindcss.com/docs/space |
| Topic | URL |
|---|---|
| Width | https://tailwindcss.com/docs/width |
| Height | https://tailwindcss.com/docs/height |
| Min/Max Width | https://tailwindcss.com/docs/min-width |
| Min/Max Height | https://tailwindcss.com/docs/min-height |
| Topic | URL |
|---|---|
| Font Family | https://tailwindcss.com/docs/font-family |
| Font Size | https://tailwindcss.com/docs/font-size |
| Font Weight | https://tailwindcss.com/docs/font-weight |
| Line Height | https://tailwindcss.com/docs/line-height |
| Text Color | https://tailwindcss.com/docs/text-color |
| Text Align | https://tailwindcss.com/docs/text-align |
| Topic | URL |
|---|---|
| Background Color | https://tailwindcss.com/docs/background-color |
| Background Image | https://tailwindcss.com/docs/background-image |
| Border Radius | https://tailwindcss.com/docs/border-radius |
| Border Width | https://tailwindcss.com/docs/border-width |
| Border Color | https://tailwindcss.com/docs/border-color |
| Box Shadow | https://tailwindcss.com/docs/box-shadow |
| Topic | URL |
|---|---|
| Opacity | https://tailwindcss.com/docs/opacity |
| Shadow | https://tailwindcss.com/docs/box-shadow |
| Blur | https://tailwindcss.com/docs/blur |
| Topic | URL |
|---|---|
| Cursor | https://tailwindcss.com/docs/cursor |
| User Select | https://tailwindcss.com/docs/user-select |
| Scroll Behavior | https://tailwindcss.com/docs/scroll-behavior |
@import "tailwindcss";@tailwind base; @tailwind components; @tailwind utilities;@theme {
/* Colors - use oklch for better color manipulation */
--color-primary: oklch(0.6 0.2 250);
--color-primary-foreground: oklch(1 0 0);
--color-secondary: oklch(0.5 0.02 250);
--color-secondary-foreground: oklch(1 0 0);
/* Semantic colors */
--color-background: oklch(1 0 0);
--color-foreground: oklch(0.145 0 0);
--color-muted: oklch(0.95 0 0);
--color-muted-foreground: oklch(0.4 0 0);
--color-border: oklch(0.9 0 0);
--color-destructive: oklch(0.55 0.25 25);
/* Font families */
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
--font-mono: "Fira Code", ui-monospace, monospace;
/* Custom spacing (extends default scale) */
--spacing-18: 4.5rem;
--spacing-22: 5.5rem;
/* Custom border radius */
--radius-4xl: 2rem;
}@source@source "./templates/**/*.templ";
@source "./components/**/*.html";
@source "./src/**/*.{js,jsx,ts,tsx,vue,svelte}";@variant dark {
--color-background: oklch(0.145 0 0);
--color-foreground: oklch(0.985 0 0);
--color-muted: oklch(0.25 0 0);
--color-muted-foreground: oklch(0.6 0 0);
--color-border: oklch(0.3 0 0);
--color-card: oklch(0.205 0 0);
}@layer components {
.btn {
@apply px-4 py-2 rounded-lg font-medium transition-colors;
}
.btn-primary {
@apply btn bg-primary text-primary-foreground hover:bg-primary/90;
}
.btn-secondary {
@apply btn bg-secondary text-secondary-foreground hover:bg-secondary/90;
}
.card {
@apply p-6 bg-card rounded-xl border border-border shadow-sm;
}
}@plugin "@tailwindcss/typography";<!-- Good: Logical order -->
<div class="flex items-center gap-4 p-4 w-full text-sm text-gray-700 bg-white shadow-sm hover:bg-gray-50 transition-colors">
<!-- Bad: Random order -->
<div class="hover:bg-gray-50 flex bg-white p-4 text-sm shadow-sm w-full gap-4 items-center text-gray-700 transition-colors"><!-- Mobile first -->
<div class="w-full md:w-1/2 lg:w-1/3">
<!-- Breakpoints -->
sm: 640px <!-- Small devices -->
md: 768px <!-- Medium devices -->
lg: 1024px <!-- Large devices -->
xl: 1280px <!-- Extra large -->
2xl: 1536px <!-- 2X large -->/* Instead of repeating in HTML */
@layer components {
.flex-center {
@apply flex items-center justify-center;
}
.text-muted {
@apply text-sm text-muted-foreground;
}
}<!-- Good: Uses theme variable -->
<div class="bg-primary text-primary-foreground">
<!-- Bad: Hardcoded color -->
<div class="bg-[#3b82f6] text-white"><!-- Focus states -->
<button class="focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none">
<!-- Screen reader only -->
<span class="sr-only">Close menu</span>
<!-- Ensure contrast -->
<!-- Use oklch colors with sufficient lightness difference -->| Wrong (v3) | Correct (v4) |
|---|---|
| CSS |
| |
| (included in import) |
| (included in import) |
| |
| |
| |
<!-- Wrong: Inline styles when utility exists -->
<div style="display: flex; gap: 1rem;">
<!-- Correct -->
<div class="flex gap-4">
<!-- Wrong: px values when scale exists -->
<div class="p-[16px]">
<!-- Correct -->
<div class="p-4">
<!-- Wrong: Duplicate utilities -->
<div class="p-4 p-6">
<!-- Correct -->
<div class="p-6">
<!-- Wrong: Conflicting utilities -->
<div class="flex block">
<!-- Correct: Choose one -->
<div class="flex">bg-primarybg-blue-500mcp__tailwindcss__get_tailwind_utilities<button class="px-4 py-2 rounded-lg font-medium bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none transition-colors">
Click me
</button>| Class | Size |
|---|---|
| 1 | 0.25rem (4px) |
| 2 | 0.5rem (8px) |
| 3 | 0.75rem (12px) |
| 4 | 1rem (16px) |
| 5 | 1.25rem (20px) |
| 6 | 1.5rem (24px) |
| 8 | 2rem (32px) |
| 10 | 2.5rem (40px) |
| 12 | 3rem (48px) |
| 16 | 4rem (64px) |
<!-- Centered content -->
<div class="flex items-center justify-center">
<!-- Card -->
<div class="p-6 bg-card rounded-xl border border-border shadow-sm">
<!-- Responsive grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Truncated text -->
<p class="truncate">Long text that will be truncated...</p>
<!-- Gradient background -->
<div class="bg-gradient-to-r from-primary to-secondary">
<!-- Fixed header -->
<header class="fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-sm">