@thanhnguyxn/pixelcraft 0.0.0-stage → 0.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/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +11 -0
- package/LICENSE +21 -0
- package/README.md +407 -2
- package/assets/README.md +28 -0
- package/assets/pixelcraft-logo-512.png +0 -0
- package/bin/pixelcraft.mjs +444 -0
- package/docs/ARCHITECTURE.md +102 -0
- package/docs/DESIGN-RATIONALE.md +143 -0
- package/evals/README.md +27 -0
- package/evals/fixtures/README.md +36 -0
- package/evals/fixtures/direction-prototype-complexity.json +29 -0
- package/evals/fixtures/finish-gate-anti-slop.json +30 -0
- package/evals/fixtures/forms-accessibility-negative.json +29 -0
- package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
- package/evals/fixtures/plan-brownfield-evidence.json +28 -0
- package/evals/fixtures/visual-qa-task-evidence.json +29 -0
- package/evals/fixtures/workflow-checkpoints.json +30 -0
- package/evals/pixelcraft-accessibility.md +57 -0
- package/evals/pixelcraft-brandkit.md +58 -0
- package/evals/pixelcraft-chat-ui.md +55 -0
- package/evals/pixelcraft-constrained.md +55 -0
- package/evals/pixelcraft-craft.md +60 -0
- package/evals/pixelcraft-data-apps.md +55 -0
- package/evals/pixelcraft-dataviz.md +59 -0
- package/evals/pixelcraft-desktop.md +55 -0
- package/evals/pixelcraft-direction.md +60 -0
- package/evals/pixelcraft-document.md +55 -0
- package/evals/pixelcraft-email.md +55 -0
- package/evals/pixelcraft-extensions.md +55 -0
- package/evals/pixelcraft-game-ui.md +59 -0
- package/evals/pixelcraft-handoff.md +57 -0
- package/evals/pixelcraft-media.md +55 -0
- package/evals/pixelcraft-mobile.md +59 -0
- package/evals/pixelcraft-patterns.md +57 -0
- package/evals/pixelcraft-plan.md +65 -0
- package/evals/pixelcraft-review.md +63 -0
- package/evals/pixelcraft-spatial.md +55 -0
- package/evals/pixelcraft-tokens.md +57 -0
- package/evals/pixelcraft-tui.md +55 -0
- package/evals/pixelcraft-ux.md +59 -0
- package/evals/pixelcraft-visual-qa.md +80 -0
- package/evals/pixelcraft-web.md +71 -0
- package/evals/pixelcraft.md +70 -0
- package/gemini-extension.json +5 -0
- package/install.ps1 +295 -0
- package/install.sh +437 -0
- package/package.json +63 -4
- package/plugin.json +24 -0
- package/scripts/build-adapters.mjs +290 -0
- package/scripts/build-release-archives.mjs +61 -0
- package/scripts/build-skill-zips.mjs +94 -0
- package/scripts/test-build-adapters.mjs +48 -0
- package/scripts/test-distribution.mjs +124 -0
- package/scripts/test-export-tokens.mjs +105 -0
- package/scripts/test-finish-gate.mjs +148 -0
- package/scripts/test-installers.mjs +67 -0
- package/scripts/test-release-archives.mjs +42 -0
- package/scripts/test-shoot.mjs +65 -0
- package/scripts/test-slop-scan.mjs +29 -0
- package/scripts/test-style-inventory.mjs +211 -0
- package/scripts/test-validate-skills.mjs +117 -0
- package/scripts/validate-skills.mjs +512 -0
- package/skills/pixelcraft/SKILL.md +135 -0
- package/skills/pixelcraft/references/design-brief.md +75 -0
- package/skills/pixelcraft/references/floor.md +73 -0
- package/skills/pixelcraft/references/report-template.md +35 -0
- package/skills/pixelcraft/references/stack-detection.md +155 -0
- package/skills/pixelcraft/references/surface-acceptance.md +40 -0
- package/skills/pixelcraft/references/workflow-checkpoints.md +29 -0
- package/skills/pixelcraft-accessibility/SKILL.md +33 -0
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +51 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +58 -0
- package/skills/pixelcraft-accessibility/references/verification.md +59 -0
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +66 -0
- package/skills/pixelcraft-brandkit/SKILL.md +115 -0
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +125 -0
- package/skills/pixelcraft-brandkit/references/brand-governance.md +80 -0
- package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
- package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
- package/skills/pixelcraft-brandkit/references/logo-methods.md +98 -0
- package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
- package/skills/pixelcraft-brandkit/references/prompt-template.md +85 -0
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +88 -0
- package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
- package/skills/pixelcraft-chat-ui/SKILL.md +53 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +78 -0
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +87 -0
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +96 -0
- package/skills/pixelcraft-constrained/SKILL.md +51 -0
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +66 -0
- package/skills/pixelcraft-constrained/references/tv-wearables.md +84 -0
- package/skills/pixelcraft-constrained/references/voice-ui.md +63 -0
- package/skills/pixelcraft-craft/SKILL.md +44 -0
- package/skills/pixelcraft-craft/references/color.md +69 -0
- package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
- package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
- package/skills/pixelcraft-craft/references/layout.md +41 -0
- package/skills/pixelcraft-craft/references/motion.md +76 -0
- package/skills/pixelcraft-craft/references/typography.md +71 -0
- package/skills/pixelcraft-data-apps/SKILL.md +67 -0
- package/skills/pixelcraft-data-apps/references/dash.md +53 -0
- package/skills/pixelcraft-data-apps/references/evidence.md +75 -0
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -0
- package/skills/pixelcraft-data-apps/references/julia-genie.md +54 -0
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +53 -0
- package/skills/pixelcraft-data-apps/references/nicegui.md +63 -0
- package/skills/pixelcraft-data-apps/references/observable-framework.md +67 -0
- package/skills/pixelcraft-data-apps/references/panel.md +53 -0
- package/skills/pixelcraft-data-apps/references/r-shiny.md +54 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +62 -0
- package/skills/pixelcraft-data-apps/references/shiny.md +53 -0
- package/skills/pixelcraft-data-apps/references/streamlit.md +65 -0
- package/skills/pixelcraft-dataviz/SKILL.md +63 -0
- package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +97 -0
- package/skills/pixelcraft-dataviz/references/libraries.md +57 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +99 -0
- package/skills/pixelcraft-desktop/SKILL.md +71 -0
- package/skills/pixelcraft-desktop/references/appkit.md +58 -0
- package/skills/pixelcraft-desktop/references/avalonia.md +59 -0
- package/skills/pixelcraft-desktop/references/cpp-gui.md +52 -0
- package/skills/pixelcraft-desktop/references/electron.md +54 -0
- package/skills/pixelcraft-desktop/references/go-gui.md +54 -0
- package/skills/pixelcraft-desktop/references/gtk.md +54 -0
- package/skills/pixelcraft-desktop/references/javafx-swing.md +52 -0
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +61 -0
- package/skills/pixelcraft-desktop/references/rust-gui.md +65 -0
- package/skills/pixelcraft-desktop/references/tauri.md +54 -0
- package/skills/pixelcraft-desktop/references/uno-platform.md +52 -0
- package/skills/pixelcraft-desktop/references/winui-wpf.md +58 -0
- package/skills/pixelcraft-desktop/references/working-context.md +5 -0
- package/skills/pixelcraft-direction/SKILL.md +154 -0
- package/skills/pixelcraft-direction/references/composition-library.md +84 -0
- package/skills/pixelcraft-direction/references/direction-card.md +54 -0
- package/skills/pixelcraft-direction/references/direction-scoring.md +72 -0
- package/skills/pixelcraft-direction/references/movements.md +68 -0
- package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +58 -0
- package/skills/pixelcraft-direction/references/wildcards.md +47 -0
- package/skills/pixelcraft-document/SKILL.md +54 -0
- package/skills/pixelcraft-document/references/archetypes.md +83 -0
- package/skills/pixelcraft-document/references/pdf-tools.md +154 -0
- package/skills/pixelcraft-document/references/print-css.md +134 -0
- package/skills/pixelcraft-document/references/slides.md +102 -0
- package/skills/pixelcraft-email/SKILL.md +58 -0
- package/skills/pixelcraft-email/references/client-quirks.md +45 -0
- package/skills/pixelcraft-email/references/html-tables.md +53 -0
- package/skills/pixelcraft-email/references/mjml.md +52 -0
- package/skills/pixelcraft-email/references/react-email.md +53 -0
- package/skills/pixelcraft-extensions/SKILL.md +51 -0
- package/skills/pixelcraft-extensions/references/browser-extensions.md +31 -0
- package/skills/pixelcraft-extensions/references/figma-office.md +23 -0
- package/skills/pixelcraft-extensions/references/raycast.md +19 -0
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +26 -0
- package/skills/pixelcraft-game-ui/SKILL.md +61 -0
- package/skills/pixelcraft-game-ui/references/bevy.md +52 -0
- package/skills/pixelcraft-game-ui/references/godot.md +57 -0
- package/skills/pixelcraft-game-ui/references/hud-principles.md +38 -0
- package/skills/pixelcraft-game-ui/references/love2d.md +51 -0
- package/skills/pixelcraft-game-ui/references/monogame.md +52 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +65 -0
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -0
- package/skills/pixelcraft-handoff/SKILL.md +49 -0
- package/skills/pixelcraft-handoff/references/design-translation.md +104 -0
- package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
- package/skills/pixelcraft-media/SKILL.md +52 -0
- package/skills/pixelcraft-media/references/banners-video.md +112 -0
- package/skills/pixelcraft-media/references/og-generation.md +107 -0
- package/skills/pixelcraft-media/references/social-cards.md +72 -0
- package/skills/pixelcraft-mobile/SKILL.md +69 -0
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +63 -0
- package/skills/pixelcraft-mobile/references/flet.md +53 -0
- package/skills/pixelcraft-mobile/references/flutter.md +69 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +65 -0
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +61 -0
- package/skills/pixelcraft-mobile/references/kivy.md +59 -0
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +60 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +71 -0
- package/skills/pixelcraft-mobile/references/swiftui.md +70 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +5 -0
- package/skills/pixelcraft-mobile/references/uikit.md +58 -0
- package/skills/pixelcraft-patterns/SKILL.md +58 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +25 -0
- package/skills/pixelcraft-patterns/references/commerce.md +28 -0
- package/skills/pixelcraft-patterns/references/communication.md +26 -0
- package/skills/pixelcraft-patterns/references/creative-tools.md +29 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +31 -0
- package/skills/pixelcraft-patterns/references/marketing.md +32 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +74 -0
- package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
- package/skills/pixelcraft-patterns/references/settings.md +23 -0
- package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
- package/skills/pixelcraft-plan/SKILL.md +67 -0
- package/skills/pixelcraft-plan/references/design-input.md +69 -0
- package/skills/pixelcraft-plan/references/plan-template.md +99 -0
- package/skills/pixelcraft-plan/references/repo-discovery.md +42 -0
- package/skills/pixelcraft-plan/references/stack-freshness.md +50 -0
- package/skills/pixelcraft-plan/references/stack-selection.md +42 -0
- package/skills/pixelcraft-review/SKILL.md +64 -0
- package/skills/pixelcraft-review/references/audit-report.md +50 -0
- package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
- package/skills/pixelcraft-review/references/heuristics.md +18 -0
- package/skills/pixelcraft-review/references/personas.md +26 -0
- package/skills/pixelcraft-review/references/polish.md +38 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
- package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
- package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +586 -0
- package/skills/pixelcraft-spatial/SKILL.md +52 -0
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +98 -0
- package/skills/pixelcraft-spatial/references/platforms.md +77 -0
- package/skills/pixelcraft-tokens/SKILL.md +56 -0
- package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
- package/skills/pixelcraft-tokens/references/adoption.md +55 -0
- package/skills/pixelcraft-tokens/references/format.md +54 -0
- package/skills/pixelcraft-tokens/references/governance.md +80 -0
- package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
- package/skills/pixelcraft-tokens/references/theme-presets.md +94 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +285 -0
- package/skills/pixelcraft-tui/SKILL.md +60 -0
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +60 -0
- package/skills/pixelcraft-tui/references/ink.md +60 -0
- package/skills/pixelcraft-tui/references/ratatui.md +62 -0
- package/skills/pixelcraft-tui/references/rich.md +62 -0
- package/skills/pixelcraft-tui/references/textual.md +67 -0
- package/skills/pixelcraft-ux/SKILL.md +46 -0
- package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
- package/skills/pixelcraft-ux/references/feedback-performance.md +30 -0
- package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
- package/skills/pixelcraft-ux/references/forms.md +97 -0
- package/skills/pixelcraft-ux/references/i18n.md +183 -0
- package/skills/pixelcraft-ux/references/laws.md +18 -0
- package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
- package/skills/pixelcraft-ux/references/state-matrix.md +39 -0
- package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
- package/skills/pixelcraft-ux/references/ux-writing.md +43 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +82 -0
- package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +38 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +34 -0
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +35 -0
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +31 -0
- package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
- package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
- package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +65 -0
- package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +135 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +513 -0
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1154 -0
- package/skills/pixelcraft-web/SKILL.md +76 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +25 -0
- package/skills/pixelcraft-web/references/angular.md +61 -0
- package/skills/pixelcraft-web/references/astro.md +62 -0
- package/skills/pixelcraft-web/references/clojurescript.md +53 -0
- package/skills/pixelcraft-web/references/elm.md +53 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +53 -0
- package/skills/pixelcraft-web/references/html-css.md +88 -0
- package/skills/pixelcraft-web/references/htmx-alpine.md +53 -0
- package/skills/pixelcraft-web/references/java-web.md +52 -0
- package/skills/pixelcraft-web/references/kotlin-web.md +53 -0
- package/skills/pixelcraft-web/references/leptos-yew.md +54 -0
- package/skills/pixelcraft-web/references/lit-web-components.md +61 -0
- package/skills/pixelcraft-web/references/pwa.md +225 -0
- package/skills/pixelcraft-web/references/qwik.md +54 -0
- package/skills/pixelcraft-web/references/react-next.md +69 -0
- package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
- package/skills/pixelcraft-web/references/server-rendered.md +71 -0
- package/skills/pixelcraft-web/references/solid.md +60 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -0
- package/skills/pixelcraft-web/references/tailwind.md +73 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +62 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Svelte / SvelteKit
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Import generated CSS variables in the root layout or global stylesheet:
|
|
6
|
+
|
|
7
|
+
```svelte
|
|
8
|
+
<script>import '../tokens.css';</script>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use semantic variables inside component styles. Svelte scoped styles do not replace token architecture; use `:global()` only deliberately.
|
|
12
|
+
|
|
13
|
+
## Layout and responsive idioms
|
|
14
|
+
|
|
15
|
+
Use layouts for persistent shell/navigation and pages for route-specific content. CSS remains first-class: grid/flex/container queries/logical properties. Svelte stores should represent shared state, not layout constants. Component-level adaptation belongs close to the component through CSS/container queries where possible.
|
|
16
|
+
|
|
17
|
+
## Typography/custom fonts
|
|
18
|
+
|
|
19
|
+
Load fonts in `app.html`/root layout or font tooling with explicit fallbacks/subsets. Avoid hydrating text styling that causes font/layout jumps. Measure and hierarchy belong in CSS rather than ad hoc inline styles.
|
|
20
|
+
|
|
21
|
+
## Motion/reduced motion
|
|
22
|
+
|
|
23
|
+
Svelte transitions (`transition`, `in`, `out`, `animate`) are concise but still need purpose. Honor reduced motion by conditionally disabling or shortening transition parameters after checking `matchMedia`; do not animate list reordering when it destroys orientation.
|
|
24
|
+
|
|
25
|
+
## Accessibility specifics
|
|
26
|
+
|
|
27
|
+
Use real elements. Svelte warnings help but do not guarantee usable UX. Manage focus after navigation/dialog/state removal, label form controls, and preserve keyboard behavior. `{@html}` is dangerous for untrusted content and can bypass semantic/control expectations. Use `svelte:window` listeners with cleanup and SSR guards.
|
|
28
|
+
|
|
29
|
+
## States idiom
|
|
30
|
+
|
|
31
|
+
SvelteKit `load` return shape, `error`, `status`, stores, and form action results each represent different lifecycle state. Render loading/stale/empty/error explicitly. Progressive enhancement through `use:enhance` should preserve input, expose pending state, prevent duplicate submission, and handle rollback.
|
|
32
|
+
|
|
33
|
+
## Forms idiom
|
|
34
|
+
|
|
35
|
+
Svelte `bind:value` does not replace labels or validation timing. Native form actions plus `use:enhance` provide resilient baseline where suitable. Use correct `autocomplete`/`inputmode` attributes and preserve invalid input returned by server actions.
|
|
36
|
+
|
|
37
|
+
## Do/don't pairs
|
|
38
|
+
|
|
39
|
+
| Do | Don't |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `<a href="/invoice/42">View invoice</a>` | `<div on:click={() => goto('/invoice/42')}>View invoice</div>` |
|
|
42
|
+
| `<label for="batch">Batch</label><input id="batch" bind:value={batch}>` | `<input bind:value={batch} placeholder="Batch">` as only label |
|
|
43
|
+
| explicit `export function actions` error return shape | throwing raw exceptions as the only validation UX |
|
|
44
|
+
| small scoped store with explicit ownership | mutable module-global store leaking across users/routes |
|
|
45
|
+
| stable keyed `{#each items as item (item.id)}` | keyless list mutation causing focus/state reuse bugs |
|
|
46
|
+
|
|
47
|
+
## Known traps
|
|
48
|
+
|
|
49
|
+
SSR/browser divergence, store leakage, transition/layout shift, stale form data after invalid submission, keyed each-block focus reuse, `$:` legacy reactivity confusion in mixed codebases, accidental use of browser APIs during SSR, accessibility warnings treated as complete validation.
|
|
50
|
+
|
|
51
|
+
## Verification commands
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npm run check
|
|
55
|
+
npm run lint
|
|
56
|
+
npm run test -- --run
|
|
57
|
+
npm run build
|
|
58
|
+
npx playwright test
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use browser inspection for rendering/hydration evidence; `check` is static evidence only.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Tailwind as styling layer (v4)
|
|
2
|
+
|
|
3
|
+
Tailwind is an implementation layer, not the design direction. Treat utility classes as compiled expressions of semantic decisions—not a replacement for tokens, hierarchy, or component intent.
|
|
4
|
+
|
|
5
|
+
## Token mapping
|
|
6
|
+
|
|
7
|
+
These examples target v4. If the existing project uses v3, preserve its configuration and content discovery unless migration is in scope; verify the installed major before copying CSS directives.
|
|
8
|
+
|
|
9
|
+
Tailwind v4 is CSS-first. Import generated variables and bridge them into `@theme` only where utilities are needed:
|
|
10
|
+
|
|
11
|
+
```css
|
|
12
|
+
@import "tailwindcss";
|
|
13
|
+
@import "./tokens.css";
|
|
14
|
+
|
|
15
|
+
@theme {
|
|
16
|
+
--color-action: var(--semantic-color-action);
|
|
17
|
+
--color-surface: var(--semantic-color-background);
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Do not redefine a parallel raw palette in `@theme` when semantic variables already exist. Use custom variants/utilities sparingly through documented v4 CSS APIs.
|
|
22
|
+
|
|
23
|
+
## Layout and responsive idioms
|
|
24
|
+
|
|
25
|
+
Use grid/flex utilities to express actual composition. Responsive prefixes (`sm:`, `md:`…) should implement restructuring decisions, not hide the absence of one. Prefer logical utilities (`ms-`, `me-`, `ps-`, `pe-`, `start-`, `end-`) when available. Extract repeated semantic patterns only when reuse is real; premature component abstraction can be worse than legible utilities.
|
|
26
|
+
|
|
27
|
+
## Typography/custom fonts
|
|
28
|
+
|
|
29
|
+
Define font families/size/line-height roles in `@theme` or CSS. Avoid arbitrary values for every text size. Use measure utilities/custom CSS (`max-w-prose` where appropriate) deliberately and preserve fallback/subset behavior.
|
|
30
|
+
|
|
31
|
+
## Motion/reduced motion
|
|
32
|
+
|
|
33
|
+
Use Tailwind motion utilities only for purposeful properties; never `transition-all`. Tailwind provides motion-safe/motion-reduce variants—use them to supply meaningful alternatives:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<div class="transition-opacity motion-reduce:transition-none">
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Accessibility specifics
|
|
40
|
+
|
|
41
|
+
Tailwind does not create semantics. Use real HTML controls, visible `focus-visible` styles, screen-reader utility only for content that truly should be visually hidden, and adequate contrast. Do not use `sr-only` to hide labels that sighted users also need.
|
|
42
|
+
|
|
43
|
+
## States idiom
|
|
44
|
+
|
|
45
|
+
Use state variants intentionally: `hover:`, `focus-visible:`, `active:`, `disabled:`, `aria-*`, `data-*`, dark mode, forced-colors where configured. Every interactive element still needs loading/error/empty/disabled semantics beyond styling.
|
|
46
|
+
|
|
47
|
+
## Forms idiom
|
|
48
|
+
|
|
49
|
+
Utilities can accelerate layout but must not replace labels/input attributes. Preserve input sizing expansion, correct autocomplete/inputmode, error association, target size, and focus visibility. Ring utilities are a mechanism, not automatically an accessible focus design.
|
|
50
|
+
|
|
51
|
+
## Do/don't pairs
|
|
52
|
+
|
|
53
|
+
| Do | Don't |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `class="focus-visible:outline-2 focus-visible:outline-offset-2"` with visible semantic color | `class="outline-none"` with no replacement |
|
|
56
|
+
| `class="transition-opacity motion-reduce:transition-none"` | `class="transition-all duration-500"` on everything |
|
|
57
|
+
| semantic `@theme` bridge to tokens | copying raw brand hex into every utility class |
|
|
58
|
+
| `ms-4`/`pe-2` for direction-sensitive spacing | physical `ml-4`/`pr-2` by reflex in RTL-capable UI |
|
|
59
|
+
| intentional responsive restructuring `grid md:grid-cols-[2fr_1fr]` | stacking centered cards because mobile was never designed |
|
|
60
|
+
|
|
61
|
+
## Known traps
|
|
62
|
+
|
|
63
|
+
Utility verbosity hiding architecture, arbitrary-value sprawl, purple/blue gradient defaults, uniform `rounded-2xl shadow-xl`, duplicated class strings diverging, missing content scanning configuration, dark-mode inversion, tailwind config/CSS migration mismatch, visual sameness mistaken for system consistency.
|
|
64
|
+
|
|
65
|
+
## Verification commands
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm run lint
|
|
69
|
+
npm run build
|
|
70
|
+
npx playwright test
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Inspect computed CSS/rendering because utility presence alone does not prove the intended visual result.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Vue / Nuxt
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Import generated CSS variables globally or expose them through a typed theme/composable:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import '~/assets/tokens.css';
|
|
9
|
+
export const semantic = { action: 'var(--semantic-color-action)' };
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
In Nuxt, register global CSS in `nuxt.config` rather than importing it repeatedly in components.
|
|
13
|
+
|
|
14
|
+
## Layout and responsive idioms
|
|
15
|
+
|
|
16
|
+
Use single-file components to scope behavior, not to replace CSS architecture. Layouts in `layouts/` handle shell persistence; pages handle route content. Prefer CSS grid/flex/logical properties and composables only for genuinely reactive layout state. Avoid teleporting chrome without considering focus and server rendering.
|
|
17
|
+
|
|
18
|
+
## Typography/custom fonts
|
|
19
|
+
|
|
20
|
+
Put font loading in app/head configuration or module-supported font tooling. Use fallback stacks/subsets and verify SSR/client consistency. Reactive font classes are rarely necessary; semantic CSS roles are cheaper.
|
|
21
|
+
|
|
22
|
+
## Motion/reduced motion
|
|
23
|
+
|
|
24
|
+
Use Vue `<Transition>`/`<TransitionGroup>` for meaningful enter/leave state, with CSS classes honoring reduced motion. Query `useMediaQuery('(prefers-reduced-motion: reduce)')` or raw `matchMedia` for JS animation. Do not animate every list mutation by default.
|
|
25
|
+
|
|
26
|
+
## Accessibility specifics
|
|
27
|
+
|
|
28
|
+
Use native HTML inside components. `v-model` does not label inputs; explicit `label for`/`id` or wrapped labeling remains required. Manage focus after route changes, modal close, dynamic error insertion, and component removal. Nuxt Link preserves anchor semantics; do not replace navigation with bare click handlers.
|
|
29
|
+
|
|
30
|
+
## States idiom
|
|
31
|
+
|
|
32
|
+
Use `useAsyncData`/`useFetch` status/error/refresh deliberately: initial loading, refresh loading, stale data, empty result, server error, retry. Keep optimistic mutation rollback explicit. Suspense/island boundaries must preserve layout dimensions and screen-reader status behavior.
|
|
33
|
+
|
|
34
|
+
## Forms idiom
|
|
35
|
+
|
|
36
|
+
Use correct input attributes in templates; Vue attribute casing/hyphenation preserves native semantics. Validation libraries are optional—state timing and recovery matter more than schema existence. Preserve user input across failed submission and auth redirect.
|
|
37
|
+
|
|
38
|
+
## Do/don't pairs
|
|
39
|
+
|
|
40
|
+
| Do | Don't |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `<NuxtLink :to="`/invoice/${id}`">View invoice</NuxtLink>` | `<span @click="navigateTo(`/invoice/${id}`)">View invoice</span>` |
|
|
43
|
+
| `const { status, error, refresh } = await useFetch(...)` rendered distinctly | treating every non-success state as one spinner |
|
|
44
|
+
| `<label for="q">Search inventory</label><input id="q" v-model="q">` | `<input v-model="q" placeholder="Search inventory">` without label |
|
|
45
|
+
| `defineEmits`/`v-model` with explicit state ownership | hidden two-way mutation through deeply nested props |
|
|
46
|
+
| scoped component CSS plus global semantic tokens | global `*` resets or deep selectors that break child component internals |
|
|
47
|
+
|
|
48
|
+
## Known traps
|
|
49
|
+
|
|
50
|
+
SSR hydration mismatch from browser-only state, double-fetching client/server, teleport focus traps, transition layout shift, stale composable singleton state across requests, accidental shared state on server, shallow route param watching, auto-import magic hiding ownership.
|
|
51
|
+
|
|
52
|
+
## Verification commands
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm run lint
|
|
56
|
+
npm run test -- --run
|
|
57
|
+
npm run build
|
|
58
|
+
npx playwright test
|
|
59
|
+
npx nuxi analyze 2>/dev/null || true
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Browser rendering and keyboard/screen-reader inspection remain required for visual/a11y claims.
|