@nextsparkjs/ai-workflow 0.1.0-beta.100
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/LICENSE +21 -0
- package/README.md +115 -0
- package/claude/_docs/workflows-optimizations.md +359 -0
- package/claude/agents/api-tester.md +634 -0
- package/claude/agents/architecture-supervisor.md +1351 -0
- package/claude/agents/backend-developer.md +997 -0
- package/claude/agents/backend-validator.md +417 -0
- package/claude/agents/bdd-docs-writer.md +737 -0
- package/claude/agents/block-developer.md +677 -0
- package/claude/agents/code-reviewer.md +1432 -0
- package/claude/agents/db-developer.md +721 -0
- package/claude/agents/db-validator.md +407 -0
- package/claude/agents/demo-video-generator.md +493 -0
- package/claude/agents/documentation-writer.md +1268 -0
- package/claude/agents/frontend-developer.md +1234 -0
- package/claude/agents/frontend-validator.md +777 -0
- package/claude/agents/functional-validator.md +630 -0
- package/claude/agents/mock-analyst.md +387 -0
- package/claude/agents/product-manager.md +963 -0
- package/claude/agents/qa-automation.md +1762 -0
- package/claude/agents/release-manager.md +634 -0
- package/claude/agents/selectors-translator.md +262 -0
- package/claude/agents/unit-test-writer.md +785 -0
- package/claude/agents/visual-comparator.md +329 -0
- package/claude/agents/workflow-maintainer.md +352 -0
- package/claude/commands/do/README.md +88 -0
- package/claude/commands/do/create-api.md +64 -0
- package/claude/commands/do/create-entity.md +66 -0
- package/claude/commands/do/create-migration.md +64 -0
- package/claude/commands/do/create-plugin.md +56 -0
- package/claude/commands/do/create-theme.md +70 -0
- package/claude/commands/do/mock-data.md +67 -0
- package/claude/commands/do/reset-db.md +71 -0
- package/claude/commands/do/setup-scheduled-action.md +75 -0
- package/claude/commands/do/sync-code-review.md +117 -0
- package/claude/commands/do/update-selectors.md +112 -0
- package/claude/commands/do/use-skills.md +90 -0
- package/claude/commands/do/validate-blocks.md +69 -0
- package/claude/commands/how-to/README.md +261 -0
- package/claude/commands/how-to/add-metadata.md +692 -0
- package/claude/commands/how-to/add-taxonomies.md +806 -0
- package/claude/commands/how-to/add-translations.md +571 -0
- package/claude/commands/how-to/create-api.md +577 -0
- package/claude/commands/how-to/create-block.md +575 -0
- package/claude/commands/how-to/create-child-entities.md +771 -0
- package/claude/commands/how-to/create-entity.md +597 -0
- package/claude/commands/how-to/create-migrations.md +605 -0
- package/claude/commands/how-to/create-plugin.md +654 -0
- package/claude/commands/how-to/customize-app.md +481 -0
- package/claude/commands/how-to/customize-dashboard.md +553 -0
- package/claude/commands/how-to/customize-theme.md +438 -0
- package/claude/commands/how-to/define-features-flows.md +632 -0
- package/claude/commands/how-to/deploy.md +507 -0
- package/claude/commands/how-to/handle-file-uploads.md +746 -0
- package/claude/commands/how-to/implement-search.md +1001 -0
- package/claude/commands/how-to/install-plugins.md +352 -0
- package/claude/commands/how-to/manage-test-coverage.md +984 -0
- package/claude/commands/how-to/run-tests.md +400 -0
- package/claude/commands/how-to/set-app-languages.md +601 -0
- package/claude/commands/how-to/set-plans-and-permissions.md +575 -0
- package/claude/commands/how-to/set-scheduled-actions.md +527 -0
- package/claude/commands/how-to/set-user-roles-and-permissions.md +550 -0
- package/claude/commands/how-to/setup-authentication.md +388 -0
- package/claude/commands/how-to/setup-claude-code.md +440 -0
- package/claude/commands/how-to/setup-database.md +274 -0
- package/claude/commands/how-to/setup-email-providers.md +598 -0
- package/claude/commands/how-to/setup-mobile-dev.md +627 -0
- package/claude/commands/how-to/start.md +500 -0
- package/claude/commands/how-to/use-devtools.md +639 -0
- package/claude/commands/how-to/use-superadmin.md +622 -0
- package/claude/commands/session/README.md +193 -0
- package/claude/commands/session/block-create.md +190 -0
- package/claude/commands/session/block-list.md +203 -0
- package/claude/commands/session/block-update.md +192 -0
- package/claude/commands/session/block-validate.md +218 -0
- package/claude/commands/session/changelog.md +115 -0
- package/claude/commands/session/close.md +225 -0
- package/claude/commands/session/commit.md +174 -0
- package/claude/commands/session/db-entity.md +206 -0
- package/claude/commands/session/db-fix.md +212 -0
- package/claude/commands/session/db-sample.md +206 -0
- package/claude/commands/session/demo.md +178 -0
- package/claude/commands/session/doc-bdd.md +207 -0
- package/claude/commands/session/doc-feature.md +218 -0
- package/claude/commands/session/doc-read.md +225 -0
- package/claude/commands/session/execute.md +204 -0
- package/claude/commands/session/explain.md +202 -0
- package/claude/commands/session/fix-bug.md +210 -0
- package/claude/commands/session/fix-build.md +182 -0
- package/claude/commands/session/fix-test.md +189 -0
- package/claude/commands/session/pending.md +232 -0
- package/claude/commands/session/refine.md +188 -0
- package/claude/commands/session/resume.md +192 -0
- package/claude/commands/session/review.md +192 -0
- package/claude/commands/session/scope-change.md +181 -0
- package/claude/commands/session/start-blocks.md +347 -0
- package/claude/commands/session/start.md +604 -0
- package/claude/commands/session/status.md +169 -0
- package/claude/commands/session/test-fix.md +221 -0
- package/claude/commands/session/test-run.md +203 -0
- package/claude/commands/session/test-write.md +242 -0
- package/claude/commands/session/validate.md +162 -0
- package/claude/config/context.json +40 -0
- package/claude/config/github.json +69 -0
- package/claude/config/github.schema.json +106 -0
- package/claude/config/team.json +46 -0
- package/claude/config/team.schema.json +106 -0
- package/claude/config/workspace.json +43 -0
- package/claude/config/workspace.schema.json +75 -0
- package/claude/skills/README.md +228 -0
- package/claude/skills/accessibility/SKILL.md +573 -0
- package/claude/skills/api-bypass-layers/SKILL.md +550 -0
- package/claude/skills/asana-integration/SKILL.md +499 -0
- package/claude/skills/better-auth/SKILL.md +666 -0
- package/claude/skills/billing-subscriptions/SKILL.md +660 -0
- package/claude/skills/block-decision-matrix/SKILL.md +359 -0
- package/claude/skills/clickup-integration/SKILL.md +434 -0
- package/claude/skills/core-theme-responsibilities/SKILL.md +485 -0
- package/claude/skills/create-plugin/SKILL.md +425 -0
- package/claude/skills/create-theme/SKILL.md +331 -0
- package/claude/skills/cypress-api/SKILL.md +511 -0
- package/claude/skills/cypress-api/scripts/generate-api-controller.py +329 -0
- package/claude/skills/cypress-api/scripts/generate-api-test.py +930 -0
- package/claude/skills/cypress-e2e/SKILL.md +526 -0
- package/claude/skills/cypress-e2e/scripts/extract-selectors.py +383 -0
- package/claude/skills/cypress-e2e/scripts/generate-uat-test.py +788 -0
- package/claude/skills/cypress-selectors/SKILL.md +309 -0
- package/claude/skills/cypress-selectors/scripts/extract-missing.py +243 -0
- package/claude/skills/cypress-selectors/scripts/generate-block-selectors.py +283 -0
- package/claude/skills/cypress-selectors/scripts/validate-selectors.py +145 -0
- package/claude/skills/database-migrations/SKILL.md +335 -0
- package/claude/skills/database-migrations/scripts/generate-sample-data.py +284 -0
- package/claude/skills/database-migrations/scripts/validate-migration.py +323 -0
- package/claude/skills/design-system/SKILL.md +682 -0
- package/claude/skills/documentation/SKILL.md +540 -0
- package/claude/skills/entity-api/SKILL.md +482 -0
- package/claude/skills/entity-system/SKILL.md +635 -0
- package/claude/skills/entity-system/scripts/generate-child-migration.py +298 -0
- package/claude/skills/entity-system/scripts/generate-metas-migration.py +233 -0
- package/claude/skills/entity-system/scripts/generate-migration.py +382 -0
- package/claude/skills/entity-system/scripts/generate-sample-data.py +418 -0
- package/claude/skills/entity-system/scripts/scaffold-entity.py +661 -0
- package/claude/skills/github/SKILL.md +467 -0
- package/claude/skills/i18n-nextintl/SKILL.md +302 -0
- package/claude/skills/i18n-nextintl/scripts/add-translation.py +243 -0
- package/claude/skills/i18n-nextintl/scripts/extract-hardcoded.py +246 -0
- package/claude/skills/i18n-nextintl/scripts/validate-translations.py +260 -0
- package/claude/skills/impact-analysis/SKILL.md +203 -0
- package/claude/skills/jest-unit/SKILL.md +306 -0
- package/claude/skills/jest-unit/references/component-testing.md +371 -0
- package/claude/skills/jest-unit/references/mocking-patterns.md +380 -0
- package/claude/skills/jest-unit/references/service-hook-testing.md +454 -0
- package/claude/skills/jira-integration/SKILL.md +539 -0
- package/claude/skills/media-library/SKILL.md +743 -0
- package/claude/skills/mock-analysis/SKILL.md +276 -0
- package/claude/skills/monorepo-architecture/SKILL.md +162 -0
- package/claude/skills/nextjs-api-development/SKILL.md +364 -0
- package/claude/skills/nextjs-api-development/scripts/generate-crud-tests.py +456 -0
- package/claude/skills/nextjs-api-development/scripts/scaffold-endpoint.py +481 -0
- package/claude/skills/nextjs-api-development/scripts/validate-api.py +283 -0
- package/claude/skills/notion-integration/SKILL.md +641 -0
- package/claude/skills/npm-development-workflow/SKILL.md +480 -0
- package/claude/skills/page-builder-blocks/SKILL.md +530 -0
- package/claude/skills/page-builder-blocks/scripts/scaffold-block.py +444 -0
- package/claude/skills/permissions-system/SKILL.md +619 -0
- package/claude/skills/plugins/SKILL.md +340 -0
- package/claude/skills/plugins/references/plugin-templates.md +414 -0
- package/claude/skills/plugins/references/plugin-testing.md +353 -0
- package/claude/skills/plugins/references/plugin-types.md +198 -0
- package/claude/skills/plugins/scripts/scaffold-plugin.py +443 -0
- package/claude/skills/pom-patterns/SKILL.md +452 -0
- package/claude/skills/pom-patterns/scripts/generate-pom.py +392 -0
- package/claude/skills/rate-limiting/SKILL.md +342 -0
- package/claude/skills/react-best-practices/AGENTS.md +2410 -0
- package/claude/skills/react-best-practices/README.md +123 -0
- package/claude/skills/react-best-practices/SKILL.md +125 -0
- package/claude/skills/react-best-practices/metadata.json +15 -0
- package/claude/skills/react-best-practices/rules/_sections.md +46 -0
- package/claude/skills/react-best-practices/rules/_template.md +28 -0
- package/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/claude/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/claude/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/claude/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/claude/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/claude/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/claude/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/claude/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/claude/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/claude/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/claude/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/claude/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/claude/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/claude/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/claude/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/claude/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/claude/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/claude/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/claude/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/claude/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/claude/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/claude/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/claude/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/claude/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/claude/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/claude/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/claude/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/claude/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/claude/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/claude/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/claude/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/claude/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/claude/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/claude/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/claude/skills/react-best-practices/rules/server-cache-react.md +76 -0
- package/claude/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/claude/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/claude/skills/react-patterns/SKILL.md +688 -0
- package/claude/skills/registry-system/SKILL.md +331 -0
- package/claude/skills/scheduled-actions/SKILL.md +671 -0
- package/claude/skills/scope-enforcement/SKILL.md +542 -0
- package/claude/skills/scope-enforcement/scripts/validate-scope.py +357 -0
- package/claude/skills/server-actions/SKILL.md +493 -0
- package/claude/skills/service-layer/SKILL.md +587 -0
- package/claude/skills/session-management/SKILL.md +266 -0
- package/claude/skills/session-management/scripts/create-session.py +166 -0
- package/claude/skills/session-management/scripts/iteration-close.sh +105 -0
- package/claude/skills/session-management/scripts/iteration-init.sh +180 -0
- package/claude/skills/session-management/scripts/session-archive.sh +87 -0
- package/claude/skills/session-management/scripts/session-close.sh +133 -0
- package/claude/skills/session-management/scripts/session-init.sh +225 -0
- package/claude/skills/session-management/scripts/session-list.sh +163 -0
- package/claude/skills/session-management/scripts/split-plan.sh +116 -0
- package/claude/skills/shadcn-components/SKILL.md +586 -0
- package/claude/skills/shadcn-theming/SKILL.md +446 -0
- package/claude/skills/suspense-loading/SKILL.md +280 -0
- package/claude/skills/tailwind-theming/SKILL.md +507 -0
- package/claude/skills/tanstack-query/SKILL.md +608 -0
- package/claude/skills/test-coverage/SKILL.md +239 -0
- package/claude/skills/web-design-guidelines/SKILL.md +39 -0
- package/claude/skills/zod-validation/SKILL.md +537 -0
- package/claude/templates/blocks/progress.md +86 -0
- package/claude/templates/iteration/changes.md +61 -0
- package/claude/templates/iteration/progress.md +55 -0
- package/claude/templates/log.md +31 -0
- package/claude/templates/story/context.md +77 -0
- package/claude/templates/story/pendings.md +37 -0
- package/claude/templates/story/plan.md +299 -0
- package/claude/templates/story/requirements.md +109 -0
- package/claude/templates/story/scope.json +10 -0
- package/claude/templates/story/tests.md +91 -0
- package/claude/templates/task/progress.md +58 -0
- package/claude/templates/task/requirements.md +54 -0
- package/claude/workflows/README.md +154 -0
- package/claude/workflows/blocks.md +614 -0
- package/claude/workflows/story.md +1207 -0
- package/claude/workflows/task.md +927 -0
- package/claude/workflows/tweak.md +527 -0
- package/cursor/.gitkeep +0 -0
- package/package.json +35 -0
- package/scripts/postinstall.mjs +198 -0
- package/scripts/setup.mjs +282 -0
- package/scripts/sync.mjs +209 -0
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tailwind-theming
|
|
3
|
+
description: |
|
|
4
|
+
Tailwind CSS theming system for this Next.js application.
|
|
5
|
+
Covers CSS variables, semantic tokens, dark mode, buildSectionClasses, and theme build process.
|
|
6
|
+
Use this skill when implementing UI styling or working with theme configurations.
|
|
7
|
+
allowed-tools: Read, Glob, Grep
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Tailwind Theming Skill
|
|
12
|
+
|
|
13
|
+
Patterns for working with the Tailwind CSS v4 theming system, CSS variables, and semantic tokens.
|
|
14
|
+
|
|
15
|
+
## Architecture Overview
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
TAILWIND THEMING (v4):
|
|
19
|
+
|
|
20
|
+
Source Files:
|
|
21
|
+
contents/themes/{THEME}/
|
|
22
|
+
├── styles/
|
|
23
|
+
│ ├── globals.css # CSS variables (light + dark)
|
|
24
|
+
│ └── components.css # Component-specific styles
|
|
25
|
+
├── config/
|
|
26
|
+
│ └── theme.config.ts # Theme settings
|
|
27
|
+
└── public/
|
|
28
|
+
└── theme-assets/ # Images, fonts
|
|
29
|
+
|
|
30
|
+
Generated Files (DO NOT EDIT):
|
|
31
|
+
├── core/theme-styles.css # Compiled theme CSS
|
|
32
|
+
└── public/theme/ # Copied assets
|
|
33
|
+
|
|
34
|
+
Build Script:
|
|
35
|
+
└── core/scripts/build/theme.mjs
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## When to Use This Skill
|
|
39
|
+
|
|
40
|
+
- Styling components with semantic tokens
|
|
41
|
+
- Understanding CSS variable system
|
|
42
|
+
- Implementing dark mode support
|
|
43
|
+
- Using buildSectionClasses in blocks
|
|
44
|
+
- Working with background color presets
|
|
45
|
+
|
|
46
|
+
## CSS Variables (Design Tokens)
|
|
47
|
+
|
|
48
|
+
### Core Semantic Colors
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
/* Light Mode (:root) */
|
|
52
|
+
:root {
|
|
53
|
+
/* Backgrounds */
|
|
54
|
+
--background: oklch(1 0 0); /* Page background */
|
|
55
|
+
--card: oklch(1 0 0); /* Card surfaces */
|
|
56
|
+
--popover: oklch(1 0 0); /* Dropdowns, popovers */
|
|
57
|
+
|
|
58
|
+
/* Foregrounds (text) */
|
|
59
|
+
--foreground: oklch(0.145 0 0); /* Primary text */
|
|
60
|
+
--card-foreground: oklch(0.145 0 0); /* Card text */
|
|
61
|
+
--popover-foreground: oklch(0.145 0 0); /* Popover text */
|
|
62
|
+
|
|
63
|
+
/* Interactive */
|
|
64
|
+
--primary: oklch(0.205 0 0); /* Primary buttons/links */
|
|
65
|
+
--primary-foreground: oklch(0.985 0 0); /* Text on primary */
|
|
66
|
+
--secondary: oklch(0.97 0 0); /* Secondary elements */
|
|
67
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
68
|
+
|
|
69
|
+
/* States */
|
|
70
|
+
--muted: oklch(0.97 0 0); /* Muted backgrounds */
|
|
71
|
+
--muted-foreground: oklch(0.556 0 0); /* Muted/placeholder text */
|
|
72
|
+
--accent: oklch(0.97 0 0); /* Accent highlights */
|
|
73
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
74
|
+
|
|
75
|
+
/* Feedback */
|
|
76
|
+
--destructive: oklch(0.577 0.245 27.325); /* Error/danger */
|
|
77
|
+
--destructive-foreground: oklch(1 0 0);
|
|
78
|
+
|
|
79
|
+
/* Borders & Inputs */
|
|
80
|
+
--border: oklch(0.922 0 0); /* Border color */
|
|
81
|
+
--input: oklch(0.922 0 0); /* Input borders */
|
|
82
|
+
--ring: oklch(0.708 0 0); /* Focus rings */
|
|
83
|
+
|
|
84
|
+
/* Radius */
|
|
85
|
+
--radius: 0.5rem; /* Base border radius */
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Dark Mode Variables
|
|
90
|
+
|
|
91
|
+
```css
|
|
92
|
+
/* Dark Mode (.dark selector) */
|
|
93
|
+
.dark {
|
|
94
|
+
/* Inverted - dark backgrounds, light text */
|
|
95
|
+
--background: oklch(0.145 0 0);
|
|
96
|
+
--foreground: oklch(0.985 0 0);
|
|
97
|
+
|
|
98
|
+
--card: oklch(0.145 0 0);
|
|
99
|
+
--card-foreground: oklch(0.985 0 0);
|
|
100
|
+
|
|
101
|
+
--primary: oklch(0.922 0 0);
|
|
102
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
103
|
+
|
|
104
|
+
--muted: oklch(0.269 0 0);
|
|
105
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
106
|
+
|
|
107
|
+
--border: oklch(0.269 0 0);
|
|
108
|
+
--input: oklch(0.269 0 0);
|
|
109
|
+
|
|
110
|
+
/* Destructive stays similar but adjusted for dark */
|
|
111
|
+
--destructive: oklch(0.396 0.141 25.723);
|
|
112
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Sidebar Variables
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
:root {
|
|
120
|
+
--sidebar: oklch(0.985 0 0);
|
|
121
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
122
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
123
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
124
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
125
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
126
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
127
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Chart Colors
|
|
132
|
+
|
|
133
|
+
```css
|
|
134
|
+
:root {
|
|
135
|
+
--chart-1: oklch(0.81 0.1 252);
|
|
136
|
+
--chart-2: oklch(0.62 0.19 260);
|
|
137
|
+
--chart-3: oklch(0.55 0.22 263);
|
|
138
|
+
--chart-4: oklch(0.49 0.22 264);
|
|
139
|
+
--chart-5: oklch(0.42 0.18 266);
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Semantic Token Usage
|
|
144
|
+
|
|
145
|
+
### Correct Usage
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// ✅ ALWAYS use semantic tokens
|
|
149
|
+
<div className="bg-background text-foreground">
|
|
150
|
+
<div className="bg-card text-card-foreground">
|
|
151
|
+
<p className="text-muted-foreground">
|
|
152
|
+
<button className="bg-primary text-primary-foreground">
|
|
153
|
+
<span className="text-destructive">
|
|
154
|
+
|
|
155
|
+
// ✅ Borders and inputs
|
|
156
|
+
<div className="border border-border">
|
|
157
|
+
<input className="border-input focus:ring-ring">
|
|
158
|
+
|
|
159
|
+
// ✅ Radius
|
|
160
|
+
<div className="rounded-lg"> {/* Uses --radius */}
|
|
161
|
+
<div className="rounded-sm"> {/* calc(--radius - 4px) */}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Forbidden Patterns
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
// ❌ NEVER hardcode colors
|
|
168
|
+
<div className="bg-white text-black">
|
|
169
|
+
<div className="bg-gray-100">
|
|
170
|
+
<p className="text-gray-500">
|
|
171
|
+
<button className="bg-blue-500 text-white">
|
|
172
|
+
|
|
173
|
+
// ❌ NEVER use arbitrary color values
|
|
174
|
+
<div className="bg-[#ffffff]">
|
|
175
|
+
<p className="text-[rgb(107,114,128)]">
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Background Color Presets (Blocks)
|
|
179
|
+
|
|
180
|
+
### Available Values
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
type BackgroundColor =
|
|
184
|
+
| 'transparent' // bg-transparent
|
|
185
|
+
| 'white' // bg-white
|
|
186
|
+
| 'gray-50' // bg-gray-50
|
|
187
|
+
| 'gray-100' // bg-gray-100
|
|
188
|
+
| 'gray-900' // bg-gray-900 text-white
|
|
189
|
+
| 'primary' // bg-primary text-primary-foreground
|
|
190
|
+
| 'primary-light' // bg-primary/10
|
|
191
|
+
| 'primary-dark' // bg-primary-dark text-white
|
|
192
|
+
| 'secondary' // bg-secondary text-secondary-foreground
|
|
193
|
+
| 'accent' // bg-accent text-accent-foreground
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### getBackgroundClasses Function
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
// core/types/blocks.ts
|
|
200
|
+
|
|
201
|
+
export function getBackgroundClasses(backgroundColor?: BackgroundColor): string {
|
|
202
|
+
const bgMap: Record<BackgroundColor, string> = {
|
|
203
|
+
transparent: 'bg-transparent',
|
|
204
|
+
white: 'bg-white',
|
|
205
|
+
'gray-50': 'bg-gray-50',
|
|
206
|
+
'gray-100': 'bg-gray-100',
|
|
207
|
+
'gray-900': 'bg-gray-900 text-white',
|
|
208
|
+
primary: 'bg-primary text-primary-foreground',
|
|
209
|
+
'primary-light': 'bg-primary/10',
|
|
210
|
+
'primary-dark': 'bg-primary-dark text-white',
|
|
211
|
+
secondary: 'bg-secondary text-secondary-foreground',
|
|
212
|
+
accent: 'bg-accent text-accent-foreground',
|
|
213
|
+
}
|
|
214
|
+
return bgMap[backgroundColor || 'transparent']
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## buildSectionClasses Helper
|
|
219
|
+
|
|
220
|
+
### Function Signature
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
// core/types/blocks.ts
|
|
224
|
+
|
|
225
|
+
export function buildSectionClasses(
|
|
226
|
+
baseClasses: string,
|
|
227
|
+
props: Partial<{
|
|
228
|
+
backgroundColor?: BackgroundColor
|
|
229
|
+
className?: string
|
|
230
|
+
}>
|
|
231
|
+
): string
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Usage in Blocks
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
import { buildSectionClasses } from '@/core/types/blocks'
|
|
238
|
+
import type { HeroProps } from './schema'
|
|
239
|
+
|
|
240
|
+
export function HeroBlock({
|
|
241
|
+
title,
|
|
242
|
+
content,
|
|
243
|
+
backgroundColor,
|
|
244
|
+
className,
|
|
245
|
+
id,
|
|
246
|
+
}: HeroProps) {
|
|
247
|
+
// Combine base classes + background + custom
|
|
248
|
+
const sectionClasses = buildSectionClasses(
|
|
249
|
+
'relative flex min-h-[600px] items-center justify-center px-4 py-20',
|
|
250
|
+
{ backgroundColor, className }
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
return (
|
|
254
|
+
<section id={id} className={sectionClasses}>
|
|
255
|
+
{/* ... */}
|
|
256
|
+
</section>
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Output Examples
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
buildSectionClasses('py-16 px-4', {})
|
|
265
|
+
// "py-16 px-4"
|
|
266
|
+
|
|
267
|
+
buildSectionClasses('py-16 px-4', { backgroundColor: 'gray-900' })
|
|
268
|
+
// "py-16 px-4 bg-gray-900 text-white"
|
|
269
|
+
|
|
270
|
+
buildSectionClasses('py-16 px-4', {
|
|
271
|
+
backgroundColor: 'primary',
|
|
272
|
+
className: 'custom-class'
|
|
273
|
+
})
|
|
274
|
+
// "py-16 px-4 bg-primary text-primary-foreground custom-class"
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Dark Mode Implementation
|
|
278
|
+
|
|
279
|
+
### Architecture
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
1. CSS Variables → Define light/dark values in :root and .dark
|
|
283
|
+
2. @custom-variant → Tell Tailwind to use .dark class (NOT prefers-color-scheme)
|
|
284
|
+
3. next-themes → Manages .dark class on <html>
|
|
285
|
+
4. Tailwind → Reads CSS variables and applies dark: variants via class
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### CRITICAL: Tailwind v4 Dark Mode Configuration
|
|
289
|
+
|
|
290
|
+
**By default, Tailwind v4 uses `@media (prefers-color-scheme: dark)` for `dark:` variants.**
|
|
291
|
+
|
|
292
|
+
This causes a mismatch with `next-themes` which uses the `.dark` class on `<html>`.
|
|
293
|
+
|
|
294
|
+
**Required in every theme's `globals.css`:**
|
|
295
|
+
|
|
296
|
+
```css
|
|
297
|
+
@import "tailwindcss";
|
|
298
|
+
|
|
299
|
+
/* REQUIRED: Use class selector instead of prefers-color-scheme */
|
|
300
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
301
|
+
|
|
302
|
+
/* ... rest of imports */
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Without this configuration:**
|
|
306
|
+
- User sets theme to "light" in app
|
|
307
|
+
- OS has dark mode enabled
|
|
308
|
+
- Tailwind ignores the HTML class and uses OS preference
|
|
309
|
+
- `dark:bg-slate-800` applies even though app should be light
|
|
310
|
+
|
|
311
|
+
**With this configuration:**
|
|
312
|
+
- Tailwind respects the `.dark` class from next-themes
|
|
313
|
+
- App theme setting is honored regardless of OS preference
|
|
314
|
+
|
|
315
|
+
### Theme Provider Setup
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
// core/providers/theme-provider.tsx
|
|
319
|
+
import { ThemeProvider as NextThemeProvider } from 'next-themes'
|
|
320
|
+
|
|
321
|
+
export function ThemeProvider({ children }) {
|
|
322
|
+
return (
|
|
323
|
+
<NextThemeProvider
|
|
324
|
+
attribute="class" // Adds .dark to <html>
|
|
325
|
+
defaultTheme={defaultTheme} // light | dark | system
|
|
326
|
+
enableSystem // Respects OS preference
|
|
327
|
+
disableTransitionOnChange // No color flash
|
|
328
|
+
>
|
|
329
|
+
{children}
|
|
330
|
+
</NextThemeProvider>
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Theme Toggle
|
|
336
|
+
|
|
337
|
+
```typescript
|
|
338
|
+
import { useTheme } from 'next-themes'
|
|
339
|
+
|
|
340
|
+
function ThemeToggle() {
|
|
341
|
+
const { theme, setTheme } = useTheme()
|
|
342
|
+
|
|
343
|
+
return (
|
|
344
|
+
<button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
|
|
345
|
+
Toggle theme
|
|
346
|
+
</button>
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Default Theme Resolution
|
|
352
|
+
|
|
353
|
+
```typescript
|
|
354
|
+
// Priority order:
|
|
355
|
+
// 1. User preference (stored in DB: uiPreferences.theme)
|
|
356
|
+
// 2. Theme config default (theme.config.ts → defaultMode)
|
|
357
|
+
// 3. System preference
|
|
358
|
+
// 4. Fallback: 'light'
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Theme Build Process
|
|
362
|
+
|
|
363
|
+
### Build Commands
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Rebuild theme CSS
|
|
367
|
+
pnpm theme:build
|
|
368
|
+
|
|
369
|
+
# Or manually
|
|
370
|
+
node core/scripts/build/theme.mjs
|
|
371
|
+
|
|
372
|
+
# Watch mode (auto-rebuild)
|
|
373
|
+
node core/scripts/build/theme.mjs --watch
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### What Build Does
|
|
377
|
+
|
|
378
|
+
1. **Reads** `NEXT_PUBLIC_ACTIVE_THEME` from `.env`
|
|
379
|
+
2. **Finds** `contents/themes/{theme}/styles/globals.css`
|
|
380
|
+
3. **Finds** `contents/themes/{theme}/styles/components.css`
|
|
381
|
+
4. **Copies** assets from `contents/themes/{theme}/public/` → `public/theme/`
|
|
382
|
+
5. **Copies** block thumbnails → `public/theme/blocks/{slug}/`
|
|
383
|
+
6. **Generates** `core/theme-styles.css`
|
|
384
|
+
|
|
385
|
+
### Generated File
|
|
386
|
+
|
|
387
|
+
```css
|
|
388
|
+
/*
|
|
389
|
+
* Generated Theme CSS
|
|
390
|
+
* Theme: default
|
|
391
|
+
* Build time: 2025-12-30T12:00:00.000Z
|
|
392
|
+
* DO NOT EDIT - Auto-generated by theme.mjs
|
|
393
|
+
*/
|
|
394
|
+
|
|
395
|
+
/* Contents of globals.css */
|
|
396
|
+
:root {
|
|
397
|
+
--background: ...
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* Contents of components.css */
|
|
401
|
+
.custom-component {
|
|
402
|
+
...
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## @theme Mapping (Tailwind v4)
|
|
407
|
+
|
|
408
|
+
```css
|
|
409
|
+
/* In globals.css - Maps CSS vars to Tailwind */
|
|
410
|
+
@theme inline {
|
|
411
|
+
/* Colors */
|
|
412
|
+
--color-background: var(--background);
|
|
413
|
+
--color-foreground: var(--foreground);
|
|
414
|
+
--color-card: var(--card);
|
|
415
|
+
--color-primary: var(--primary);
|
|
416
|
+
/* ... */
|
|
417
|
+
|
|
418
|
+
/* Fonts */
|
|
419
|
+
--font-sans: var(--font-sans);
|
|
420
|
+
--font-mono: var(--font-mono);
|
|
421
|
+
|
|
422
|
+
/* Radius */
|
|
423
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
424
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
425
|
+
--radius-lg: var(--radius);
|
|
426
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
427
|
+
|
|
428
|
+
/* Shadows */
|
|
429
|
+
--shadow-sm: var(--shadow-sm);
|
|
430
|
+
--shadow-md: var(--shadow-md);
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Theme File Structure
|
|
435
|
+
|
|
436
|
+
```
|
|
437
|
+
contents/themes/default/
|
|
438
|
+
├── config/
|
|
439
|
+
│ ├── theme.config.ts # Theme metadata
|
|
440
|
+
│ ├── app.config.ts # App settings
|
|
441
|
+
│ ├── permissions.config.ts # Role permissions
|
|
442
|
+
│ └── plans.config.ts # Billing plans
|
|
443
|
+
├── styles/
|
|
444
|
+
│ ├── globals.css # CSS variables (light + dark)
|
|
445
|
+
│ └── components.css # Custom component styles
|
|
446
|
+
├── blocks/
|
|
447
|
+
│ └── {slug}/
|
|
448
|
+
│ └── thumbnail.png # Block preview image
|
|
449
|
+
├── public/
|
|
450
|
+
│ └── theme-assets/ # Static assets
|
|
451
|
+
└── messages/
|
|
452
|
+
├── en.json # English translations
|
|
453
|
+
└── es.json # Spanish translations
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
## Anti-Patterns
|
|
457
|
+
|
|
458
|
+
```typescript
|
|
459
|
+
// NEVER: Hardcode colors
|
|
460
|
+
<div className="bg-white text-gray-900">
|
|
461
|
+
|
|
462
|
+
// CORRECT: Use semantic tokens
|
|
463
|
+
<div className="bg-background text-foreground">
|
|
464
|
+
|
|
465
|
+
// NEVER: Use arbitrary colors
|
|
466
|
+
<div className="bg-[#1a1a1a]">
|
|
467
|
+
|
|
468
|
+
// CORRECT: Define in CSS variables if needed
|
|
469
|
+
<div className="bg-background">
|
|
470
|
+
|
|
471
|
+
// NEVER: Hardcode dark mode classes
|
|
472
|
+
<div className="bg-white dark:bg-gray-900">
|
|
473
|
+
|
|
474
|
+
// CORRECT: Use variables that auto-switch
|
|
475
|
+
<div className="bg-background"> {/* Switches automatically */}
|
|
476
|
+
|
|
477
|
+
// NEVER: Skip buildSectionClasses in blocks
|
|
478
|
+
<section className={`py-16 ${backgroundColor === 'gray-900' ? 'bg-gray-900 text-white' : ''}`}>
|
|
479
|
+
|
|
480
|
+
// CORRECT: Use helper function
|
|
481
|
+
<section className={buildSectionClasses('py-16', { backgroundColor })}>
|
|
482
|
+
|
|
483
|
+
// NEVER: Modify generated CSS files
|
|
484
|
+
// core/theme-styles.css - DO NOT EDIT
|
|
485
|
+
|
|
486
|
+
// CORRECT: Modify source files and rebuild
|
|
487
|
+
// contents/themes/default/styles/globals.css
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
## Checklist
|
|
491
|
+
|
|
492
|
+
Before finalizing theme implementation:
|
|
493
|
+
|
|
494
|
+
- [ ] Using semantic tokens (bg-background, not bg-white)
|
|
495
|
+
- [ ] No hardcoded colors
|
|
496
|
+
- [ ] Dark mode works automatically (variables switch)
|
|
497
|
+
- [ ] Blocks use buildSectionClasses helper
|
|
498
|
+
- [ ] Background color uses BackgroundColor type
|
|
499
|
+
- [ ] Theme rebuilt after CSS changes
|
|
500
|
+
- [ ] Assets copied to public/theme/
|
|
501
|
+
- [ ] No modifications to generated files
|
|
502
|
+
|
|
503
|
+
## Related Skills
|
|
504
|
+
|
|
505
|
+
- `shadcn-components` - Component styling patterns
|
|
506
|
+
- `page-builder-blocks` - Block styling with buildSectionClasses
|
|
507
|
+
- `accessibility` - Color contrast requirements
|