@biggora/claude-plugins 1.2.0 → 1.3.0
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 +13 -4
- package/package.json +1 -1
- package/registry/registry.json +334 -244
- package/specs/coding.md +30 -0
- package/specs/pod.md +2 -0
- package/src/commands/skills/add.js +63 -7
- package/src/commands/skills/list.js +23 -52
- package/src/commands/skills/remove.js +26 -27
- package/src/commands/skills/resolve.js +155 -0
- package/src/commands/skills/update.js +58 -74
- 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/nest-best-practices/SKILL.md +251 -0
- package/src/skills/nest-best-practices/references/best-practices-request-lifecycle.md +158 -0
- package/src/skills/nest-best-practices/references/cli-monorepo.md +106 -0
- package/src/skills/nest-best-practices/references/cli-overview.md +157 -0
- package/src/skills/nest-best-practices/references/core-controllers.md +165 -0
- package/src/skills/nest-best-practices/references/core-dependency-injection.md +179 -0
- package/src/skills/nest-best-practices/references/core-middleware.md +139 -0
- package/src/skills/nest-best-practices/references/core-modules.md +138 -0
- package/src/skills/nest-best-practices/references/core-providers.md +188 -0
- package/src/skills/nest-best-practices/references/faq-raw-body-hybrid.md +122 -0
- package/src/skills/nest-best-practices/references/fundamentals-circular-dependency.md +89 -0
- package/src/skills/nest-best-practices/references/fundamentals-custom-decorators.md +107 -0
- package/src/skills/nest-best-practices/references/fundamentals-dynamic-modules.md +125 -0
- package/src/skills/nest-best-practices/references/fundamentals-exception-filters.md +202 -0
- package/src/skills/nest-best-practices/references/fundamentals-execution-context.md +107 -0
- package/src/skills/nest-best-practices/references/fundamentals-guards.md +136 -0
- package/src/skills/nest-best-practices/references/fundamentals-interceptors.md +187 -0
- package/src/skills/nest-best-practices/references/fundamentals-lazy-loading.md +89 -0
- package/src/skills/nest-best-practices/references/fundamentals-lifecycle-events.md +87 -0
- package/src/skills/nest-best-practices/references/fundamentals-module-reference.md +107 -0
- package/src/skills/nest-best-practices/references/fundamentals-pipes.md +197 -0
- package/src/skills/nest-best-practices/references/fundamentals-provider-scopes.md +92 -0
- package/src/skills/nest-best-practices/references/fundamentals-testing.md +142 -0
- package/src/skills/nest-best-practices/references/graphql-overview.md +233 -0
- package/src/skills/nest-best-practices/references/graphql-resolvers-mutations.md +199 -0
- package/src/skills/nest-best-practices/references/graphql-scalars-unions-enums.md +180 -0
- package/src/skills/nest-best-practices/references/graphql-subscriptions.md +228 -0
- package/src/skills/nest-best-practices/references/microservices-grpc.md +175 -0
- package/src/skills/nest-best-practices/references/microservices-overview.md +221 -0
- package/src/skills/nest-best-practices/references/microservices-transports.md +119 -0
- package/src/skills/nest-best-practices/references/openapi-swagger.md +207 -0
- package/src/skills/nest-best-practices/references/recipes-authentication.md +97 -0
- package/src/skills/nest-best-practices/references/recipes-cqrs.md +176 -0
- package/src/skills/nest-best-practices/references/recipes-crud-generator.md +87 -0
- package/src/skills/nest-best-practices/references/recipes-documentation.md +93 -0
- package/src/skills/nest-best-practices/references/recipes-mongoose.md +153 -0
- package/src/skills/nest-best-practices/references/recipes-prisma.md +98 -0
- package/src/skills/nest-best-practices/references/recipes-terminus.md +148 -0
- package/src/skills/nest-best-practices/references/recipes-typeorm.md +122 -0
- package/src/skills/nest-best-practices/references/security-authorization.md +196 -0
- package/src/skills/nest-best-practices/references/security-cors-helmet-rate-limiting.md +204 -0
- package/src/skills/nest-best-practices/references/security-encryption-hashing.md +93 -0
- package/src/skills/nest-best-practices/references/techniques-caching.md +142 -0
- package/src/skills/nest-best-practices/references/techniques-compression-streaming-sse.md +194 -0
- package/src/skills/nest-best-practices/references/techniques-configuration.md +132 -0
- package/src/skills/nest-best-practices/references/techniques-database.md +153 -0
- package/src/skills/nest-best-practices/references/techniques-events.md +163 -0
- package/src/skills/nest-best-practices/references/techniques-fastify.md +137 -0
- package/src/skills/nest-best-practices/references/techniques-file-upload.md +140 -0
- package/src/skills/nest-best-practices/references/techniques-http-module.md +176 -0
- package/src/skills/nest-best-practices/references/techniques-logging.md +146 -0
- package/src/skills/nest-best-practices/references/techniques-mvc-serve-static.md +132 -0
- package/src/skills/nest-best-practices/references/techniques-queues.md +162 -0
- package/src/skills/nest-best-practices/references/techniques-serialization.md +158 -0
- package/src/skills/nest-best-practices/references/techniques-sessions-cookies.md +167 -0
- package/src/skills/nest-best-practices/references/techniques-task-scheduling.md +166 -0
- package/src/skills/nest-best-practices/references/techniques-validation.md +126 -0
- package/src/skills/nest-best-practices/references/techniques-versioning.md +153 -0
- package/src/skills/nest-best-practices/references/websockets-advanced.md +96 -0
- package/src/skills/nest-best-practices/references/websockets-gateways.md +215 -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/typescript-expert/SKILL.md +145 -0
- package/src/skills/typescript-expert/commands/typescript-fix.md +65 -0
- package/src/skills/typescript-expert/references/advanced-conditional-types.md +190 -0
- package/src/skills/typescript-expert/references/advanced-decorators.md +243 -0
- package/src/skills/typescript-expert/references/advanced-mapped-types.md +223 -0
- package/src/skills/typescript-expert/references/advanced-template-literals.md +209 -0
- package/src/skills/typescript-expert/references/advanced-type-guards.md +308 -0
- package/src/skills/typescript-expert/references/best-practices-patterns.md +313 -0
- package/src/skills/typescript-expert/references/best-practices-performance.md +185 -0
- package/src/skills/typescript-expert/references/best-practices-tsconfig.md +242 -0
- package/src/skills/typescript-expert/references/core-generics.md +246 -0
- package/src/skills/typescript-expert/references/core-interfaces-types.md +231 -0
- package/src/skills/typescript-expert/references/core-type-system.md +261 -0
- package/src/skills/typescript-expert/references/core-utility-types.md +235 -0
- package/src/skills/typescript-expert/references/features-ts5x.md +370 -0
- 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,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
|
+
-->
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: core-responsive
|
|
3
|
+
description: Building responsive designs with Tailwind's mobile-first breakpoint system and container queries
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Responsive Design
|
|
7
|
+
|
|
8
|
+
Every utility class in Tailwind can be applied conditionally at different breakpoints using responsive variants.
|
|
9
|
+
|
|
10
|
+
## Mobile-First Breakpoints
|
|
11
|
+
|
|
12
|
+
Tailwind uses a mobile-first approach. Unprefixed utilities apply to all screen sizes, while prefixed utilities apply at that breakpoint and above.
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<!-- Center text on mobile, left align on sm screens and up -->
|
|
16
|
+
<div class="text-center sm:text-left">Content</div>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Default Breakpoints
|
|
20
|
+
|
|
21
|
+
| Breakpoint | Minimum Width | CSS |
|
|
22
|
+
|------------|---------------|-----|
|
|
23
|
+
| `sm` | 40rem (640px) | `@media (width >= 40rem)` |
|
|
24
|
+
| `md` | 48rem (768px) | `@media (width >= 48rem)` |
|
|
25
|
+
| `lg` | 64rem (1024px) | `@media (width >= 64rem)` |
|
|
26
|
+
| `xl` | 80rem (1280px) | `@media (width >= 80rem)` |
|
|
27
|
+
| `2xl` | 96rem (1536px) | `@media (width >= 96rem)` |
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Prefix any utility with a breakpoint name:
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<!-- Width of 16 by default, 32 on medium screens, 48 on large screens -->
|
|
35
|
+
<img class="w-16 md:w-32 lg:w-48" src="..." />
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Example: Responsive Card
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<div class="mx-auto max-w-md md:max-w-2xl">
|
|
42
|
+
<div class="md:flex">
|
|
43
|
+
<div class="md:shrink-0">
|
|
44
|
+
<img class="h-48 w-full object-cover md:h-full md:w-48" src="..." />
|
|
45
|
+
</div>
|
|
46
|
+
<div class="p-8">
|
|
47
|
+
<h2 class="text-lg font-semibold">Title</h2>
|
|
48
|
+
<p class="text-gray-500">Description</p>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Targeting Mobile Screens
|
|
55
|
+
|
|
56
|
+
Use unprefixed utilities for mobile, not `sm:`. Think of `sm:` as "at the small breakpoint", not "on small screens".
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<!-- ❌ Only centers on screens 640px+, not mobile -->
|
|
60
|
+
<div class="sm:text-center"></div>
|
|
61
|
+
|
|
62
|
+
<!-- ✅ Centers on mobile, left aligns on 640px+ -->
|
|
63
|
+
<div class="text-center sm:text-left"></div>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Breakpoint Ranges
|
|
67
|
+
|
|
68
|
+
Target a specific breakpoint range by stacking responsive variants with `max-*` variants:
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<!-- Only applies between md and xl -->
|
|
72
|
+
<div class="md:max-xl:flex">Content</div>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Max-Width Variants
|
|
76
|
+
|
|
77
|
+
Tailwind generates `max-*` variants for each breakpoint:
|
|
78
|
+
|
|
79
|
+
| Variant | Media Query |
|
|
80
|
+
|---------|-------------|
|
|
81
|
+
| `max-sm` | `@media (width < 40rem)` |
|
|
82
|
+
| `max-md` | `@media (width < 48rem)` |
|
|
83
|
+
| `max-lg` | `@media (width < 64rem)` |
|
|
84
|
+
| `max-xl` | `@media (width < 80rem)` |
|
|
85
|
+
| `max-2xl` | `@media (width < 96rem)` |
|
|
86
|
+
|
|
87
|
+
## Custom Breakpoints
|
|
88
|
+
|
|
89
|
+
Add custom breakpoints using `--breakpoint-*` theme variables:
|
|
90
|
+
|
|
91
|
+
```css
|
|
92
|
+
@theme {
|
|
93
|
+
--breakpoint-xs: 30rem;
|
|
94
|
+
--breakpoint-3xl: 120rem;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<div class="xs:grid-cols-2 3xl:grid-cols-6">Content</div>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Arbitrary Breakpoints
|
|
103
|
+
|
|
104
|
+
Use arbitrary values for one-off breakpoints:
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<div class="min-[320px]:text-center max-[600px]:bg-sky-300">
|
|
108
|
+
Content
|
|
109
|
+
</div>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Container Queries
|
|
113
|
+
|
|
114
|
+
Style elements based on parent container size instead of viewport:
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<!-- Mark container -->
|
|
118
|
+
<div class="@container">
|
|
119
|
+
<!-- Style based on container size -->
|
|
120
|
+
<div class="flex flex-col @md:flex-row">
|
|
121
|
+
Content
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Container Query Variants
|
|
127
|
+
|
|
128
|
+
| Variant | Minimum Width |
|
|
129
|
+
|---------|---------------|
|
|
130
|
+
| `@3xs` | 16rem (256px) |
|
|
131
|
+
| `@xs` | 20rem (320px) |
|
|
132
|
+
| `@sm` | 24rem (384px) |
|
|
133
|
+
| `@md` | 28rem (448px) |
|
|
134
|
+
| `@lg` | 32rem (512px) |
|
|
135
|
+
| `@xl` | 36rem (576px) |
|
|
136
|
+
| `@2xl` | 42rem (672px) |
|
|
137
|
+
| `@3xl` | 48rem (768px) |
|
|
138
|
+
| ... up to `@7xl` | 80rem (1280px) |
|
|
139
|
+
|
|
140
|
+
### Named Containers
|
|
141
|
+
|
|
142
|
+
Name containers to target specific ones in nested structures:
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<div class="@container/main">
|
|
146
|
+
<div class="flex flex-row @sm/main:flex-col">
|
|
147
|
+
Content
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Key Points
|
|
153
|
+
|
|
154
|
+
- Mobile-first: unprefixed = mobile, prefixed = breakpoint and up
|
|
155
|
+
- Use unprefixed utilities for mobile, not `sm:`
|
|
156
|
+
- Stack variants for complex responsive behavior
|
|
157
|
+
- Container queries enable component-based responsive design
|
|
158
|
+
- Customize breakpoints with theme variables
|
|
159
|
+
|
|
160
|
+
<!--
|
|
161
|
+
Source references:
|
|
162
|
+
- https://tailwindcss.com/docs/responsive-design
|
|
163
|
+
-->
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: core-source-detection
|
|
3
|
+
description: How Tailwind v4 detects classes in source files, @source directives, @source not, and @source inline() for safelisting
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Source Detection & Configuration
|
|
7
|
+
|
|
8
|
+
Tailwind v4 automatically scans your project for utility classes. This page covers how detection works and how to customize it.
|
|
9
|
+
|
|
10
|
+
## Automatic Detection
|
|
11
|
+
|
|
12
|
+
By default, Tailwind scans all files in your project except:
|
|
13
|
+
|
|
14
|
+
- Files matching `.gitignore` patterns
|
|
15
|
+
- `node_modules/` directory (ignored since v4.1)
|
|
16
|
+
- Binary files (images, videos, zips)
|
|
17
|
+
- CSS files
|
|
18
|
+
- Package manager lock files
|
|
19
|
+
|
|
20
|
+
Files are scanned as **plain text** — Tailwind does not parse your code. It looks for token patterns that match utility class names.
|
|
21
|
+
|
|
22
|
+
## Source Configuration
|
|
23
|
+
|
|
24
|
+
### Register additional sources
|
|
25
|
+
|
|
26
|
+
Scan files outside the project root (e.g., UI library in node_modules):
|
|
27
|
+
|
|
28
|
+
```css
|
|
29
|
+
@import "tailwindcss";
|
|
30
|
+
@source "../node_modules/@acmecorp/ui-lib";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Set a base path
|
|
34
|
+
|
|
35
|
+
Restrict scanning to a specific directory (useful for monorepos):
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
@import "tailwindcss" source("../src");
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Disable automatic detection
|
|
42
|
+
|
|
43
|
+
Scan only explicitly listed paths:
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
@import "tailwindcss" source(none);
|
|
47
|
+
@source "../admin";
|
|
48
|
+
@source "../shared";
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Excluding Sources (v4.1+)
|
|
52
|
+
|
|
53
|
+
Exclude paths from scanning:
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
@source not "../src/components/legacy";
|
|
57
|
+
@source not "./generated";
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Safelisting with @source inline() (v4.1+)
|
|
61
|
+
|
|
62
|
+
Force generation of classes not found in source files. This replaces the v3 `safelist` config option.
|
|
63
|
+
|
|
64
|
+
```css
|
|
65
|
+
/* Single utility */
|
|
66
|
+
@source inline("underline");
|
|
67
|
+
|
|
68
|
+
/* With variants */
|
|
69
|
+
@source inline("{hover:,focus:,}underline");
|
|
70
|
+
|
|
71
|
+
/* Color palette with brace expansion */
|
|
72
|
+
@source inline("{hover:,}bg-red-{50,{100..900..100},950}");
|
|
73
|
+
|
|
74
|
+
/* Exclude specific classes */
|
|
75
|
+
@source not inline("{hover:,focus:,}bg-red-{50,{100..900..100},950}");
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Brace expansion follows shell-style syntax:
|
|
79
|
+
- `{a,b,c}` — list of values
|
|
80
|
+
- `{100..900..100}` — range with step (100, 200, 300, ..., 900)
|
|
81
|
+
|
|
82
|
+
## Dynamic Class Names
|
|
83
|
+
|
|
84
|
+
Because Tailwind scans files as plain text, it cannot detect dynamically constructed class names:
|
|
85
|
+
|
|
86
|
+
```jsx
|
|
87
|
+
// BAD — Tailwind won't detect these
|
|
88
|
+
const color = 'red';
|
|
89
|
+
<div className={`bg-${color}-500`} />
|
|
90
|
+
|
|
91
|
+
// GOOD — Use complete class names
|
|
92
|
+
const colorClasses = {
|
|
93
|
+
red: 'bg-red-500',
|
|
94
|
+
blue: 'bg-blue-500',
|
|
95
|
+
};
|
|
96
|
+
<div className={colorClasses[color]} />
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If you must use dynamic classes, safelist them with `@source inline()`.
|
|
100
|
+
|
|
101
|
+
## Key Points
|
|
102
|
+
|
|
103
|
+
- Automatic detection scans all non-ignored, non-binary files
|
|
104
|
+
- `@source "path"` adds additional scan paths
|
|
105
|
+
- `@source not "path"` excludes paths (v4.1+)
|
|
106
|
+
- `@source inline("classes")` safelists classes (v4.1+), replaces v3 `safelist`
|
|
107
|
+
- `source(none)` on the import disables auto-detection
|
|
108
|
+
- Always use complete class names — never string-interpolate utility names
|
|
109
|
+
|
|
110
|
+
<!--
|
|
111
|
+
Source references:
|
|
112
|
+
- https://tailwindcss.com/docs/detecting-classes-in-source-files
|
|
113
|
+
- https://tailwindcss.com/blog/tailwindcss-v4-1
|
|
114
|
+
-->
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: core-theme
|
|
3
|
+
description: Understanding theme variables, design tokens, and customizing Tailwind's default theme
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Theme Variables
|
|
7
|
+
|
|
8
|
+
Theme variables are special CSS variables defined using the `@theme` directive that influence which utility classes exist in your project.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Theme variables store design tokens like colors, fonts, spacing, shadows, and breakpoints. They're defined using the `@theme` directive:
|
|
13
|
+
|
|
14
|
+
```css
|
|
15
|
+
@import "tailwindcss";
|
|
16
|
+
|
|
17
|
+
@theme {
|
|
18
|
+
--color-mint-500: oklch(0.72 0.11 178);
|
|
19
|
+
--font-display: "Satoshi", "sans-serif";
|
|
20
|
+
--breakpoint-3xl: 120rem;
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Now utilities like `bg-mint-500`, `font-display`, and `3xl:grid-cols-6` become available.
|
|
25
|
+
|
|
26
|
+
## Why @theme Instead of :root?
|
|
27
|
+
|
|
28
|
+
Theme variables aren't just CSS variables - they also instruct Tailwind to create new utility classes. Using `@theme` makes this explicit and ensures variables are defined top-level.
|
|
29
|
+
|
|
30
|
+
Use `@theme` for design tokens that map to utilities. Use `:root` for regular CSS variables that shouldn't have corresponding utilities.
|
|
31
|
+
|
|
32
|
+
## Theme Variable Namespaces
|
|
33
|
+
|
|
34
|
+
Theme variables are organized into namespaces that map to utility classes:
|
|
35
|
+
|
|
36
|
+
| Namespace | Utility Classes |
|
|
37
|
+
|-----------|----------------|
|
|
38
|
+
| `--color-*` | `bg-red-500`, `text-sky-300`, `border-indigo-600`, etc. |
|
|
39
|
+
| `--font-*` | `font-sans`, `font-serif`, `font-mono` |
|
|
40
|
+
| `--breakpoint-*` | Responsive variants like `md:`, `lg:`, `xl:` |
|
|
41
|
+
| `--spacing-*` | Spacing scale for padding, margin, gap utilities |
|
|
42
|
+
| `--shadow-*` | `shadow-sm`, `shadow-md`, `shadow-lg` |
|
|
43
|
+
| `--ease-*` | Transition timing functions |
|
|
44
|
+
|
|
45
|
+
## Extending the Default Theme
|
|
46
|
+
|
|
47
|
+
Add new theme variables to extend the default theme:
|
|
48
|
+
|
|
49
|
+
```css
|
|
50
|
+
@import "tailwindcss";
|
|
51
|
+
|
|
52
|
+
@theme {
|
|
53
|
+
/* Add new color */
|
|
54
|
+
--color-brand-500: oklch(0.65 0.2 250);
|
|
55
|
+
|
|
56
|
+
/* Add new breakpoint */
|
|
57
|
+
--breakpoint-3xl: 120rem;
|
|
58
|
+
|
|
59
|
+
/* Add new font */
|
|
60
|
+
--font-display: "Satoshi", "sans-serif";
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Using Theme Variables
|
|
65
|
+
|
|
66
|
+
Tailwind generates CSS variables for your theme variables, so you can reference them:
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<!-- Use utility classes -->
|
|
70
|
+
<div class="bg-brand-500 text-display">Content</div>
|
|
71
|
+
|
|
72
|
+
<!-- Reference CSS variables directly -->
|
|
73
|
+
<div style="background-color: var(--color-brand-500)">
|
|
74
|
+
Content
|
|
75
|
+
</div>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Default Theme
|
|
79
|
+
|
|
80
|
+
When you import `tailwindcss`, it includes default theme variables:
|
|
81
|
+
|
|
82
|
+
```css
|
|
83
|
+
@layer theme, base, components, utilities;
|
|
84
|
+
|
|
85
|
+
@import "./theme.css" layer(theme);
|
|
86
|
+
@import "./preflight.css" layer(base);
|
|
87
|
+
@import "./utilities.css" layer(utilities);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The default theme includes:
|
|
91
|
+
- Color palette (red, blue, green, etc. with 50-950 shades)
|
|
92
|
+
- Font families (sans, serif, mono)
|
|
93
|
+
- Spacing scale
|
|
94
|
+
- Shadows
|
|
95
|
+
- Breakpoints (sm, md, lg, xl, 2xl)
|
|
96
|
+
|
|
97
|
+
## Key Points
|
|
98
|
+
|
|
99
|
+
- Theme variables define which utilities exist in your project
|
|
100
|
+
- Use `@theme` directive to define design tokens
|
|
101
|
+
- Variables must be defined top-level, not nested
|
|
102
|
+
- Tailwind generates both utilities and CSS variables
|
|
103
|
+
- Default theme provides a solid starting point
|
|
104
|
+
|
|
105
|
+
<!--
|
|
106
|
+
Source references:
|
|
107
|
+
- https://tailwindcss.com/docs/theme
|
|
108
|
+
-->
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: core-utility-classes
|
|
3
|
+
description: Understanding Tailwind's utility-first approach and how to style elements with utility classes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Utility Classes
|
|
7
|
+
|
|
8
|
+
Tailwind CSS uses a utility-first approach where you style elements by combining many single-purpose utility classes directly in your markup.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Instead of writing custom CSS, you compose designs using utility classes:
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<div class="mx-auto flex max-w-sm items-center gap-x-4 rounded-xl bg-white p-6 shadow-lg">
|
|
16
|
+
<img class="size-12 shrink-0" src="/logo.svg" alt="Logo" />
|
|
17
|
+
<div>
|
|
18
|
+
<div class="text-xl font-medium text-black">ChitChat</div>
|
|
19
|
+
<p class="text-gray-500">You have a new message!</p>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Benefits
|
|
25
|
+
|
|
26
|
+
- **Faster development** - No need to come up with class names or switch between HTML and CSS files
|
|
27
|
+
- **Safer changes** - Adding or removing utilities only affects that element
|
|
28
|
+
- **Easier maintenance** - Find the element and change classes, no need to remember custom CSS
|
|
29
|
+
- **More portable** - Copy entire UI chunks between projects easily
|
|
30
|
+
- **Smaller CSS** - Utilities are reusable, so CSS doesn't grow linearly
|
|
31
|
+
|
|
32
|
+
## Why Not Inline Styles?
|
|
33
|
+
|
|
34
|
+
Utility classes have important advantages over inline styles:
|
|
35
|
+
|
|
36
|
+
- **Design constraints** - Choose from a predefined design system instead of magic numbers
|
|
37
|
+
- **State variants** - Target hover, focus, and other states with variants like `hover:bg-blue-600`
|
|
38
|
+
- **Responsive design** - Use responsive variants like `md:flex` for media queries
|
|
39
|
+
|
|
40
|
+
## Utility Class Structure
|
|
41
|
+
|
|
42
|
+
Utility classes follow consistent naming patterns:
|
|
43
|
+
|
|
44
|
+
- **Property-value**: `bg-blue-500`, `text-lg`, `rounded-xl`
|
|
45
|
+
- **Responsive**: `md:flex`, `lg:text-center`
|
|
46
|
+
- **State variants**: `hover:bg-blue-600`, `focus:outline-2`
|
|
47
|
+
- **Arbitrary values**: `top-[117px]`, `bg-[#bada55]`
|
|
48
|
+
|
|
49
|
+
## Key Points
|
|
50
|
+
|
|
51
|
+
- Every utility class is single-purpose and composable
|
|
52
|
+
- Utilities can be combined with variants for conditional styling
|
|
53
|
+
- Use complete class names - Tailwind scans your files as plain text
|
|
54
|
+
- Avoid dynamically constructing class names with string interpolation
|
|
55
|
+
|
|
56
|
+
<!--
|
|
57
|
+
Source references:
|
|
58
|
+
- https://tailwindcss.com/docs/styling-with-utility-classes
|
|
59
|
+
-->
|