@zohofinance/commerce 1.0.0 → 1.1.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 +59 -0
- package/package.json +2 -2
- package/ts-dist/mocks/init-theme/.claude/CLAUDE.md +6 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/SKILL.md +242 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/figma.md +81 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/screenshot.md +54 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/url.md +88 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/spec-table.md +102 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/accessibility.md +110 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/performance.md +127 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/tokens.md +87 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/visual-diff.md +123 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/SKILL.md +605 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/design-tokens.md +105 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/page-json-contract.md +58 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/qa-accessibility.md +35 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/reference-lookup.md +94 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/section-anatomy.md +109 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/SKILL.md +313 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/agent-hierarchy.md +142 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/ask-developer.md +113 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/bootstrap.md +260 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/build-metrics.md +89 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/code-quality.md +186 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/common-pages-agent.md +97 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/dev-server-and-urls.md +136 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/exemplars.md +79 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-discovery.md +138 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-extraction.md +132 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/image-sources.md +84 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/inputs/guidelines-frame.md +178 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-builder.md +322 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-orchestrator.md +199 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/parallel-fanout.md +152 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/a11y.mjs +129 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/lint-section.mjs +502 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/perf.mjs +134 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/pixel-diff.mjs +206 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/record-build-metrics.mjs +118 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/section-builder.md +131 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/subagent-escalation.md +75 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/transcription-rules.md +98 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/verification.md +227 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/visual-verify-loop.md +117 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/_index.md +4 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/assets.md +105 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/best-practices.md +212 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/custom-scripts.md +294 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/i18n.md +155 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/introduction.md +91 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/layouts.md +158 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/pages.md +156 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/_index.md +4 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/filters.md +419 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/global-objects.md +415 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/schema-types.md +926 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/tags.md +259 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/sections.md +203 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/setup-guide.md +424 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/snippets.md +70 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/theme-structure.md +252 -0
- package/ts-dist/mocks/init-theme/.cursor/PLAYBOOK.md +144 -0
- package/ts-dist/mocks/init-theme/.cursor/README.md +6 -0
- package/ts-dist/mocks/init-theme/.cursor/agents/figma-desktop-mobile-parallel.md +48 -0
- package/ts-dist/mocks/init-theme/.cursor/agents/visual-compare.md +221 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/add-field.md +83 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/add-theme-setting.md +200 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/assemble-page.md +72 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/audit-page.md +57 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-page-sections.md +110 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-section.md +418 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-theme.md +307 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/compare-section.md +358 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/create-theme.md +77 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/extract-tokens.md +43 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/fix-section.md +92 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/impact.md +50 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-a11y.md +66 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-i18n.md +110 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-layout.md +127 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-performance.md +72 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-section.md +84 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-sections.md +48 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-theme.md +85 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/redesign-section.md +177 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/refactor-section.md +185 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/sync-theme-settings.md +132 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-page.md +60 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-section-group.md +88 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-theme-settings.md +119 -0
- package/ts-dist/mocks/init-theme/.cursor/examples/design-instructions-template.md +151 -0
- package/ts-dist/mocks/init-theme/.cursor/mcp.json +18 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/README.md +160 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/accessibility.mdc +24 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/add-field.mdc +222 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/add-theme-setting.mdc +39 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/assemble-page.mdc +130 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/audit-page.mdc +92 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/build-section.mdc +178 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/build-theme.mdc +47 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/compare-section.mdc +94 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/create-theme.mdc +78 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/css.mdc +137 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/design-spec-extraction.mdc +255 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/extract-tokens.mdc +43 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/figma-mcp-resolution.mdc +40 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/fix-section.mdc +154 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/general.mdc +30 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/i18n.mdc +85 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/javascript.mdc +85 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/liquid-no-hardcoded-strings.mdc +42 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/liquid.mdc +171 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/mobile-desktop-setting-meta.mdc +34 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/naming-convention.mdc +64 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/pages.mdc +120 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/performance.mdc +51 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/qa-section.mdc +134 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/redesign-section.mdc +147 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/schema-sync.mdc +110 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/schema.mdc +360 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/share-urls.mdc +68 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/browser-verify.md +128 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/design-tokens.md +105 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/page-json-contract.md +87 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/qa-accessibility.md +35 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/reference-lookup.md +88 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/section-anatomy.md +173 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# SKILL: Design Tokens
|
|
2
|
+
# Save this as a Cursor Notepad named: design-tokens
|
|
3
|
+
# Usage in chat: @design-tokens
|
|
4
|
+
|
|
5
|
+
How to correctly map Figma values to Tailwind classes and CSS variables in this theme system.
|
|
6
|
+
Always use this when reading Figma output — never use raw values inline.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Figma MCP variable resolution (do this first)
|
|
11
|
+
When using **Figma MCP** (e.g. get_design_context), the response contains `var(--variable-name, fallback)`. The fallback may be from a different mode (e.g. TWICE). To use the theme’s mode (e.g. B2BIZMART):
|
|
12
|
+
|
|
13
|
+
1. **Look up** the variable name in `figma-variables.json`: split the name on `/` and traverse (e.g. `radius/xl` → `json["radius"]["xl"]`).
|
|
14
|
+
2. If the node has **`$value`**, use that value.
|
|
15
|
+
3. If not found, use the **fallback** from the MCP response.
|
|
16
|
+
4. Then map this **resolved** value to Tailwind/CSS using the tables below.
|
|
17
|
+
|
|
18
|
+
See `.cursor/rules/figma-mcp-resolution.mdc` for the full rule.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## The Rule
|
|
23
|
+
❌ Never output: `style="font-size: 48px; color: #1a1a1a"`
|
|
24
|
+
✅ Always output: `class="text-5xl" style="color: var(--color-heading)"`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## CSS Variables (always use these for color)
|
|
29
|
+
| Role | Variable |
|
|
30
|
+
|------|----------|
|
|
31
|
+
| Primary brand | `var(--color-primary)` |
|
|
32
|
+
| Text on primary bg | `var(--color-on-primary)` |
|
|
33
|
+
| Headings / dark text | `var(--color-heading)` |
|
|
34
|
+
| Page / card background | `var(--color-background)` |
|
|
35
|
+
| Border / divider | `var(--color-border)` |
|
|
36
|
+
| Header bar background | `var(--color-header-bg)` |
|
|
37
|
+
| Section horizontal padding | `var(--section-padding-x, 16px)` |
|
|
38
|
+
|
|
39
|
+
For theme-specific colors not in this list → check `figma-variables.json` in the current theme folder (and resolve Figma MCP vars from it first when using MCP).
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Typography → Tailwind
|
|
44
|
+
| Figma px | Tailwind | Use for |
|
|
45
|
+
|----------|----------|---------|
|
|
46
|
+
| 12px | `text-xs` | Labels, captions |
|
|
47
|
+
| 14px | `text-sm` | Secondary text, meta |
|
|
48
|
+
| 16px | `text-base` | Body text |
|
|
49
|
+
| 18px | `text-lg` | Large body |
|
|
50
|
+
| 20px | `text-xl` | Small headings |
|
|
51
|
+
| 24px | `text-2xl` | Sub-headings |
|
|
52
|
+
| 30px | `text-3xl` | Section headings |
|
|
53
|
+
| 36px | `text-4xl` | Page headings |
|
|
54
|
+
| 48px | `text-5xl` | Hero headings |
|
|
55
|
+
| 60px | `text-6xl` | Display headings |
|
|
56
|
+
| 72px+ | `text-7xl` | Giant display |
|
|
57
|
+
|
|
58
|
+
Font weight:
|
|
59
|
+
| Figma | Tailwind |
|
|
60
|
+
|-------|----------|
|
|
61
|
+
| 400 | `font-normal` |
|
|
62
|
+
| 500 | `font-medium` |
|
|
63
|
+
| 600 | `font-semibold` |
|
|
64
|
+
| 700 | `font-bold` |
|
|
65
|
+
| 800 | `font-extrabold` |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Spacing → Tailwind (1 unit = 4px)
|
|
70
|
+
| Figma px | Tailwind gap/p/m |
|
|
71
|
+
|----------|-----------------|
|
|
72
|
+
| 4px | `gap-1` / `p-1` |
|
|
73
|
+
| 8px | `gap-2` / `p-2` |
|
|
74
|
+
| 12px | `gap-3` / `p-3` |
|
|
75
|
+
| 16px | `gap-4` / `p-4` |
|
|
76
|
+
| 20px | `gap-5` / `p-5` |
|
|
77
|
+
| 24px | `gap-6` / `p-6` |
|
|
78
|
+
| 32px | `gap-8` / `p-8` |
|
|
79
|
+
| 40px | `gap-10` / `p-10` |
|
|
80
|
+
| 48px | `gap-12` / `p-12` |
|
|
81
|
+
| 64px | `gap-16` / `p-16` |
|
|
82
|
+
| 80px | `gap-20` / `p-20` |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Border Radius → Tailwind
|
|
87
|
+
| Figma px | Tailwind |
|
|
88
|
+
|----------|----------|
|
|
89
|
+
| 2px | `rounded-sm` |
|
|
90
|
+
| 4px | `rounded` |
|
|
91
|
+
| 6px | `rounded-md` |
|
|
92
|
+
| 8px | `rounded-lg` |
|
|
93
|
+
| 12px | `rounded-xl` |
|
|
94
|
+
| 16px | `rounded-2xl` |
|
|
95
|
+
| 24px | `rounded-3xl` |
|
|
96
|
+
| 9999px | `rounded-full` |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## When a Value is Not in This Map
|
|
101
|
+
1. If from Figma MCP, resolve via `figma-variables.json` first (use `$value` if present).
|
|
102
|
+
2. Check `figma-variables.json` in the current theme folder for other mappings.
|
|
103
|
+
3. Use Tailwind arbitrary value: `text-[22px]` or `gap-[18px]`
|
|
104
|
+
4. Add a comment: `{{-- ⚠️ unmapped token: 22px --}}`
|
|
105
|
+
5. Report it in the build output so it can be added to the token map if needed.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# SKILL: Page JSON contract
|
|
2
|
+
# Usage in chat: @page-json-contract
|
|
3
|
+
|
|
4
|
+
How page JSON relates to section schema. Use when running `/assemble-page` or `/validate-page`.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Page JSON shape
|
|
9
|
+
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"layout": "theme",
|
|
13
|
+
"sections": {
|
|
14
|
+
"<section_key>": {
|
|
15
|
+
"type": "<section_filename_without_.liquid>",
|
|
16
|
+
"settings": { ... },
|
|
17
|
+
"blocks": { "<block_key>": { "type": "<block_type>", "settings": {} } },
|
|
18
|
+
"block_order": ["<block_key>", ...]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"order": ["<section_key_1>", "<section_key_2>", ...]
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- **section_key:** arbitrary key (e.g. `hero`, `product_details`). Must be unique in the page.
|
|
26
|
+
- **type:** must exactly match a section file name under `sections/` (e.g. `product-details` for `product-details.liquid`).
|
|
27
|
+
- **blocks:** only present if the section schema defines `"blocks": { ... }`. Each key in `blocks` is a block instance; `type` must match a block type in that section’s schema.
|
|
28
|
+
- **block_order:** array of block keys; every key must exist in `blocks`. Order determines render order.
|
|
29
|
+
- **order:** array of section keys; every key must exist in `sections`. Order determines section order on the page.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Settings value formats (inline in page JSON)
|
|
34
|
+
|
|
35
|
+
| Schema type | Page JSON value format |
|
|
36
|
+
|---------------|------------------------|
|
|
37
|
+
| text | string |
|
|
38
|
+
| url | `{ "display_name": "t:...", "handle": "/path" }` |
|
|
39
|
+
| image_picker | `{ "url": "file.webp", "enable_customisation": true }` |
|
|
40
|
+
| media_picker | `{ "url": "video.mp4", "is_video": true }` |
|
|
41
|
+
| select | `{ "display_name": "t:...", "value": "option-value" }` |
|
|
42
|
+
| menu | `{ "display_name": "t:...", "handle": "menu-handle" }` |
|
|
43
|
+
| checkbox | true / false |
|
|
44
|
+
| range/number | number |
|
|
45
|
+
| color | hex string e.g. "#000000" |
|
|
46
|
+
|
|
47
|
+
All user-facing strings use `t:` keys. Section and block setting IDs in page JSON must match the section’s `{% schema %}`.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Validation (for /validate-page)
|
|
52
|
+
|
|
53
|
+
- For each entry in `order`, the key exists in `sections`.
|
|
54
|
+
- For each `sections.<key>.type`, the file `sections/<type>.liquid` exists.
|
|
55
|
+
- For each section that has `blocks` and `block_order`, every entry in `block_order` exists in `blocks`.
|
|
56
|
+
- For each `blocks.<key>.type`, that type is defined in the section’s schema under `"blocks": { "<block_type>": { ... } }`.
|
|
57
|
+
|
|
58
|
+
Reference this skill when assembling or validating page JSON.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# SKILL: QA Accessibility
|
|
2
|
+
# Usage in chat: @qa-accessibility
|
|
3
|
+
|
|
4
|
+
Checklist for auditing section accessibility when running `/qa-section` or reviewing a section manually.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Images
|
|
9
|
+
- Every `<img>` has a non-empty `alt`. Use meaningful description (e.g. product name, CTA context); decorative images may use `alt=""`.
|
|
10
|
+
- Avoid images of text for critical content; if used, `alt` must convey the same information.
|
|
11
|
+
|
|
12
|
+
## Headings
|
|
13
|
+
- Logical order: do not skip levels (e.g. h1 → h3). Use h1 once per section/page for main title.
|
|
14
|
+
- Headings describe the content that follows.
|
|
15
|
+
|
|
16
|
+
## Forms and controls
|
|
17
|
+
- Every form control has an associated label: use `<label for="id">` or `aria-label` / `aria-labelledby`.
|
|
18
|
+
- Groups of controls (e.g. variant options, sort options): use `<fieldset>` + `<legend>` or `role="group"` with `aria-labelledby` pointing to a visible label element (e.g. `<div id="...">`).
|
|
19
|
+
- Required fields indicated (e.g. `aria-required="true"` or visible "required" text).
|
|
20
|
+
|
|
21
|
+
## Focus and keyboard
|
|
22
|
+
- No `outline: none` (or similar) without a visible focus style (e.g. `outline: 2px solid var(--color-primary)` or `ring-2`).
|
|
23
|
+
- Interactive elements (links, buttons, custom controls) are focusable and have a visible focus indicator.
|
|
24
|
+
- Focus order follows visual order where possible.
|
|
25
|
+
|
|
26
|
+
## Buttons and links
|
|
27
|
+
- Icon-only buttons/links have a descriptive `aria-label` (e.g. "Add to cart", "Close menu", "Previous slide").
|
|
28
|
+
- Links that open in new tab: consider `target="_blank"` + `rel="noopener"` and optionally announce in `aria-label` for screen readers.
|
|
29
|
+
|
|
30
|
+
## Landmarks
|
|
31
|
+
- Section has a sensible structure; if it’s a main content region, consider `role="region"` and `aria-labelledby` for the section heading where it improves navigation.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
Use this skill when running the ACCESSIBILITY row of `/qa-section` or when asked to review a section for a11y.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# SKILL: Reference Lookup
|
|
2
|
+
# Save this as a Cursor Notepad named: reference-lookup
|
|
3
|
+
# Usage in chat: @reference-lookup
|
|
4
|
+
|
|
5
|
+
How to find and use existing theme sections as references when building new sections.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Step 1 — Find the Reference
|
|
10
|
+
Look for an equivalent section in this theme:
|
|
11
|
+
```
|
|
12
|
+
sections/ ← look for existing sections with similar purpose
|
|
13
|
+
snippets/ ← look for reusable snippets
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Match by purpose, not filename. Examples:
|
|
17
|
+
| Building | Look for reference named |
|
|
18
|
+
|----------|------------------------|
|
|
19
|
+
| hero-banner | banner, hero, slider, masthead |
|
|
20
|
+
| category-grid | category, collection-grid, product-listing |
|
|
21
|
+
| featured-products | featured, products, product-grid |
|
|
22
|
+
| testimonials | testimonials, reviews, quotes |
|
|
23
|
+
| footer | footer |
|
|
24
|
+
| header | header |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 2 — What to Extract
|
|
29
|
+
Open the reference file and extract ONLY these parts:
|
|
30
|
+
|
|
31
|
+
### Keep exactly as-is
|
|
32
|
+
- Schema field IDs (e.g. `heading`, `cta_url`, `bg_image`)
|
|
33
|
+
- Schema field types
|
|
34
|
+
- `{% liquid %}` assign variable names
|
|
35
|
+
- Loop variable names (e.g. `{% for product in products %}`)
|
|
36
|
+
- `{% render %}` snippet calls (these are shared infrastructure)
|
|
37
|
+
- JS web component tag names (e.g. `<product-card>`)
|
|
38
|
+
- Conditional logic patterns
|
|
39
|
+
|
|
40
|
+
### Adapt (keep structure, update values)
|
|
41
|
+
- Schema labels → update `t:` key path to new section name
|
|
42
|
+
- Schema defaults → update `t:` key path to new section name
|
|
43
|
+
- CSS class names → replace with new Figma-based Tailwind classes
|
|
44
|
+
- HTML structure → replace with new Figma layout
|
|
45
|
+
|
|
46
|
+
### Discard
|
|
47
|
+
- Inline hardcoded colors from old theme
|
|
48
|
+
- Old theme's specific layout classes
|
|
49
|
+
- Deprecated workarounds or comments marked as fixes
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Step 3 — When No Reference Exists
|
|
54
|
+
If no matching section exists in this theme:
|
|
55
|
+
1. Look for the closest partial match (e.g. use a card section as base for a different card layout)
|
|
56
|
+
2. Build schema from scratch using schema.mdc rules
|
|
57
|
+
3. Mark in your build notes: "NEW — no reference, built from schema.mdc"
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quick Reference: Common Section Patterns
|
|
62
|
+
|
|
63
|
+
### Settings every section should have
|
|
64
|
+
```jsonc
|
|
65
|
+
{ "type": "text", "id": "heading" }
|
|
66
|
+
{ "type": "checkbox", "id": "show_section", "default": true }
|
|
67
|
+
{ "type": "range", "id": "padding_top" }
|
|
68
|
+
{ "type": "range", "id": "padding_bottom" }
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Settings for sections with images
|
|
72
|
+
```jsonc
|
|
73
|
+
{ "type": "image_picker", "id": "section_image",
|
|
74
|
+
"default": { "url": "placeholder.webp", "enable_customisation": true } }
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Settings for sections with video
|
|
78
|
+
```jsonc
|
|
79
|
+
{ "type": "media_picker", "id": "video_media",
|
|
80
|
+
"default": { "url": "video.mp4", "is_video": true } }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Settings for sections with CTAs
|
|
84
|
+
```jsonc
|
|
85
|
+
{ "type": "text", "id": "cta_text" }
|
|
86
|
+
{ "type": "url", "id": "cta_url",
|
|
87
|
+
"default": { "display_name": "t:...", "handle": "/" } }
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Settings for sections with menus
|
|
91
|
+
```jsonc
|
|
92
|
+
{ "type": "menu", "id": "section_menu",
|
|
93
|
+
"default": { "display_name": "t:...", "handle": "" } }
|
|
94
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# SKILL: Section Anatomy
|
|
2
|
+
# Save this as a Cursor Notepad named: section-anatomy
|
|
3
|
+
# Usage in chat: @section-anatomy
|
|
4
|
+
|
|
5
|
+
Every section file must follow this exact anatomy. Use this as the structural checklist.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Complete Section File Structure (top to bottom)
|
|
10
|
+
|
|
11
|
+
```liquid
|
|
12
|
+
{{-- 1. SCRIPT TAGS (if JS component needed) --}}
|
|
13
|
+
<script src="{{ 'component-name.js' | asset_url }}" defer></script>
|
|
14
|
+
|
|
15
|
+
{{-- 2. STYLE BLOCK (dynamic CSS scoped to this section) --}}
|
|
16
|
+
{% style %}
|
|
17
|
+
#section-{{ section.id }} {
|
|
18
|
+
padding-top: {{ section.settings.padding_top }}px;
|
|
19
|
+
padding-bottom: {{ section.settings.padding_bottom }}px;
|
|
20
|
+
}
|
|
21
|
+
{% endstyle %}
|
|
22
|
+
|
|
23
|
+
{{-- 3. LIQUID ASSIGNS (all settings extracted at top) --}}
|
|
24
|
+
{% liquid
|
|
25
|
+
assign heading = section.settings.heading
|
|
26
|
+
assign sub_heading = section.settings.sub_heading
|
|
27
|
+
assign cta_text = section.settings.cta_text
|
|
28
|
+
assign cta_url = section.settings.cta_url
|
|
29
|
+
assign bg_image = section.settings.bg_image
|
|
30
|
+
assign show_section = section.settings.show_section
|
|
31
|
+
%}
|
|
32
|
+
|
|
33
|
+
{{-- 4. CONDITIONAL VISIBILITY --}}
|
|
34
|
+
{% if show_section %}
|
|
35
|
+
|
|
36
|
+
{{-- 5. SECTION WRAPPER --}}
|
|
37
|
+
<section id="section-{{ section.id }}" class="section-name w-full">
|
|
38
|
+
<div class="max-w-container-theme mx-auto" style="padding-left: var(--section-padding-x, 16px); padding-right: var(--section-padding-x, 16px);">
|
|
39
|
+
|
|
40
|
+
{{-- 6. SECTION CONTENT --}}
|
|
41
|
+
{% if heading != blank %}
|
|
42
|
+
<h2 class="text-4xl font-bold" style="color: var(--color-heading);">{{ heading | escape }}</h2>
|
|
43
|
+
{% endif %}
|
|
44
|
+
|
|
45
|
+
{{-- 7. LOOPS WITH EMPTY STATE --}}
|
|
46
|
+
{% if items.size > 0 %}
|
|
47
|
+
{% for item in items %}
|
|
48
|
+
{{-- item markup --}}
|
|
49
|
+
{% endfor %}
|
|
50
|
+
{% else %}
|
|
51
|
+
<p class="text-center" style="color: var(--color-heading);">No items found.</p>
|
|
52
|
+
{% endif %}
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
</section>
|
|
56
|
+
|
|
57
|
+
{% endif %}
|
|
58
|
+
|
|
59
|
+
{{-- 8. SCHEMA (always at the very bottom) --}}
|
|
60
|
+
{% schema %}
|
|
61
|
+
{
|
|
62
|
+
"name": "t:sections.<name>.name",
|
|
63
|
+
"tag": "section",
|
|
64
|
+
"class": "section",
|
|
65
|
+
"settings": [
|
|
66
|
+
{
|
|
67
|
+
"type": "text",
|
|
68
|
+
"id": "heading",
|
|
69
|
+
"label": "t:sections.<name>.settings.heading.label",
|
|
70
|
+
"default": "t:sections.<name>.settings.heading.default"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "checkbox",
|
|
74
|
+
"id": "show_section",
|
|
75
|
+
"label": "t:sections.<name>.settings.show_section.label",
|
|
76
|
+
"default": true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"type": "range",
|
|
80
|
+
"id": "padding_top",
|
|
81
|
+
"min": 0, "max": 100, "step": 4, "unit": "px", "default": 40,
|
|
82
|
+
"label": "t:sections.<name>.settings.padding_top.label"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"type": "range",
|
|
86
|
+
"id": "padding_bottom",
|
|
87
|
+
"min": 0, "max": 100, "step": 4, "unit": "px", "default": 40,
|
|
88
|
+
"label": "t:sections.<name>.settings.padding_bottom.label"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"blocks": [],
|
|
92
|
+
"presets": [
|
|
93
|
+
{ "name": "t:sections.<name>.presets.default.name" }
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
{% endschema %}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Rules
|
|
102
|
+
- Script tags → TOP of file
|
|
103
|
+
- Style block → after scripts, before assigns
|
|
104
|
+
- All assigns → in one `{% liquid %}` block at top
|
|
105
|
+
- Conditional visibility → wrap entire section if needed
|
|
106
|
+
- Schema → ALWAYS last, never in the middle
|
|
107
|
+
- Padding settings → ALWAYS included in every section
|
|
108
|
+
- Every loop → MUST have empty state
|
|
109
|
+
- Every heading/text → check `!= blank` before rendering
|