@biggora/claude-plugins 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/package.json +1 -1
- package/registry/registry.json +319 -244
- package/specs/coding.md +24 -0
- package/specs/pod.md +2 -0
- package/src/skills/captcha/README.md +221 -0
- package/src/skills/captcha/SKILL.md +355 -0
- package/src/skills/captcha/references/captcha-types.md +254 -0
- package/src/skills/captcha/references/services.md +172 -0
- package/src/skills/captcha/references/stealth.md +238 -0
- package/src/skills/captcha/scripts/solve_captcha.py +323 -0
- package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
- package/src/skills/google-merchant-api/SKILL.md +581 -0
- package/src/skills/google-merchant-api/references/accounts.md +247 -0
- package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
- package/src/skills/google-merchant-api/references/datasources.md +233 -0
- package/src/skills/google-merchant-api/references/inventories.md +201 -0
- package/src/skills/google-merchant-api/references/migration.md +267 -0
- package/src/skills/google-merchant-api/references/products.md +316 -0
- package/src/skills/google-merchant-api/references/promotions.md +201 -0
- package/src/skills/google-merchant-api/references/reports.md +240 -0
- package/src/skills/lv-aggregators-api/SKILL.md +113 -0
- package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
- package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
- package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
- package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
- package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
- package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
- package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
- package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
- package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
- package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
- package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
- package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
- package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
- package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
- package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
- package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
- package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
- package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
- package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
- package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
- package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
- package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
- package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
- package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
- package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
- package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
- package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
- package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
- package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
- package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
- package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
- package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
- package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
- package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
- package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
- package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
- package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
- package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
- package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
- package/src/skills/test-mobile-app/SKILL.md +11 -6
- package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
- package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
- package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
- package/src/skills/test-web-ui/SKILL.md +264 -84
- package/src/skills/test-web-ui/scripts/discover.py +25 -12
- package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
- package/src/skills/vite-best-practices/SKILL.md +115 -0
- package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
- package/src/skills/vite-best-practices/references/core-config.md +231 -0
- package/src/skills/vite-best-practices/references/core-features.md +222 -0
- package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
- package/src/skills/vite-best-practices/references/environment-api.md +108 -0
- package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
- package/codex-cli-workspace/iteration-1/benchmark.json +0 -122
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/outputs/response.md +0 -163
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/grading.json +0 -58
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/outputs/response.md +0 -151
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -86
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -58
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/outputs/response.md +0 -130
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/grading.json +0 -64
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/outputs/response.md +0 -209
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/review.html +0 -1325
- package/gemini-cli-workspace/iteration-1/benchmark.json +0 -86
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/outputs/response.md +0 -401
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/outputs/response.md +0 -405
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -212
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -427
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/eval_metadata.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -171
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -199
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/review.html +0 -1325
- package/gemini-cli-workspace/iteration-2/benchmark.json +0 -173
- package/gemini-cli-workspace/iteration-2/benchmark.md +0 -28
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/outputs/response.md +0 -195
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/outputs/response.md +0 -377
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -127
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/eval_metadata.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -91
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -112
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-viewer.html +0 -1325
- package/screen-recording-workspace/evals.json +0 -41
- package/screen-recording-workspace/iteration-1/benchmark.json +0 -102
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/outputs/demo.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/outputs/demo.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/outputs/region_capture.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/outputs/region_capture.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/outputs/fallback_recording.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/fallback_recording.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/record_screen.py +0 -67
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/review.html +0 -1325
- package/src/skills/codex-cli/evals/evals.json +0 -47
- package/src/skills/gemini-cli/evals/evals.json +0 -46
- package/src/skills/tm-search/evals/evals.json +0 -23
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tailwindcss-best-practices
|
|
3
|
+
description: Tailwind CSS v4.x utility-first CSS framework best practices. Use when styling web applications with utility classes, building responsive layouts, customizing design systems with @theme variables, migrating from v3 to v4, configuring dark mode, creating custom utilities with @utility, or working with any Tailwind CSS v4 features. This skill covers the full v4.x line through v4.2 including text shadows, masks, logical properties, and source detection. Use this skill even for simple Tailwind questions — v4 changed many class names and configuration patterns that trip people up.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tailwind CSS v4.x Best Practices
|
|
7
|
+
|
|
8
|
+
> Covers Tailwind CSS v4.0 through v4.2.2 (latest stable as of March 2026). Always check the official docs at https://tailwindcss.com/docs for the latest.
|
|
9
|
+
|
|
10
|
+
Tailwind CSS is a utility-first CSS framework. Instead of writing custom CSS, you compose designs using utility classes directly in your markup. Tailwind v4 introduced CSS-first configuration with `@theme` variables, `@utility` for custom utilities, and `@custom-variant` for custom variants — replacing the old `tailwind.config.js` approach entirely.
|
|
11
|
+
|
|
12
|
+
## Critical v4 Migration Gotchas
|
|
13
|
+
|
|
14
|
+
These are the most common mistakes when working with Tailwind v4. If you're migrating from v3 or using v4 for the first time, read the [upgrade guide](references/features-upgrade.md) — but here are the top trip-ups:
|
|
15
|
+
|
|
16
|
+
| v3 (old) | v4 (correct) | Why it changed |
|
|
17
|
+
|----------|-------------|----------------|
|
|
18
|
+
| `!bg-red-500` | `bg-red-500!` | Important modifier moved from prefix to suffix |
|
|
19
|
+
| `bg-opacity-75` | `bg-red-500/75` | Opacity modifiers removed; use slash syntax on the color |
|
|
20
|
+
| `shadow` | `shadow-sm` | Shadow scale shifted down one step |
|
|
21
|
+
| `shadow-sm` | `shadow-xs` | Shadow scale shifted down one step |
|
|
22
|
+
| `rounded` | `rounded-sm` | Border radius scale shifted down one step |
|
|
23
|
+
| `rounded-sm` | `rounded-xs` | Border radius scale shifted down one step |
|
|
24
|
+
| `ring` | `ring-3` | Default ring width changed from 3px to 1px |
|
|
25
|
+
| `outline-none` | `outline-hidden` | Renamed for clarity |
|
|
26
|
+
| `flex-shrink-0` | `shrink-0` | Shorter alias is now the only form |
|
|
27
|
+
| `flex-grow` | `grow` | Shorter alias is now the only form |
|
|
28
|
+
| `overflow-ellipsis` | `text-ellipsis` | Renamed for consistency |
|
|
29
|
+
| `blur` | `blur-sm` | Blur scale shifted down one step |
|
|
30
|
+
| `@tailwind base/components/utilities` | `@import "tailwindcss"` | Single CSS import replaces three directives |
|
|
31
|
+
| `tailwind.config.js` | `@theme { }` in CSS | CSS-first configuration replaces JS config |
|
|
32
|
+
| `darkMode: 'class'` | `@custom-variant dark (&:where(.dark, .dark *));` | Dark mode config moves to CSS |
|
|
33
|
+
| `bg-[--var]` | `bg-(--var)` | CSS variable arbitrary values use parentheses |
|
|
34
|
+
| `theme(screens.xl)` | `theme(--breakpoint-xl)` | Theme function uses CSS variable names |
|
|
35
|
+
| `@layer utilities { }` | `@utility name { }` | Custom utilities use dedicated directive |
|
|
36
|
+
| `start-*` / `end-*` | `inset-s-*` / `inset-e-*` | Deprecated in v4.2 |
|
|
37
|
+
|
|
38
|
+
## Core References
|
|
39
|
+
|
|
40
|
+
| Topic | Description | Reference |
|
|
41
|
+
|-------|-------------|-----------|
|
|
42
|
+
| Installation | Vite, PostCSS, Webpack, CLI, and CDN setup | [core-installation](references/core-installation.md) |
|
|
43
|
+
| Utility Classes | Understanding Tailwind's utility-first approach | [core-utility-classes](references/core-utility-classes.md) |
|
|
44
|
+
| Theme Variables | Design tokens, `@theme` directive, theme variable namespaces | [core-theme](references/core-theme.md) |
|
|
45
|
+
| Responsive Design | Mobile-first breakpoints, responsive variants, container queries | [core-responsive](references/core-responsive.md) |
|
|
46
|
+
| Variants | Conditional styling with state, pseudo-class, media query, and pointer variants | [core-variants](references/core-variants.md) |
|
|
47
|
+
| Preflight | Tailwind's base styles and how to extend or disable them | [core-preflight](references/core-preflight.md) |
|
|
48
|
+
| Source Detection | How Tailwind detects classes, `@source`, `@source not`, `@source inline()` | [core-source-detection](references/core-source-detection.md) |
|
|
49
|
+
|
|
50
|
+
## Layout
|
|
51
|
+
|
|
52
|
+
### Display & Flexbox & Grid
|
|
53
|
+
|
|
54
|
+
| Topic | Description | Reference |
|
|
55
|
+
|-------|-------------|-----------|
|
|
56
|
+
| Display | flex, grid, block, inline, hidden, sr-only, flow-root, contents | [layout-display](references/layout-display.md) |
|
|
57
|
+
| Flexbox | flex-direction, justify, items, gap, grow, shrink, wrap, order | [layout-flexbox](references/layout-flexbox.md) |
|
|
58
|
+
| Grid | grid-cols, grid-rows, gap, place-items, col-span, row-span, subgrid | [layout-grid](references/layout-grid.md) |
|
|
59
|
+
| Aspect Ratio | Controlling element aspect ratio for responsive media | [layout-aspect-ratio](references/layout-aspect-ratio.md) |
|
|
60
|
+
| Columns | Multi-column layout for magazine-style or masonry layouts | [layout-columns](references/layout-columns.md) |
|
|
61
|
+
|
|
62
|
+
### Positioning
|
|
63
|
+
|
|
64
|
+
| Topic | Description | Reference |
|
|
65
|
+
|-------|-------------|-----------|
|
|
66
|
+
| Position | Controlling element positioning with static, relative, absolute, fixed, and sticky | [layout-position](references/layout-position.md) |
|
|
67
|
+
| Inset | Placement of positioned elements with inset, logical inset (`inset-s-*`, `inset-bs-*`), and deprecated `start-*`/`end-*` | [layout-inset](references/layout-inset.md) |
|
|
68
|
+
|
|
69
|
+
### Sizing
|
|
70
|
+
|
|
71
|
+
| Topic | Description | Reference |
|
|
72
|
+
|-------|-------------|-----------|
|
|
73
|
+
| Width | Setting element width with spacing scale, fractions, container sizes, viewport units | [layout-width](references/layout-width.md) |
|
|
74
|
+
| Height | Setting element height with spacing scale, fractions, viewport units | [layout-height](references/layout-height.md) |
|
|
75
|
+
| Min & Max Sizing | min-width, max-width, min-height, max-height constraints | [layout-min-max-sizing](references/layout-min-max-sizing.md) |
|
|
76
|
+
| Logical Sizing | Writing-mode-aware sizing: `inline-*`, `block-*`, `min-inline-*`, `max-block-*` (v4.2) | [layout-logical-properties](references/layout-logical-properties.md) |
|
|
77
|
+
|
|
78
|
+
### Spacing
|
|
79
|
+
|
|
80
|
+
| Topic | Description | Reference |
|
|
81
|
+
|-------|-------------|-----------|
|
|
82
|
+
| Margin | Margins with spacing scale, negative values, logical properties (`mbs-*`, `mbe-*`) | [layout-margin](references/layout-margin.md) |
|
|
83
|
+
| Padding | Padding with spacing scale, logical properties (`pbs-*`, `pbe-*`) | [layout-padding](references/layout-padding.md) |
|
|
84
|
+
|
|
85
|
+
### Overflow
|
|
86
|
+
|
|
87
|
+
| Topic | Description | Reference |
|
|
88
|
+
|-------|-------------|-----------|
|
|
89
|
+
| Overflow | Controlling how elements handle content that overflows | [layout-overflow](references/layout-overflow.md) |
|
|
90
|
+
|
|
91
|
+
### Images & Replaced Elements
|
|
92
|
+
|
|
93
|
+
| Topic | Description | Reference |
|
|
94
|
+
|-------|-------------|-----------|
|
|
95
|
+
| Object Fit & Position | Controlling how images and video are resized and positioned | [layout-object-fit-position](references/layout-object-fit-position.md) |
|
|
96
|
+
|
|
97
|
+
### Tables
|
|
98
|
+
|
|
99
|
+
| Topic | Description | Reference |
|
|
100
|
+
|-------|-------------|-----------|
|
|
101
|
+
| Table Layout | border-collapse, table-auto, table-fixed | [layout-tables](references/layout-tables.md) |
|
|
102
|
+
|
|
103
|
+
## Transforms
|
|
104
|
+
|
|
105
|
+
| Topic | Description | Reference |
|
|
106
|
+
|-------|-------------|-----------|
|
|
107
|
+
| Transform Base | Base transform utilities, hardware acceleration, custom transform values | [transform-base](references/transform-base.md) |
|
|
108
|
+
| Translate | Translating elements on x, y, z axes with spacing scale and percentages | [transform-translate](references/transform-translate.md) |
|
|
109
|
+
| Rotate | Rotating elements in 2D and 3D space | [transform-rotate](references/transform-rotate.md) |
|
|
110
|
+
| Scale | Scaling elements uniformly or on specific axes | [transform-scale](references/transform-scale.md) |
|
|
111
|
+
| Skew | Skewing elements on x and y axes | [transform-skew](references/transform-skew.md) |
|
|
112
|
+
|
|
113
|
+
## Typography
|
|
114
|
+
|
|
115
|
+
| Topic | Description | Reference |
|
|
116
|
+
|-------|-------------|-----------|
|
|
117
|
+
| Font & Text | Font size, weight, color, line-height, letter-spacing, decoration, truncate, `wrap-break-word`, `wrap-anywhere` | [typography-font-text](references/typography-font-text.md) |
|
|
118
|
+
| Text Align | Controlling text alignment with left, center, right, justify | [typography-text-align](references/typography-text-align.md) |
|
|
119
|
+
| List Style | list-style-type, list-style-position for bullets and markers | [typography-list-style](references/typography-list-style.md) |
|
|
120
|
+
|
|
121
|
+
## Visual
|
|
122
|
+
|
|
123
|
+
| Topic | Description | Reference |
|
|
124
|
+
|-------|-------------|-----------|
|
|
125
|
+
| Background | Background color, gradient, image, size, position | [visual-background](references/visual-background.md) |
|
|
126
|
+
| Border | Border width, color, radius, divide, ring, block border utilities (`border-bs-*`, `border-be-*`) | [visual-border](references/visual-border.md) |
|
|
127
|
+
| Effects | Box shadow, opacity, mix-blend, backdrop-blur, filter, colored drop shadows | [visual-effects](references/visual-effects.md) |
|
|
128
|
+
| SVG | fill, stroke, stroke-width for SVG and icon styling | [visual-svg](references/visual-svg.md) |
|
|
129
|
+
| Text Shadow | Text shadow sizes, colors, and opacity modifiers (v4.1) | [effects-text-shadow](references/effects-text-shadow.md) |
|
|
130
|
+
| Mask | Composable mask utilities with gradient and radial masks (v4.1) | [effects-mask](references/effects-mask.md) |
|
|
131
|
+
|
|
132
|
+
## Effects & Interactivity
|
|
133
|
+
|
|
134
|
+
| Topic | Description | Reference |
|
|
135
|
+
|-------|-------------|-----------|
|
|
136
|
+
| Transition & Animation | CSS transitions, animation keyframes, reduced motion | [effects-transition-animation](references/effects-transition-animation.md) |
|
|
137
|
+
| Visibility & Interactivity | Visibility, cursor, pointer-events, user-select, z-index | [effects-visibility-interactivity](references/effects-visibility-interactivity.md) |
|
|
138
|
+
| Form Controls | accent-color, appearance, caret-color, resize | [effects-form-controls](references/effects-form-controls.md) |
|
|
139
|
+
| Scroll Snap | scroll-snap-type, scroll-snap-align for carousels | [effects-scroll-snap](references/effects-scroll-snap.md) |
|
|
140
|
+
|
|
141
|
+
## Features
|
|
142
|
+
|
|
143
|
+
### Dark Mode
|
|
144
|
+
|
|
145
|
+
| Topic | Description | Reference |
|
|
146
|
+
|-------|-------------|-----------|
|
|
147
|
+
| Dark Mode | Dark mode with `dark:` variant, `@custom-variant`, class and data-attribute strategies | [features-dark-mode](references/features-dark-mode.md) |
|
|
148
|
+
|
|
149
|
+
### Migration
|
|
150
|
+
|
|
151
|
+
| Topic | Description | Reference |
|
|
152
|
+
|-------|-------------|-----------|
|
|
153
|
+
| Upgrade Guide | Migrating from v3 to v4, all renamed/removed utilities, scale shifts, config migration | [features-upgrade](references/features-upgrade.md) |
|
|
154
|
+
|
|
155
|
+
### Customization
|
|
156
|
+
|
|
157
|
+
| Topic | Description | Reference |
|
|
158
|
+
|-------|-------------|-----------|
|
|
159
|
+
| Custom Styles | Adding custom styles, utilities with `@utility`, variants with `@custom-variant`, arbitrary values | [features-custom-styles](references/features-custom-styles.md) |
|
|
160
|
+
| Functions & Directives | Tailwind's CSS directives (`@theme`, `@utility`, `@custom-variant`, `@source`) and functions | [features-functions-directives](references/features-functions-directives.md) |
|
|
161
|
+
| Content Detection | How Tailwind detects classes, `@source` configuration, safelisting with `@source inline()` | [features-content-detection](references/features-content-detection.md) |
|
|
162
|
+
|
|
163
|
+
## Best Practices
|
|
164
|
+
|
|
165
|
+
| Topic | Description | Reference |
|
|
166
|
+
|-------|-------------|-----------|
|
|
167
|
+
| Utility Patterns | Managing duplication, conflicts, important modifier, when to use components | [best-practices-utility-patterns](references/best-practices-utility-patterns.md) |
|
|
168
|
+
|
|
169
|
+
## Key Recommendations
|
|
170
|
+
|
|
171
|
+
- **Use utility classes directly in markup** — compose designs by combining utilities
|
|
172
|
+
- **Customize with `@theme` directive** — define design tokens as CSS variables, not in JS config
|
|
173
|
+
- **Mobile-first responsive design** — unprefixed utilities for mobile, prefixed for breakpoints
|
|
174
|
+
- **Use complete class names** — never construct classes dynamically with string interpolation
|
|
175
|
+
- **Leverage variants** — stack variants for complex conditional styling (`dark:md:hover:bg-blue-600`)
|
|
176
|
+
- **Prefer CSS-first configuration** — use `@theme`, `@utility`, and `@custom-variant` over JavaScript configs
|
|
177
|
+
- **Use oklch for custom colors** — Tailwind v4 defaults to oklch; prefer it for perceptual uniformity
|
|
178
|
+
- **Use rem for custom breakpoints** — e.g., `--breakpoint-3xl: 90rem` not `1440px`
|
|
179
|
+
- **Know the scale shifts** — shadow, rounded, and blur all shifted down one step in v4
|
|
180
|
+
- **Use `@custom-variant`** (not `@variant`) — for defining custom variants like class-based dark mode
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: best-practices-utility-patterns
|
|
3
|
+
description: Managing duplication, conflicts, important modifier, and when to use components
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Best Practices: Utility Patterns
|
|
7
|
+
|
|
8
|
+
Practical patterns when building with Tailwind utilities.
|
|
9
|
+
|
|
10
|
+
## Managing duplication
|
|
11
|
+
|
|
12
|
+
**Use components** for repeated UI: Extract into React/Vue/Svelte components or template partials.
|
|
13
|
+
|
|
14
|
+
```jsx
|
|
15
|
+
function Button({ children, variant = 'primary' }) {
|
|
16
|
+
const base = 'px-4 py-2 rounded-lg font-medium'
|
|
17
|
+
const variants = {
|
|
18
|
+
primary: 'bg-blue-500 hover:bg-blue-600 text-white',
|
|
19
|
+
secondary: 'bg-gray-200 hover:bg-gray-300 text-gray-900',
|
|
20
|
+
}
|
|
21
|
+
return <button className={`${base} ${variants[variant]}`}>{children}</button>
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Use loops** when markup is repeated from data—the class list is written once.
|
|
26
|
+
|
|
27
|
+
**Multi-cursor editing** for localized duplication in a single file.
|
|
28
|
+
|
|
29
|
+
## Managing conflicts
|
|
30
|
+
|
|
31
|
+
When two utilities target the same property, the one **later in the stylesheet** wins. Avoid adding conflicting classes:
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<!-- Bad -->
|
|
35
|
+
<div class="flex grid">Conflict</div>
|
|
36
|
+
|
|
37
|
+
<!-- Good: conditional class -->
|
|
38
|
+
<div class={gridLayout ? 'grid' : 'flex'}>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Important modifier
|
|
42
|
+
|
|
43
|
+
Add `!` suffix to force `!important`:
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<div class="bg-teal-500 bg-red-500!">Red wins</div>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Use sparingly; prefer fixing specificity properly.
|
|
50
|
+
|
|
51
|
+
## Important flag (global)
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@import "tailwindcss" important;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Makes all utilities `!important`. Useful when integrating into existing high-specificity CSS.
|
|
58
|
+
|
|
59
|
+
## Prefix option
|
|
60
|
+
|
|
61
|
+
```css
|
|
62
|
+
@import "tailwindcss" prefix(tw);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Generates `tw:text-red-500` etc. Use when project class names conflict with Tailwind.
|
|
66
|
+
|
|
67
|
+
## When to use inline styles
|
|
68
|
+
|
|
69
|
+
- Values from API/database (e.g. brand colors)
|
|
70
|
+
- Dynamic values that change at runtime
|
|
71
|
+
- Complex arbitrary values hard to read as class names
|
|
72
|
+
- Pattern: set CSS variables via inline style, reference with `bg-(--my-var)`
|
|
73
|
+
|
|
74
|
+
## Key Points
|
|
75
|
+
|
|
76
|
+
- Extract repeated patterns into components
|
|
77
|
+
- Never add two conflicting utilities—use conditional classes
|
|
78
|
+
- `!` suffix = single utility `!important`
|
|
79
|
+
- `important` flag = all utilities `!important`
|
|
80
|
+
- `prefix(tw)` = prefix all utilities
|
|
81
|
+
- Use inline styles for dynamic values; utilities for static design
|
|
82
|
+
|
|
83
|
+
<!--
|
|
84
|
+
Source references:
|
|
85
|
+
- https://tailwindcss.com/docs/utility-first#managing-duplication
|
|
86
|
+
- https://tailwindcss.com/docs/utility-first#managing-style-conflicts
|
|
87
|
+
-->
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: core-installation
|
|
3
|
+
description: Installing Tailwind CSS with Vite, PostCSS, CLI, or CDN
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Installation
|
|
7
|
+
|
|
8
|
+
How to add Tailwind CSS to a project.
|
|
9
|
+
|
|
10
|
+
## Vite (Recommended)
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install tailwindcss @tailwindcss/vite
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
// vite.config.ts
|
|
18
|
+
import { defineConfig } from 'vite'
|
|
19
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
20
|
+
|
|
21
|
+
export default defineConfig({
|
|
22
|
+
plugins: [tailwindcss()],
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```css
|
|
27
|
+
/* style.css */
|
|
28
|
+
@import "tailwindcss";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## PostCSS
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install tailwindcss @tailwindcss/postcss postcss
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
// postcss.config.js
|
|
39
|
+
export default {
|
|
40
|
+
plugins: {
|
|
41
|
+
'@tailwindcss/postcss': {},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```css
|
|
47
|
+
@import "tailwindcss";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Tailwind CLI
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
/* input.css */
|
|
58
|
+
@import "tailwindcss";
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Webpack (v4.2+)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install tailwindcss @tailwindcss/webpack
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
// webpack.config.js
|
|
69
|
+
const tailwindcss = require('@tailwindcss/webpack')
|
|
70
|
+
|
|
71
|
+
module.exports = {
|
|
72
|
+
plugins: [tailwindcss()],
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```css
|
|
77
|
+
@import "tailwindcss";
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Play CDN (Development only)
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Not for production: no purging, larger payload.
|
|
87
|
+
|
|
88
|
+
## Framework guides
|
|
89
|
+
|
|
90
|
+
- **Nuxt**: `@nuxtjs/tailwindcss` module or `@tailwindcss/vite`
|
|
91
|
+
- **Next.js**: Use Vite or PostCSS with `tailwind.config.js` if needed
|
|
92
|
+
- **React Router / SvelteKit / SolidJS**: Use `@tailwindcss/vite`
|
|
93
|
+
|
|
94
|
+
## Key Points
|
|
95
|
+
|
|
96
|
+
- Vite: `@tailwindcss/vite` plugin + `@import "tailwindcss"` (supports Vite 8+)
|
|
97
|
+
- PostCSS: `@tailwindcss/postcss`
|
|
98
|
+
- Webpack: `@tailwindcss/webpack` (v4.2+)
|
|
99
|
+
- CLI: `npx @tailwindcss/cli`
|
|
100
|
+
- v4 uses CSS-first config; no `tailwind.config.js` required for basics
|
|
101
|
+
- Use `@theme` in CSS to customize design tokens
|
|
102
|
+
|
|
103
|
+
<!--
|
|
104
|
+
Source references:
|
|
105
|
+
- https://tailwindcss.com/docs/installation/using-vite
|
|
106
|
+
- https://tailwindcss.com/docs/installation/using-postcss
|
|
107
|
+
- https://tailwindcss.com/docs/installation/tailwind-cli
|
|
108
|
+
- https://tailwindcss.com/docs/installation/play-cdn
|
|
109
|
+
-->
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: core-preflight
|
|
3
|
+
description: Understanding Tailwind's Preflight base styles and how to extend or disable them
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Preflight
|
|
7
|
+
|
|
8
|
+
Preflight is Tailwind's opinionated set of base styles that smooth over cross-browser inconsistencies.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Built on top of modern-normalize, Preflight is automatically injected when you import `tailwindcss`:
|
|
13
|
+
|
|
14
|
+
```css
|
|
15
|
+
@layer theme, base, components, utilities;
|
|
16
|
+
|
|
17
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
18
|
+
@import "tailwindcss/preflight.css" layer(base);
|
|
19
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Key Resets
|
|
23
|
+
|
|
24
|
+
### Margins Removed
|
|
25
|
+
|
|
26
|
+
All default margins are removed from headings, paragraphs, blockquotes, etc:
|
|
27
|
+
|
|
28
|
+
```css
|
|
29
|
+
*,
|
|
30
|
+
::after,
|
|
31
|
+
::before {
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This prevents accidentally relying on browser default margins that aren't part of your spacing scale.
|
|
38
|
+
|
|
39
|
+
### Border Styles Reset
|
|
40
|
+
|
|
41
|
+
Borders are reset to make adding borders easier:
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
*,
|
|
45
|
+
::after,
|
|
46
|
+
::before {
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
border: 0 solid;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Since the `border` utility only sets `border-width`, this ensures adding `border` always creates a solid `1px` border using `currentColor`.
|
|
53
|
+
|
|
54
|
+
### Headings Unstyled
|
|
55
|
+
|
|
56
|
+
All headings are unstyled by default:
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
h1, h2, h3, h4, h5, h6 {
|
|
60
|
+
font-size: inherit;
|
|
61
|
+
font-weight: inherit;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Reasons:**
|
|
66
|
+
- Avoids deviating from your type scale
|
|
67
|
+
- In UI development, headings should often be visually de-emphasized
|
|
68
|
+
|
|
69
|
+
### Lists Unstyled
|
|
70
|
+
|
|
71
|
+
Ordered and unordered lists have no bullets or numbers:
|
|
72
|
+
|
|
73
|
+
```css
|
|
74
|
+
ol, ul, menu {
|
|
75
|
+
list-style: none;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Style lists using utilities:
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<ul class="list-inside list-disc">
|
|
83
|
+
<li>One</li>
|
|
84
|
+
<li>Two</li>
|
|
85
|
+
</ul>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Accessibility:** Add `role="list"` for screen readers when keeping lists unstyled:
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<ul role="list">
|
|
92
|
+
<li>One</li>
|
|
93
|
+
<li>Two</li>
|
|
94
|
+
</ul>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Images Are Block-Level
|
|
98
|
+
|
|
99
|
+
Images and replaced elements are `display: block`:
|
|
100
|
+
|
|
101
|
+
```css
|
|
102
|
+
img, svg, video, canvas, audio, iframe, embed, object {
|
|
103
|
+
display: block;
|
|
104
|
+
vertical-align: middle;
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Use `inline` utility if needed:
|
|
109
|
+
|
|
110
|
+
```html
|
|
111
|
+
<img class="inline" src="..." alt="..." />
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Images Are Constrained
|
|
115
|
+
|
|
116
|
+
Images and videos are constrained to parent width:
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
img, video {
|
|
120
|
+
max-width: 100%;
|
|
121
|
+
height: auto;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Override with `max-w-none`:
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<img class="max-w-none" src="..." alt="..." />
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Hidden Attribute
|
|
132
|
+
|
|
133
|
+
Elements with `hidden` attribute stay hidden:
|
|
134
|
+
|
|
135
|
+
```css
|
|
136
|
+
[hidden]:where(:not([hidden="until-found"])) {
|
|
137
|
+
display: none !important;
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Extending Preflight
|
|
142
|
+
|
|
143
|
+
Add base styles to the `base` layer:
|
|
144
|
+
|
|
145
|
+
```css
|
|
146
|
+
@layer base {
|
|
147
|
+
h1 {
|
|
148
|
+
font-size: var(--text-2xl);
|
|
149
|
+
font-weight: 600;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
h2 {
|
|
153
|
+
font-size: var(--text-xl);
|
|
154
|
+
font-weight: 600;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
a {
|
|
158
|
+
color: var(--color-blue-600);
|
|
159
|
+
text-decoration-line: underline;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Disabling Preflight
|
|
165
|
+
|
|
166
|
+
Import Tailwind components individually, omitting Preflight:
|
|
167
|
+
|
|
168
|
+
```css
|
|
169
|
+
@layer theme, base, components, utilities;
|
|
170
|
+
|
|
171
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
172
|
+
/* @import "tailwindcss/preflight.css" layer(base); */ /* Omitted */
|
|
173
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Working Around Third-Party Libraries
|
|
177
|
+
|
|
178
|
+
Some libraries may conflict with Preflight. Override Preflight styles:
|
|
179
|
+
|
|
180
|
+
```css
|
|
181
|
+
@layer base {
|
|
182
|
+
.google-map * {
|
|
183
|
+
border-style: none;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Key Points
|
|
189
|
+
|
|
190
|
+
- Preflight normalizes cross-browser inconsistencies
|
|
191
|
+
- Margins, borders, headings, and lists are reset
|
|
192
|
+
- Images are block-level and constrained by default
|
|
193
|
+
- Extend Preflight with `@layer base`
|
|
194
|
+
- Disable by omitting the preflight import
|
|
195
|
+
- Override Preflight styles when needed for third-party libraries
|
|
196
|
+
|
|
197
|
+
<!--
|
|
198
|
+
Source references:
|
|
199
|
+
- https://tailwindcss.com/docs/preflight
|
|
200
|
+
-->
|