@thorprovider/create-storefront 0.1.1
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 +119 -0
- package/bin/install.js +116 -0
- package/commands/sf-add-view.md +21 -0
- package/commands/sf-init.md +16 -0
- package/commands/sf-theme.md +15 -0
- package/commands/sf-view.md +20 -0
- package/package.json +40 -0
- package/recipes/archetype.schema.json +39 -0
- package/recipes/archetypes.json +148 -0
- package/recipes/recipe.schema.json +59 -0
- package/recipes/recipes.json +90 -0
- package/recipes/sections.json +46 -0
- package/recipes/validate.mjs +190 -0
- package/skills/building-storefronts/SKILL.md +178 -0
- package/skills/building-storefronts/references/frontend-integration.md +229 -0
- package/skills/json-render-core/SKILL.md +291 -0
- package/skills/json-render-next/SKILL.md +194 -0
- package/skills/json-render-react/SKILL.md +298 -0
- package/skills/json-render-remotion/SKILL.md +111 -0
- package/skills/json-render-shadcn/SKILL.md +159 -0
- package/skills/json-render-solid/SKILL.md +204 -0
- package/skills/nextjs-shadcn/SKILL.md +303 -0
- package/skills/nextjs-shadcn/references/architecture.md +499 -0
- package/skills/nextjs-shadcn/references/project-setup.md +127 -0
- package/skills/nextjs-shadcn/references/shadcn-platform.md +258 -0
- package/skills/nextjs-shadcn/references/sidebar.md +274 -0
- package/skills/nextjs-shadcn/references/styling.md +555 -0
- package/skills/sf-scaffold/SKILL.md +118 -0
- package/skills/sf-theme-gen/SKILL.md +44 -0
- package/skills/sf-view-gen/SKILL.md +94 -0
- package/skills/shadcn-component-discovery/SKILL.md +273 -0
- package/skills/shadcn-component-discovery/references/registries.md +226 -0
- package/skills/shadcn-theming/SKILL.md +104 -0
- package/skills/shadcn-theming/references/templates/theme-setup.md +109 -0
- package/skills/shadcn-theming/references/theming-guide.md +90 -0
- package/skills/storefront-best-practices/SKILL.md +421 -0
- package/skills/storefront-best-practices/reference/components/breadcrumbs.md +123 -0
- package/skills/storefront-best-practices/reference/components/cart-popup.md +189 -0
- package/skills/storefront-best-practices/reference/components/country-selector.md +298 -0
- package/skills/storefront-best-practices/reference/components/footer.md +112 -0
- package/skills/storefront-best-practices/reference/components/hero.md +241 -0
- package/skills/storefront-best-practices/reference/components/megamenu.md +239 -0
- package/skills/storefront-best-practices/reference/components/navbar.md +397 -0
- package/skills/storefront-best-practices/reference/components/popups.md +221 -0
- package/skills/storefront-best-practices/reference/components/product-card.md +125 -0
- package/skills/storefront-best-practices/reference/components/product-reviews.md +217 -0
- package/skills/storefront-best-practices/reference/components/product-slider.md +174 -0
- package/skills/storefront-best-practices/reference/components/search.md +101 -0
- package/skills/storefront-best-practices/reference/connecting-to-backend.md +391 -0
- package/skills/storefront-best-practices/reference/design.md +388 -0
- package/skills/storefront-best-practices/reference/features/promotions.md +307 -0
- package/skills/storefront-best-practices/reference/features/wishlist.md +230 -0
- package/skills/storefront-best-practices/reference/layouts/account.md +380 -0
- package/skills/storefront-best-practices/reference/layouts/cart.md +316 -0
- package/skills/storefront-best-practices/reference/layouts/checkout.md +486 -0
- package/skills/storefront-best-practices/reference/layouts/home-page.md +264 -0
- package/skills/storefront-best-practices/reference/layouts/order-confirmation.md +231 -0
- package/skills/storefront-best-practices/reference/layouts/product-details.md +527 -0
- package/skills/storefront-best-practices/reference/layouts/product-listing.md +520 -0
- package/skills/storefront-best-practices/reference/layouts/static-pages.md +356 -0
- package/skills/storefront-best-practices/reference/medusa.md +307 -0
- package/skills/storefront-best-practices/reference/mobile-responsiveness.md +183 -0
- package/skills/storefront-best-practices/reference/seo.md +195 -0
- package/templates/app/app/[[...slug]]/page.tsx +17 -0
- package/templates/app/app/[[...slug]]/renderer.tsx +10 -0
- package/templates/app/app/globals.css +101 -0
- package/templates/app/app/layout.tsx +35 -0
- package/templates/app/lib/__STOREFRONT__/catalog.ts +132 -0
- package/templates/app/lib/__STOREFRONT__/handlers.ts +33 -0
- package/templates/app/lib/__STOREFRONT__/registry.tsx +134 -0
- package/templates/app/lib/__STOREFRONT__/runtime.ts +25 -0
- package/templates/app/lib/__STOREFRONT__/spec/home.ts +62 -0
- package/templates/app/lib/__STOREFRONT__/spec/index.ts +59 -0
- package/templates/app/lib/__STOREFRONT__/spec/types.ts +14 -0
- package/templates/app/lib/__STOREFRONT__/state.ts +35 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shadcn-theming
|
|
3
|
+
description: "Use when defining or auditing shadcn/ui design tokens, OKLCH colors, or dark/light mode CSS variables."
|
|
4
|
+
versions:
|
|
5
|
+
shadcn-ui: "2.x"
|
|
6
|
+
tailwindcss: "4.1"
|
|
7
|
+
user-invocable: true
|
|
8
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
9
|
+
references: references/theming-guide.md, references/templates/theme-setup.md
|
|
10
|
+
related-skills: shadcn-registries, shadcn-components
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<objective>
|
|
14
|
+
Design tokens and theming for shadcn/ui: CSS custom properties (`--background`, `--primary`, etc.), OKLCH wide-gamut colors, dark/light mode via the `.dark` class or `prefers-color-scheme`, and Tailwind v4 `@theme` directive integration — for both Radix and Base UI primitives.
|
|
15
|
+
|
|
16
|
+
Documents the token hierarchy (component → semantic → primitive OKLCH values) and the validation checklist (dark-mode overrides, chart/sidebar variables, no hard-coded hex).
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
# shadcn Theming
|
|
20
|
+
|
|
21
|
+
## Agent Workflow (MANDATORY)
|
|
22
|
+
|
|
23
|
+
Before theming work, use `TeamCreate`:
|
|
24
|
+
|
|
25
|
+
1. **fuse-ai-pilot:explore-codebase** - Find existing theme tokens
|
|
26
|
+
2. **fuse-ai-pilot:research-expert** - Verify OKLCH patterns via Context7
|
|
27
|
+
|
|
28
|
+
After: Run **fuse-ai-pilot:sniper** for validation.
|
|
29
|
+
|
|
30
|
+
## Overview
|
|
31
|
+
|
|
32
|
+
| Feature | Description |
|
|
33
|
+
|---------|-------------|
|
|
34
|
+
| **CSS Variables** | `--background`, `--foreground`, `--primary` |
|
|
35
|
+
| **OKLCH Colors** | Wide-gamut P3 color space |
|
|
36
|
+
| **Dark Mode** | `.dark` class or `prefers-color-scheme` |
|
|
37
|
+
| **Tailwind v4** | `@theme` directive integration |
|
|
38
|
+
|
|
39
|
+
## Critical Rules
|
|
40
|
+
|
|
41
|
+
1. **ALWAYS use OKLCH** color space for all tokens
|
|
42
|
+
2. **ALWAYS define dark mode** overrides for every token
|
|
43
|
+
3. **NEVER hard-code** hex or rgb in components
|
|
44
|
+
4. **USE @theme** directive for Tailwind v4 integration
|
|
45
|
+
5. **MAP semantic tokens** to primitive OKLCH values
|
|
46
|
+
|
|
47
|
+
## Architecture
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
app/
|
|
51
|
+
├── globals.css # :root + .dark token definitions
|
|
52
|
+
└── tailwind.config.ts # Optional (v3) or @theme (v4)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
-> See [theme-setup.md](references/templates/theme-setup.md) for complete theme
|
|
56
|
+
|
|
57
|
+
## Token Hierarchy
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Component: --card, --card-foreground, --button-*
|
|
61
|
+
↑
|
|
62
|
+
Semantic: --primary, --secondary, --accent, --muted
|
|
63
|
+
↑
|
|
64
|
+
Primitive: oklch(55% 0.20 260), oklch(98% 0.01 260)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Validation Checklist
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
[ ] CSS variables defined in :root
|
|
71
|
+
[ ] Dark mode overrides in .dark
|
|
72
|
+
[ ] OKLCH color space used
|
|
73
|
+
[ ] Chart variables (--chart-1 to --chart-5)
|
|
74
|
+
[ ] Sidebar variables if applicable
|
|
75
|
+
[ ] No hard-coded hex in components
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Best Practices
|
|
79
|
+
|
|
80
|
+
### DO
|
|
81
|
+
- Use OKLCH for all colors
|
|
82
|
+
- Define semantic tokens mapped to primitives
|
|
83
|
+
- Provide dark mode overrides for all tokens
|
|
84
|
+
- Use `@theme` for Tailwind v4 integration
|
|
85
|
+
|
|
86
|
+
### DON'T
|
|
87
|
+
- Hard-code hex or rgb values
|
|
88
|
+
- Skip dark mode definitions
|
|
89
|
+
- Mix color spaces (hex + oklch)
|
|
90
|
+
- Define tokens only in Tailwind config
|
|
91
|
+
|
|
92
|
+
## Reference Guide
|
|
93
|
+
|
|
94
|
+
### Concepts
|
|
95
|
+
|
|
96
|
+
| Topic | Reference | When to Consult |
|
|
97
|
+
|-------|-----------|-----------------|
|
|
98
|
+
| **Theming Guide** | [theming-guide.md](references/theming-guide.md) | CSS variables and OKLCH setup |
|
|
99
|
+
|
|
100
|
+
### Templates
|
|
101
|
+
|
|
102
|
+
| Template | When to Use |
|
|
103
|
+
|----------|-------------|
|
|
104
|
+
| [theme-setup.md](references/templates/theme-setup.md) | Complete theme configuration |
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: theme-setup
|
|
3
|
+
description: Complete shadcn/ui theme with CSS variables, dark mode, and Tailwind v4 integration
|
|
4
|
+
keywords: theme, setup, css, oklch, dark-mode, tailwind
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Theme Setup
|
|
8
|
+
|
|
9
|
+
## Complete Light + Dark Theme
|
|
10
|
+
|
|
11
|
+
```css
|
|
12
|
+
/* app/globals.css */
|
|
13
|
+
@import "tailwindcss";
|
|
14
|
+
|
|
15
|
+
:root {
|
|
16
|
+
--background: oklch(100% 0 0);
|
|
17
|
+
--foreground: oklch(14.1% 0.005 285.82);
|
|
18
|
+
--card: oklch(100% 0 0);
|
|
19
|
+
--card-foreground: oklch(14.1% 0.005 285.82);
|
|
20
|
+
--popover: oklch(100% 0 0);
|
|
21
|
+
--popover-foreground: oklch(14.1% 0.005 285.82);
|
|
22
|
+
--primary: oklch(20.5% 0.016 285.94);
|
|
23
|
+
--primary-foreground: oklch(98.5% 0 0);
|
|
24
|
+
--secondary: oklch(96.7% 0.001 286.38);
|
|
25
|
+
--secondary-foreground: oklch(20.5% 0.016 285.94);
|
|
26
|
+
--accent: oklch(96.7% 0.001 286.38);
|
|
27
|
+
--accent-foreground: oklch(20.5% 0.016 285.94);
|
|
28
|
+
--muted: oklch(96.7% 0.001 286.38);
|
|
29
|
+
--muted-foreground: oklch(55.6% 0.01 285.94);
|
|
30
|
+
--destructive: oklch(57.7% 0.245 27.33);
|
|
31
|
+
--destructive-foreground: oklch(98.5% 0 0);
|
|
32
|
+
--border: oklch(92.2% 0.004 286.32);
|
|
33
|
+
--input: oklch(92.2% 0.004 286.32);
|
|
34
|
+
--ring: oklch(87.1% 0.006 286.29);
|
|
35
|
+
--radius: 0.625rem;
|
|
36
|
+
--chart-1: oklch(64.6% 0.222 41.12);
|
|
37
|
+
--chart-2: oklch(60% 0.19 160);
|
|
38
|
+
--chart-3: oklch(55% 0.18 230);
|
|
39
|
+
--chart-4: oklch(70% 0.15 300);
|
|
40
|
+
--chart-5: oklch(75% 0.12 60);
|
|
41
|
+
--sidebar: oklch(98.5% 0 0);
|
|
42
|
+
--sidebar-foreground: oklch(14.1% 0.005 285.82);
|
|
43
|
+
--sidebar-primary: oklch(20.5% 0.016 285.94);
|
|
44
|
+
--sidebar-accent: oklch(96.7% 0.001 286.38);
|
|
45
|
+
--sidebar-border: oklch(92.2% 0.004 286.32);
|
|
46
|
+
--sidebar-ring: oklch(87.1% 0.006 286.29);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dark {
|
|
50
|
+
--background: oklch(14.1% 0.005 285.82);
|
|
51
|
+
--foreground: oklch(98.5% 0 0);
|
|
52
|
+
--card: oklch(14.1% 0.005 285.82);
|
|
53
|
+
--card-foreground: oklch(98.5% 0 0);
|
|
54
|
+
--popover: oklch(14.1% 0.005 285.82);
|
|
55
|
+
--popover-foreground: oklch(98.5% 0 0);
|
|
56
|
+
--primary: oklch(92.2% 0 0);
|
|
57
|
+
--primary-foreground: oklch(20.5% 0.016 285.94);
|
|
58
|
+
--secondary: oklch(26.9% 0.006 286.03);
|
|
59
|
+
--secondary-foreground: oklch(98.5% 0 0);
|
|
60
|
+
--accent: oklch(26.9% 0.006 286.03);
|
|
61
|
+
--accent-foreground: oklch(98.5% 0 0);
|
|
62
|
+
--muted: oklch(26.9% 0.006 286.03);
|
|
63
|
+
--muted-foreground: oklch(71.1% 0.013 286.07);
|
|
64
|
+
--destructive: oklch(57.7% 0.245 27.33);
|
|
65
|
+
--border: oklch(26.9% 0.006 286.03);
|
|
66
|
+
--input: oklch(26.9% 0.006 286.03);
|
|
67
|
+
--ring: oklch(36.2% 0.014 285.88);
|
|
68
|
+
--sidebar: oklch(14.1% 0.005 285.82);
|
|
69
|
+
--sidebar-foreground: oklch(98.5% 0 0);
|
|
70
|
+
--sidebar-primary: oklch(48.8% 0.243 264.05);
|
|
71
|
+
--sidebar-accent: oklch(26.9% 0.006 286.03);
|
|
72
|
+
--sidebar-border: oklch(26.9% 0.006 286.03);
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Tailwind v4 @theme Bridge
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
@theme {
|
|
80
|
+
--color-background: var(--background);
|
|
81
|
+
--color-foreground: var(--foreground);
|
|
82
|
+
--color-primary: var(--primary);
|
|
83
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
84
|
+
--color-secondary: var(--secondary);
|
|
85
|
+
--color-accent: var(--accent);
|
|
86
|
+
--color-muted: var(--muted);
|
|
87
|
+
--color-destructive: var(--destructive);
|
|
88
|
+
--color-border: var(--border);
|
|
89
|
+
--color-input: var(--input);
|
|
90
|
+
--color-ring: var(--ring);
|
|
91
|
+
--radius-lg: var(--radius);
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Theme Switching (React)
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
// components/theme-provider.tsx
|
|
99
|
+
"use client"
|
|
100
|
+
import { ThemeProvider as NextThemesProvider } from "next-themes"
|
|
101
|
+
|
|
102
|
+
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
|
103
|
+
return (
|
|
104
|
+
<NextThemesProvider attribute="class" defaultTheme="system" enableSystem>
|
|
105
|
+
{children}
|
|
106
|
+
</NextThemesProvider>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: theming-guide
|
|
3
|
+
description: CSS variables, OKLCH colors, chart/sidebar tokens, and Tailwind integration
|
|
4
|
+
when-to-use: When configuring theme tokens or color system
|
|
5
|
+
keywords: theme, oklch, css-variables, dark-mode, tailwind, tokens, colors
|
|
6
|
+
priority: high
|
|
7
|
+
related: ../SKILL.md
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Theming Guide
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
shadcn/ui uses CSS custom properties with OKLCH color space for wide-gamut P3 support and perceptual uniformity. Tokens follow a 3-level hierarchy: primitive -> semantic -> component.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Key Concepts
|
|
19
|
+
|
|
20
|
+
| Concept | Description |
|
|
21
|
+
|---------|-------------|
|
|
22
|
+
| **OKLCH** | `oklch(L% C H)` - perceptually uniform, P3 gamut |
|
|
23
|
+
| **Semantic tokens** | `--primary`, `--secondary`, `--accent` |
|
|
24
|
+
| **Dark mode** | `.dark` class or `prefers-color-scheme` |
|
|
25
|
+
| **@theme** | Tailwind v4 custom property bridge |
|
|
26
|
+
|
|
27
|
+
## Layout Variables
|
|
28
|
+
|
|
29
|
+
| Variable | Purpose |
|
|
30
|
+
|----------|---------|
|
|
31
|
+
| `--background` | Page background |
|
|
32
|
+
| `--foreground` | Default text |
|
|
33
|
+
| `--card` / `--card-foreground` | Card surfaces |
|
|
34
|
+
| `--popover` / `--popover-foreground` | Popover surfaces |
|
|
35
|
+
|
|
36
|
+
## Interactive Variables
|
|
37
|
+
|
|
38
|
+
| Variable | Purpose |
|
|
39
|
+
|----------|---------|
|
|
40
|
+
| `--primary` / `--primary-foreground` | Primary buttons, links |
|
|
41
|
+
| `--secondary` | Secondary elements |
|
|
42
|
+
| `--accent` | Hover backgrounds |
|
|
43
|
+
| `--muted` / `--muted-foreground` | Muted backgrounds |
|
|
44
|
+
| `--destructive` | Danger/delete actions |
|
|
45
|
+
|
|
46
|
+
## Utility Variables
|
|
47
|
+
|
|
48
|
+
| Variable | Purpose |
|
|
49
|
+
|----------|---------|
|
|
50
|
+
| `--border` | Default border color |
|
|
51
|
+
| `--input` | Input border color |
|
|
52
|
+
| `--ring` | Focus ring color |
|
|
53
|
+
| `--radius` | Default border radius (0.625rem) |
|
|
54
|
+
|
|
55
|
+
## OKLCH Color Space
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
oklch(Lightness% Chroma Hue)
|
|
59
|
+
L: 0-100% (0 = black, 100 = white)
|
|
60
|
+
C: 0-0.4 (0 = gray, 0.4 = vivid)
|
|
61
|
+
H: 0-360 (hue angle)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Benefits: perceptual uniformity, P3 gamut, predictable contrast.
|
|
65
|
+
|
|
66
|
+
## Theme Switching
|
|
67
|
+
|
|
68
|
+
Use `.dark` class on `<html>` or CSS media query:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
<html className={theme === "dark" ? "dark" : ""}>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For full setup with next-themes, see [theme-setup.md](templates/theme-setup.md).
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Common Mistakes
|
|
79
|
+
|
|
80
|
+
| Mistake | Fix |
|
|
81
|
+
|---------|-----|
|
|
82
|
+
| Mixing hex and OKLCH | Use OKLCH consistently |
|
|
83
|
+
| Forgetting dark overrides | Every :root token needs .dark equivalent |
|
|
84
|
+
| Defining colors in Tailwind config | Use CSS variables with @theme bridge |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Related Templates
|
|
89
|
+
|
|
90
|
+
- [theme-setup.md](templates/theme-setup.md) - Complete theme configuration
|