@thanhnguyxn/pixelcraft 0.1.0 → 0.2.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 +1 -1
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +15 -4
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/README.md +185 -328
- package/SECURITY.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/bin/pixelcraft.mjs +431 -23
- package/docs/ARCHITECTURE.md +40 -37
- package/docs/DESIGN-RATIONALE.md +51 -3
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +16 -6
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/pixelcraft-accessibility.md +17 -0
- package/evals/pixelcraft-craft.md +16 -0
- package/evals/pixelcraft-dataviz.md +3 -3
- package/evals/pixelcraft-direction.md +17 -0
- package/evals/pixelcraft-game-ui.md +3 -3
- package/evals/pixelcraft-mobile.md +3 -3
- package/evals/pixelcraft-patterns.md +16 -0
- package/evals/pixelcraft-plan.md +65 -3
- package/evals/pixelcraft-review.md +3 -3
- package/evals/pixelcraft-visual-qa.md +11 -5
- package/evals/pixelcraft-web.md +21 -3
- package/evals/pixelcraft.md +4 -4
- package/gemini-extension.json +3 -2
- package/install.ps1 +57 -11
- package/install.sh +82 -7
- package/package.json +32 -4
- package/plugin.json +6 -1
- package/scripts/build-adapters.mjs +11 -13
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +14 -1
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +86 -7
- package/scripts/test-export-tokens.mjs +259 -3
- package/scripts/test-finish-gate.mjs +133 -10
- package/scripts/test-installers.mjs +155 -6
- package/scripts/test-shoot.mjs +23 -1
- package/scripts/test-slop-scan.mjs +390 -3
- package/scripts/test-style-inventory.mjs +23 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +82 -4
- package/scripts/validate-skills.mjs +149 -3
- package/skills/pixelcraft/SKILL.md +67 -47
- package/skills/pixelcraft/references/design-brief.md +2 -2
- package/skills/pixelcraft/references/floor.md +36 -19
- package/skills/pixelcraft/references/report-template.md +25 -11
- package/skills/pixelcraft/references/stack-detection.md +138 -67
- package/skills/pixelcraft/references/surface-acceptance.md +33 -21
- package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
- package/skills/pixelcraft-accessibility/SKILL.md +34 -13
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
- package/skills/pixelcraft-accessibility/references/verification.md +15 -10
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
- package/skills/pixelcraft-brandkit/SKILL.md +42 -30
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
- package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
- package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
- package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
- package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
- package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
- package/skills/pixelcraft-constrained/SKILL.md +21 -20
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
- package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
- package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
- package/skills/pixelcraft-craft/SKILL.md +29 -15
- package/skills/pixelcraft-craft/references/color.md +62 -6
- package/skills/pixelcraft-craft/references/layout.md +32 -0
- package/skills/pixelcraft-craft/references/motion.md +99 -12
- package/skills/pixelcraft-craft/references/typography.md +48 -9
- package/skills/pixelcraft-data-apps/SKILL.md +50 -31
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +87 -31
- package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
- package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
- package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
- package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
- package/skills/pixelcraft-data-apps/references/panel.md +69 -23
- package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
- package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
- package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
- package/skills/pixelcraft-dataviz/SKILL.md +21 -24
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
- package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
- package/skills/pixelcraft-desktop/SKILL.md +61 -39
- package/skills/pixelcraft-desktop/references/appkit.md +60 -26
- package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
- package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
- package/skills/pixelcraft-desktop/references/electron.md +68 -26
- package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
- package/skills/pixelcraft-desktop/references/gtk.md +74 -31
- package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
- package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
- package/skills/pixelcraft-desktop/references/tauri.md +80 -24
- package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
- package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
- package/skills/pixelcraft-desktop/references/working-context.md +82 -3
- package/skills/pixelcraft-direction/SKILL.md +48 -82
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +11 -1
- package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +3 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
- package/skills/pixelcraft-document/SKILL.md +27 -23
- package/skills/pixelcraft-document/references/archetypes.md +27 -4
- package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +96 -43
- package/skills/pixelcraft-document/references/slides.md +123 -27
- package/skills/pixelcraft-email/SKILL.md +42 -20
- package/skills/pixelcraft-email/references/client-quirks.md +101 -33
- package/skills/pixelcraft-email/references/html-tables.md +83 -22
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +13 -11
- package/skills/pixelcraft-email/references/react-email.md +76 -34
- package/skills/pixelcraft-extensions/SKILL.md +32 -27
- package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
- package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +90 -11
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
- package/skills/pixelcraft-game-ui/SKILL.md +45 -26
- package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
- package/skills/pixelcraft-game-ui/references/godot.md +100 -27
- package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
- package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
- package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +14 -13
- package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +20 -23
- package/skills/pixelcraft-media/references/banners-video.md +83 -65
- package/skills/pixelcraft-media/references/og-generation.md +110 -63
- package/skills/pixelcraft-media/references/social-cards.md +57 -58
- package/skills/pixelcraft-mobile/SKILL.md +53 -36
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
- package/skills/pixelcraft-mobile/references/flet.md +53 -26
- package/skills/pixelcraft-mobile/references/flutter.md +76 -32
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
- package/skills/pixelcraft-mobile/references/kivy.md +54 -31
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
- package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
- package/skills/pixelcraft-mobile/references/uikit.md +57 -23
- package/skills/pixelcraft-patterns/SKILL.md +30 -13
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +35 -16
- package/skills/pixelcraft-patterns/references/communication.md +34 -15
- package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +31 -19
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/settings.md +40 -12
- package/skills/pixelcraft-plan/SKILL.md +54 -18
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +44 -9
- package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
- package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
- package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
- package/skills/pixelcraft-review/SKILL.md +41 -19
- package/skills/pixelcraft-review/references/audit-report.md +20 -1
- package/skills/pixelcraft-review/references/heuristics.md +63 -18
- package/skills/pixelcraft-review/references/personas.md +41 -14
- package/skills/pixelcraft-review/references/polish.md +66 -26
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
- package/skills/pixelcraft-spatial/SKILL.md +16 -17
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
- package/skills/pixelcraft-spatial/references/platforms.md +123 -53
- package/skills/pixelcraft-tokens/SKILL.md +18 -14
- package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
- package/skills/pixelcraft-tokens/references/format.md +39 -9
- package/skills/pixelcraft-tokens/references/governance.md +1 -1
- package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
- package/skills/pixelcraft-tui/SKILL.md +41 -25
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +77 -28
- package/skills/pixelcraft-tui/references/ratatui.md +70 -30
- package/skills/pixelcraft-tui/references/rich.md +53 -33
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +75 -34
- package/skills/pixelcraft-ux/SKILL.md +22 -12
- package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
- package/skills/pixelcraft-ux/references/forms.md +57 -3
- package/skills/pixelcraft-ux/references/i18n.md +50 -12
- package/skills/pixelcraft-ux/references/laws.md +35 -14
- package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
- package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
- package/skills/pixelcraft-web/SKILL.md +105 -49
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
- package/skills/pixelcraft-web/references/angular.md +63 -16
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +64 -13
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +52 -17
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +144 -12
- package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +27 -18
- package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
- package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
- package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +6 -1
- package/skills/pixelcraft-web/references/qwik.md +51 -11
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +112 -13
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +106 -63
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +67 -16
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -11
- package/skills/pixelcraft-web/references/tailwind.md +40 -14
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# GSAP implementation guide
|
|
2
|
+
|
|
3
|
+
Use GSAP when a timeline, coordinated sequence, SVG/plugin capability, or scroll choreography materially improves the interaction. It is not the default for every hover or state change.
|
|
4
|
+
|
|
5
|
+
## Ownership and setup
|
|
6
|
+
|
|
7
|
+
- Register only the plugins used by the affected route/component (`gsap.registerPlugin(...)`).
|
|
8
|
+
- **GSAP 3.13+ licensing**: starting with GSAP 3.13 (via Webflow), all formerly paid Club GSAP plugins (**SplitText, DrawSVGPlugin, MorphSVGPlugin, ScrollSmoother, Flip, Observer, InertiaPlugin, ScrambleTextPlugin, Physics2DPlugin**) are **100% free** for personal and commercial projects (subject to Webflow's standard no-competing-visual-builder clause). Still check `package.json` on older GSAP ≤ 3.12 codebases before assuming plugin availability.
|
|
9
|
+
- Keep one animation system as the owner of a given element/property. Avoid GSAP and Motion both writing `transform` on the same node.
|
|
10
|
+
- Scope selectors and timelines to the component root and revert all tweens, timelines, ScrollTriggers, and `matchMedia` listeners on teardown.
|
|
11
|
+
|
|
12
|
+
## Timeline and plugin matrix
|
|
13
|
+
|
|
14
|
+
Use labels for semantic beats such as `intro`, `reveal`, `detail`, `exit`. Keep timelines section-scoped rather than building one giant master timeline for an entire application.
|
|
15
|
+
|
|
16
|
+
| Tool | Use | Key idiom |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `gsap.timeline` | Ordered or overlapping sequence with labels and explicit ownership | Attach to a scoped `useGSAP` / `gsap.context` / `gsap.matchMedia` |
|
|
19
|
+
| `ScrollTrigger` | Progress-linked scenes, pinning, scrub, snap, enter/leave callbacks | Define `start`/`end` in content terms; call `ScrollTrigger.refresh()` only after layout-affecting media/fonts settle |
|
|
20
|
+
| `SplitText` (3.13+) | Short headline/editorial text reveals with semantic preservation | Use `SplitText.create(el, { type: 'lines,words', mask: 'lines', autoSplit: true, aria: 'auto', onSplit(self) { ... } })` so screen readers read intact text and resize/font-load re-splits automatically |
|
|
21
|
+
| `Flip` | Smooth layout transitions across DOM/grid/flex changes | `const state = Flip.getState(targets); mutateDOM(); Flip.from(state, { duration: 0.45, ease: 'power2.out', absolute: true });` |
|
|
22
|
+
| `Observer` | Unified wheel/touch/pointer intent gestures | Normalize swipe/drag steps without breaking native page scroll unless explicitly scoped |
|
|
23
|
+
| `gsap.quickTo` | High-frequency pointer/cursor/magnetic tracking | Pre-allocate `const xTo = gsap.quickTo(el, 'x', { duration: 0.25, ease: 'power3' })` once instead of spawning tweens on every `pointermove` |
|
|
24
|
+
| `DrawSVGPlugin` / `MorphSVGPlugin` / `MotionPathPlugin` | SVG stroke progress, shape morphs, and path-aligned motion | Always preserve a legible static SVG fallback and accessible `<title>`/`aria-label` |
|
|
25
|
+
| `gsap.matchMedia` | Responsive and `prefers-reduced-motion` animation variants | Pass `scope` (`gsap.matchMedia(rootRef)` or inside `useGSAP(..., { scope: rootRef })`) so selectors stay component-scoped |
|
|
26
|
+
|
|
27
|
+
## ScrollTrigger rules
|
|
28
|
+
|
|
29
|
+
- Use normal document flow and native scroll. Pin only when a persistent artifact needs chapter context.
|
|
30
|
+
- Test fast/reverse scroll, scrollbar drag, resize, short viewport height, and late-loading images/fonts.
|
|
31
|
+
- Avoid pinned nested scrollers and competing smooth-scroll engines (see [smooth-scroll.md](smooth-scroll.md) for Lenis / `ScrollSmoother` coordination).
|
|
32
|
+
- Do not make core content unreachable if ScrollTrigger fails or `prefers-reduced-motion: reduce` is enabled.
|
|
33
|
+
|
|
34
|
+
## Scoped lifecycle & React (`@gsap/react`)
|
|
35
|
+
|
|
36
|
+
**Scoping trap**: calling `const mm = gsap.matchMedia()` *outside* `gsap.context(..., rootRef)` creates an unscoped `matchMedia` context—selector strings like `'.chapter-item'` inside `mm.add(...)` will query the entire `document` and animate other component instances! Pass `rootRef` directly to `gsap.matchMedia(rootRef)` (vanilla/Vue/Svelte/Solid) or use **`useGSAP`** from `@gsap/react` (which scopes both `gsap` and `gsap.matchMedia()` automatically and reverts cleanly under React Strict Mode):
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
// React: @gsap/react useGSAP (auto-scoped + Strict Mode safe cleanup)
|
|
40
|
+
import { useRef } from 'react';
|
|
41
|
+
import gsap from 'gsap';
|
|
42
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
43
|
+
import { SplitText } from 'gsap/SplitText';
|
|
44
|
+
import { useGSAP } from '@gsap/react';
|
|
45
|
+
|
|
46
|
+
gsap.registerPlugin(ScrollTrigger, SplitText);
|
|
47
|
+
|
|
48
|
+
export function EditorialChapter() {
|
|
49
|
+
const rootRef = useRef<HTMLElement>(null);
|
|
50
|
+
|
|
51
|
+
useGSAP(
|
|
52
|
+
() => {
|
|
53
|
+
const mm = gsap.matchMedia();
|
|
54
|
+
mm.add('(prefers-reduced-motion: no-preference)', () => {
|
|
55
|
+
SplitText.create('.chapter-heading', {
|
|
56
|
+
type: 'lines',
|
|
57
|
+
mask: 'lines',
|
|
58
|
+
autoSplit: true,
|
|
59
|
+
aria: 'auto',
|
|
60
|
+
onSplit(self) {
|
|
61
|
+
return gsap.from(self.lines, {
|
|
62
|
+
yPercent: 100,
|
|
63
|
+
stagger: 0.08,
|
|
64
|
+
duration: 0.55,
|
|
65
|
+
ease: 'power3.out',
|
|
66
|
+
scrollTrigger: { trigger: rootRef.current, start: 'top 80%', once: true },
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
{ scope: rootRef },
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<section ref={rootRef}>
|
|
77
|
+
<h2 className="chapter-heading">Quarterly release notes</h2>
|
|
78
|
+
</section>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
// Framework-agnostic (Vue / Svelte / Solid / Astro / Vanilla): pass scope to matchMedia(rootEl)
|
|
85
|
+
const mm = gsap.matchMedia(rootEl);
|
|
86
|
+
mm.add('(prefers-reduced-motion: no-preference)', () => {
|
|
87
|
+
const xTo = gsap.quickTo('.magnet-target', 'x', { duration: 0.25, ease: 'power3.out' });
|
|
88
|
+
const onMove = (e: PointerEvent) => xTo(gsap.utils.clamp(-12, 12, e.movementX));
|
|
89
|
+
rootEl.addEventListener('pointermove', onMove);
|
|
90
|
+
return () => rootEl.removeEventListener('pointermove', onMove);
|
|
91
|
+
});
|
|
92
|
+
// Teardown: mm.revert();
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Official references
|
|
96
|
+
|
|
97
|
+
- GSAP docs: https://gsap.com/docs/v3/
|
|
98
|
+
- ScrollTrigger: https://gsap.com/docs/v3/Plugins/ScrollTrigger/
|
|
99
|
+
- SplitText: https://gsap.com/docs/v3/Plugins/SplitText/
|
|
100
|
+
- Flip: https://gsap.com/docs/v3/Plugins/Flip/
|
|
101
|
+
- Observer: https://gsap.com/docs/v3/Plugins/Observer/
|
|
102
|
+
- React guidance (`@gsap/react`): https://gsap.com/resources/React/
|
|
@@ -20,9 +20,33 @@ Use semantic HTML structure first, then CSS Grid for two-dimensional composition
|
|
|
20
20
|
|
|
21
21
|
For an editorial or commerce shell, separate the primary task or active state from the destination index. If inline navigation becomes a disclosure on touch, consider keeping booking, a cart count, or the current chapter exposed outside it. Keep the same destination and state across layouts. Test the closed and open menu at phone portrait and landscape: reach the primary action, dismiss the menu with the supported inputs, and confirm focus returns to its trigger. If the scene cannot fit in a shallow viewport, use a purposeful crop or a static composition instead of burying the action below empty scene space.
|
|
22
22
|
|
|
23
|
-
## Typography
|
|
23
|
+
## Typography, self-hosted WOFF2 & fallback metric matching
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Self-host subsetted variable or static `.woff2` files (`<= 2–3` font files total on the critical path; preload only primary above-the-fold faces with `<link rel="preload" as="font" type="font/woff2" crossorigin>`). Pair `font-display: swap` (or `optional` on fast repeat-visit apps) with explicit `@font-face` metric overrides on a local system fallback so glyph swap causes **zero CLS**:
|
|
26
|
+
|
|
27
|
+
```css
|
|
28
|
+
@font-face {
|
|
29
|
+
font-family: "Brand Sans";
|
|
30
|
+
src: url("/fonts/brand-sans-latin.woff2") format("woff2");
|
|
31
|
+
font-weight: 300 700;
|
|
32
|
+
font-display: swap;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: "Brand Sans Fallback";
|
|
37
|
+
src: local("Inter"), local("Segoe UI"), local("Arial");
|
|
38
|
+
size-adjust: 101.4%;
|
|
39
|
+
ascent-override: 96%;
|
|
40
|
+
descent-override: 24%;
|
|
41
|
+
line-gap-override: 0%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:root {
|
|
45
|
+
--font-sans: "Brand Sans", "Brand Sans Fallback", system-ui, sans-serif;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Control reading measure with `max-inline-size: 65ch`–`75ch` rather than arbitrary wide containers.
|
|
26
50
|
|
|
27
51
|
## Motion/reduced motion
|
|
28
52
|
|
|
@@ -40,22 +64,126 @@ If a static poster replaces a decorative scene, make that decision before starti
|
|
|
40
64
|
|
|
41
65
|
## Modern browser-native craft idioms
|
|
42
66
|
|
|
43
|
-
Use progressive, zero-dependency CSS capabilities before importing JS animation or
|
|
67
|
+
Use progressive, zero-dependency CSS and HTML capabilities before importing JS animation or positioning libraries:
|
|
44
68
|
|
|
45
|
-
- **
|
|
69
|
+
- **Top-layer overlays (`[popover]` + `<dialog>`) with CSS Anchor Positioning**: let the browser manage top-layer stacking, light-dismiss (`<dialog closedby="any">`), and flip fallbacks instead of manual `z-index` ladders or JS positioning engines. Always reset `margin: 0` on anchored popovers because the UA stylesheet defaults `[popover]` to `margin: auto`, which centers it in the viewport and overrides anchor placement.
|
|
70
|
+
- **Invoker Commands (`commandfor` / `command`)**: open/close dialogs (`command="show-modal"`, `command="close"`) and toggle popovers declaratively from `<button commandfor="filters-dialog" command="show-modal">` without glue JS (fall back to `popovertarget` or a small click listener where older browsers are in scope).
|
|
71
|
+
- **Customizable `<select>`**: opt into `appearance: base-select` on `select` and `::picker(select)` when styled dropdowns need native keyboard navigation, form participation, and top-layer placement without building a custom ARIA listbox from scratch.
|
|
72
|
+
- **Exclusive accordions**: group native `<details name="faq-group">` elements so opening one closes siblings with zero JavaScript.
|
|
73
|
+
- **Discrete & intrinsic-size transitions**: combine `@starting-style` and `transition-behavior: allow-discrete` for `<dialog>`/`[popover]`, and use `interpolate-size: allow-keywords` or `calc-size(auto, size)` for smooth `height: 0` → `auto` disclosure reveals (gated behind reduced-motion checks).
|
|
46
74
|
- **Scroll-driven progress**: gate `animation-timeline: view()` / `scroll()` behind both `@supports (animation-timeline: view())` and `@media (prefers-reduced-motion: no-preference)`; keep the final layout readable without animation.
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
75
|
+
- **Scoped cascade & self-adapting slots**: organize resets/tokens/components/utilities with `@layer`, isolate subtree styling with `@scope (.card) to (.card-slot)`, use `container-type: inline-size` with `@container` queries, `:has()` for parent state styling, and `field-sizing: content` for auto-growing inputs/textareas.
|
|
76
|
+
- **Perceptual color & theme derivation**: use `light-dark(var(--light), var(--dark))` with `color-scheme: light dark`, `color-mix(in oklch, ...)` for state mixes, and relative color syntax (`oklch(from var(--semantic-color-action) calc(l - 0.08) c h)`) for predictable hover/active ramps.
|
|
77
|
+
- **Typographic rag & viewport stability**: apply `text-wrap: balance` on short headings, `text-wrap: pretty` on body copy, `svh`/`dvh` instead of `100vh` on mobile, and `scrollbar-gutter: stable` on scrolling regions.
|
|
78
|
+
- **Native navigation & prefetching**: prefer the **Navigation API** (`window.navigation`) over fragile `history.pushState`/`popstate` wrappers in modern SPA routers, and use `<script type="speculationrules">` (`prefetch`/`prerender` with `eagerness: "moderate"`) for near-instant MPA navigations instead of speculative JS fetches.
|
|
79
|
+
|
|
80
|
+
```css
|
|
81
|
+
/* Cascade layering and semantic light/dark derivation */
|
|
82
|
+
@layer reset, tokens, base, components, utilities;
|
|
83
|
+
|
|
84
|
+
@layer tokens {
|
|
85
|
+
:root {
|
|
86
|
+
color-scheme: light dark;
|
|
87
|
+
--surface-raised: light-dark(oklch(99% 0.005 260), oklch(22% 0.01 260));
|
|
88
|
+
--action-hover: oklch(from var(--semantic-color-action) calc(l - 0.07) c h);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Native anchored popover with margin: 0 reset and discrete entry/exit transition */
|
|
93
|
+
.menu-trigger { anchor-name: --menu-btn; }
|
|
94
|
+
|
|
95
|
+
.menu-panel[popover] {
|
|
96
|
+
margin: 0;
|
|
97
|
+
position-anchor: --menu-btn;
|
|
98
|
+
position-area: block-end span-inline-end;
|
|
99
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
100
|
+
opacity: 0;
|
|
101
|
+
translate: 0 -4px;
|
|
102
|
+
scale: 0.98;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
106
|
+
.menu-panel[popover] {
|
|
107
|
+
transition:
|
|
108
|
+
opacity 150ms ease-out,
|
|
109
|
+
translate 150ms ease-out,
|
|
110
|
+
scale 150ms ease-out,
|
|
111
|
+
display 150ms ease-out allow-discrete,
|
|
112
|
+
overlay 150ms ease-out allow-discrete;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.menu-panel[popover]:popover-open {
|
|
117
|
+
opacity: 1;
|
|
118
|
+
translate: 0 0;
|
|
119
|
+
scale: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@starting-style {
|
|
123
|
+
.menu-panel[popover]:popover-open {
|
|
124
|
+
opacity: 0;
|
|
125
|
+
translate: 0 -4px;
|
|
126
|
+
scale: 0.98;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Customizable native <select> (progressive enhancement) */
|
|
131
|
+
@supports (appearance: base-select) {
|
|
132
|
+
select.styled-select,
|
|
133
|
+
select.styled-select::picker(select) {
|
|
134
|
+
appearance: base-select;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Container-driven card adaptation and @scope isolation */
|
|
139
|
+
.card-slot { container-type: inline-size; }
|
|
140
|
+
@scope (.card) to (.card-slot) {
|
|
141
|
+
@container (inline-size >= 28rem) {
|
|
142
|
+
:scope { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1rem; }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Accessibility, skip links & cascade discipline
|
|
50
148
|
|
|
51
|
-
|
|
149
|
+
Native elements carry most semantics: `button`, `a`, `form`, `label`, `input`, `select`, `table`, headings, landmarks. Do not use positive `tabindex`; use DOM order. Use `<dialog>`/`[popover]`/`inert` patterns carefully and restore focus. Validate names/roles/status behavior in the accessibility tree.
|
|
52
150
|
|
|
53
|
-
|
|
151
|
+
- **Mandatory `Skip to main content` link**: render `<a class="skip-link" href="#main-content">Skip to main content</a>` as the very first focusable element inside `<body>`, visually clipped off-screen until `:focus-visible`, jumping directly to `<main id="main-content" tabindex="-1">` so keyboard and switch users bypass repetitive headers (WCAG 2.4.1).
|
|
152
|
+
- **Zero `!important` cascade sprawl**: govern specificity with an explicit `@layer reset, tokens, base, components, utilities;` declaration order and semantic tokens—never patch component rules with ad-hoc `!important` overrides.
|
|
54
153
|
|
|
55
|
-
|
|
154
|
+
```css
|
|
155
|
+
.skip-link {
|
|
156
|
+
position: fixed;
|
|
157
|
+
inset-block-start: 0.75rem;
|
|
158
|
+
inset-inline-start: 0.75rem;
|
|
159
|
+
z-index: 9999;
|
|
160
|
+
padding: 0.625rem 1rem;
|
|
161
|
+
background: var(--semantic-color-background);
|
|
162
|
+
color: var(--semantic-color-foreground);
|
|
163
|
+
border: 2px solid var(--semantic-color-action);
|
|
164
|
+
translate: 0 -200%;
|
|
165
|
+
}
|
|
166
|
+
.skip-link:focus-visible { translate: 0 0; }
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## States, custom `404` / `500` recovery routes & `@media print`
|
|
56
170
|
|
|
57
171
|
Use real elements/classes and server/client state consistently: `hidden`, `disabled`, `aria-disabled` only when focus must remain, `role="status"` for nonintrusive async completion, skeleton containers with stable dimensions, and explicit empty/error markup rather than blank containers.
|
|
58
172
|
|
|
173
|
+
- **Custom branded `404` & `500` recovery surfaces**: never leave default framework/CDN error screens in production. Ship a branded `404` route (states what is missing, preserves site search / top category links, and offers a clear primary return CTA with HTTP `404` status) and a zero-dependency static-safe `500` route / root error boundary (shows human recovery copy, retry button, support contact, and copyable request/correlation ID without relying on the broken API).
|
|
174
|
+
- **Print stylesheet (`@media print`)**: provide clean print styling for articles, documentation, invoices, order receipts, and booking confirmations—hide navbars, footers, sticky toolbars, cookie banners, and chat launchers; force high-contrast black ink on white paper even if the user is in dark mode; expand scroll containers; and prevent page-break slicing across tables, receipts, and code blocks:
|
|
175
|
+
|
|
176
|
+
```css
|
|
177
|
+
@media print {
|
|
178
|
+
@page { margin: 15mm; }
|
|
179
|
+
:root, body { background: #fff; color: #000; color-scheme: light; }
|
|
180
|
+
header, nav, footer, aside, .skip-link, [data-print-hidden], dialog, [popover] { display: none; }
|
|
181
|
+
main { max-inline-size: none; padding: 0; overflow: visible; }
|
|
182
|
+
table, figure, pre, blockquote, .invoice-summary { break-inside: avoid; }
|
|
183
|
+
h1, h2, h3 { break-after: avoid; }
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
59
187
|
## Forms idiom
|
|
60
188
|
|
|
61
189
|
Use one persistent `label`, correct `type`, `inputmode`, `autocomplete`, spellcheck/autocapitalize settings, constraint validation only where appropriate, and server error association through text near the field plus summary for complex forms. Never block paste.
|
|
@@ -65,14 +193,18 @@ Use one persistent `label`, correct `type`, `inputmode`, `autocomplete`, spellch
|
|
|
65
193
|
| Do | Don't |
|
|
66
194
|
|---|---|
|
|
67
195
|
| `<button type="button">Save draft</button>` | `<div onclick="save()">Save draft</div>` |
|
|
196
|
+
| Render `<a class="skip-link" href="#main-content">` first in `<body>` and order CSS via `@layer` | Force keyboard users through 25 nav links or fight specificity with `!important` |
|
|
197
|
+
| Self-host `<= 2–3` subsetted `.woff2` files with `@font-face` `size-adjust` / `ascent-override` | Load 6 unsubsetted Google Font weights that shift layout on swap |
|
|
198
|
+
| Ship branded `404`/`500` recovery routes and `@media print` rules for receipts/articles/docs | Leave raw stack traces/framework `404`s or print dark-mode navbars over invoices |
|
|
68
199
|
| `margin-inline-start: var(--space-4);` | `margin-left: var(--space-4);` for direction-neutral layout |
|
|
69
|
-
| `@media (prefers-reduced-motion:
|
|
200
|
+
| Gate decorative/parallax motion inside `@media (prefers-reduced-motion: no-preference)` while keeping subtle functional opacity/progress feedback | Global `* { animation: none !important; transition: none !important; }` that kills progress spinners, focus feedback, and state transitions |
|
|
201
|
+
| Reset `margin: 0` on anchored `[popover]` panels using `position-anchor` | Omit `margin: 0` and let UA `margin: auto` recenter the popover off its anchor |
|
|
70
202
|
| `<label for="email">Email</label><input id="email" autocomplete="email">` | `<input placeholder="Email">` as the only label |
|
|
71
203
|
| `grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem);` | fixed pixel columns that overflow/clip localized content |
|
|
72
204
|
|
|
73
205
|
## Known traps
|
|
74
206
|
|
|
75
|
-
`100vh` on mobile browsers, sticky/fixed chrome obscuring focus,
|
|
207
|
+
`100vh` on mobile browsers, missing `margin: 0` on anchored `[popover]`, sticky/fixed chrome obscuring focus, unguarded `appearance: base-select` without checking older browser fallback, specificity wars solved better by `@layer`, missing `Skip to main content` link, broken dark-mode printouts, autofocus as a substitute for flow design, duplicated IDs from reused fragments, logical/physical mismatch in charts and media controls.
|
|
76
208
|
|
|
77
209
|
## Verification commands
|
|
78
210
|
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
# htmx
|
|
1
|
+
# Hypermedia & lightweight enhancement: htmx 2, Alpine.js, Datastar, Unpoly
|
|
2
|
+
|
|
3
|
+
## Choosing the hypermedia layer
|
|
4
|
+
|
|
5
|
+
| Tool | Primary model | Strengths | Watch-outs |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| **htmx 2.x** | HTML attributes driving HTTP partial swaps (`hx-get`/`hx-post`/`hx-swap`) | Tiny footprint, works with any server stack, progressive enhancement via `hx-boost` | Requires explicit focus/ID hygiene and extension packages for SSE/WS/morphing |
|
|
8
|
+
| **Alpine.js** | Declarative local client state (`x-data`, `x-show`, `x-transition`) | Ideal companion for menus, disclosures, tabs, and optimistic local UI | Default build uses `Function()` (needs `@alpinejs/csp` under strict CSP) |
|
|
9
|
+
| **Datastar** | SSE-driven hypermedia + fine-grained reactive client signals (`data-signals`, `data-on-click`) | Unified server-pushed DOM morphing (SSE `datastar-patch-elements`) + reactive signals (~15 KB) with no second client library | Requires SSE-capable server handlers and clear separation of server-authoritative vs client signals |
|
|
10
|
+
| **Unpoly** | Progressive multi-layer HTML navigation (modals/drawers/popups, preloading, compilers) | Built-in history, focus, layer stacks, and form validation conventions out of the box | Opinionated conventions (`up-target`, `up-layer`); heavier than bare htmx |
|
|
2
11
|
|
|
3
12
|
## Token mapping
|
|
4
13
|
|
|
5
|
-
Import generated CSS variables in the base template. Because
|
|
14
|
+
Import generated CSS variables in the base template. Because hypermedia tools swap server-generated fragments, semantic CSS must apply consistently to both full pages and partial responses. Client state (`x-data` / `data-signals`) should toggle semantic classes or `data-*` attributes rather than embedding ad hoc hex/style values.
|
|
6
15
|
|
|
7
16
|
## Layout and responsive idioms
|
|
8
17
|
|
|
9
|
-
Server-driven hypermedia is a feature: design coherent full pages first, then partial enhancement. Use CSS for layout.
|
|
18
|
+
Server-driven hypermedia is a feature: design coherent full pages first, then partial enhancement. Use CSS for layout. Targets and swaps must preserve shell structure, scroll behavior, focus, headings, and meaningful URLs (`hx-push-url="true"` / Unpoly history) where appropriate. Alpine belongs to local interaction state, not accidental SPA architecture.
|
|
10
19
|
|
|
11
20
|
## Typography/custom fonts
|
|
12
21
|
|
|
@@ -14,33 +23,74 @@ Load fonts once in the base template. Partial responses inherit them; do not inj
|
|
|
14
23
|
|
|
15
24
|
## Motion/reduced motion
|
|
16
25
|
|
|
17
|
-
Use CSS transitions/classes for swap/settle states. htmx transition
|
|
26
|
+
Use CSS transitions/classes for swap/settle states. In **htmx 2**, `hx-swap="innerHTML transition:true"` opts into the View Transitions API—gate view-transition animations behind `@media (prefers-reduced-motion: no-preference)`. Alpine `x-transition` must also respect reduced motion. Avoid animating replacement in a way that hides content reordering or focus jumps.
|
|
18
27
|
|
|
19
28
|
## Accessibility specifics
|
|
20
29
|
|
|
21
|
-
Fragments must contain valid, complete semantics in context: labels, headings, buttons/links, live regions where needed. Manage focus after `hx-swap`, especially when replacing the triggering element. Use `hx-
|
|
22
|
-
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
Fragments must contain valid, complete semantics in context: labels, headings, buttons/links, and live regions where needed. Manage focus after `hx-swap`, especially when replacing the triggering element. Use **Idiomorph** (`hx-ext="morph" hx-swap="morph:outerHTML"`) or **`@alpinejs/morph`** when updating active regions so text-input focus, scroll position, and `<video>` playback survive server updates. Alpine `x-cloak` avoids flash-of-uninitialized behavior but must not hide essential content if JS fails.
|
|
31
|
+
|
|
32
|
+
## htmx 2.x, Alpine plugins, Datastar, and Unpoly idioms
|
|
33
|
+
|
|
34
|
+
- **htmx 2.x specifics**:
|
|
35
|
+
- Use **`hx-on:*`** (e.g., `hx-on::after-request="if(event.detail.successful) this.reset()"`) instead of legacy v1 `hx-on` syntax.
|
|
36
|
+
- Install standalone extension packages (**`htmx-ext-sse`**, **`htmx-ext-ws`**, **`idiomorph`**) rather than assuming v1 built-in extensions.
|
|
37
|
+
- Prevent duplicate form/button mutations with **`hx-disabled-elt="this"`** (or `hx-disabled-elt="find button[type='submit']"`) alongside a visible `htmx-indicator`.
|
|
38
|
+
- Use **`hx-swap="morph"`** (via Idiomorph) when re-rendering forms/lists where preserving DOM identity and focus matters.
|
|
39
|
+
- **Alpine.js official plugins**:
|
|
40
|
+
- **`@alpinejs/csp`**: required when your Content-Security-Policy forbids `'unsafe-eval'`; register component methods via `Alpine.data(...)` instead of inline JS expressions.
|
|
41
|
+
- **`@alpinejs/focus`**: apply `x-trap.inert.noscroll="open"` on modal dialogs to trap focus and mark background siblings `inert`.
|
|
42
|
+
- **`@alpinejs/anchor`**: anchor popovers/dropdowns to triggers when CSS Anchor Positioning browser coverage is insufficient.
|
|
43
|
+
- **`@alpinejs/morph`**: morph server HTML into Alpine trees without resetting child `x-data` state.
|
|
44
|
+
- **Datastar**: bind reactive UI state with `data-signals` and stream DOM patches over SSE (`@get('/events')`) so server-driven updates morph cleanly into place while keeping client-only micro-interactions (toggles, computed previews) instant.
|
|
45
|
+
- **Unpoly**: lean on `up-layer="new modal"` / `up-dismissable` for accessible server-rendered dialogs and `up-preload` for fast MPA links, keeping fallback routes valid as standalone pages.
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<!-- htmx 2: duplicate-submit lock, Idiomorph focus-safe swap, hx-on:* cleanup -->
|
|
49
|
+
<form
|
|
50
|
+
action="/invoices"
|
|
51
|
+
method="post"
|
|
52
|
+
hx-post="/invoices"
|
|
53
|
+
hx-target="#invoice-section"
|
|
54
|
+
hx-swap="morph:outerHTML transition:true"
|
|
55
|
+
hx-disabled-elt="find button[type='submit']"
|
|
56
|
+
hx-on::after-request="if(event.detail.successful) this.reset()"
|
|
57
|
+
>
|
|
58
|
+
<label for="inv-title">Title</label>
|
|
59
|
+
<input id="inv-title" name="title" required autocomplete="off">
|
|
60
|
+
<button type="submit">
|
|
61
|
+
Save invoice
|
|
62
|
+
<span class="htmx-indicator" aria-hidden="true">…</span>
|
|
63
|
+
</button>
|
|
64
|
+
</form>
|
|
65
|
+
|
|
66
|
+
<!-- Alpine + @alpinejs/focus modal dialog -->
|
|
67
|
+
<div x-data="{ open: false }" @keydown.escape.window="open = false">
|
|
68
|
+
<button type="button" @click="open = true">Filter</button>
|
|
69
|
+
<div x-show="open" x-trap.inert.noscroll="open" role="dialog" aria-modal="true" aria-labelledby="filter-heading">
|
|
70
|
+
<h2 id="filter-heading">Filter invoices</h2>
|
|
71
|
+
<button type="button" @click="open = false">Close</button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
```
|
|
26
75
|
|
|
27
|
-
## Forms idiom
|
|
76
|
+
## States & Forms idiom
|
|
28
77
|
|
|
29
|
-
|
|
78
|
+
Return real HTML error/empty/partial fragments from the server—not bare 422 JSON with a generic toast. Configure htmx `responseHandling` (v2) or return swap-enabled 422 error fragments so validation errors render adjacent to inputs while preserving submitted values. Out-of-band swaps (`hx-swap-oob`) need clear ID ownership and zero duplicated IDs.
|
|
30
79
|
|
|
31
80
|
## Do/don't pairs
|
|
32
81
|
|
|
33
82
|
| Do | Don't |
|
|
34
83
|
|---|---|
|
|
35
|
-
| `<a href="/invoices" hx-boost>Invoices</a>` | `<span hx-get="/invoices">Invoices</span>` pretending to be navigation |
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
84
|
+
| `<a href="/invoices" hx-boost="true">Invoices</a>` | `<span hx-get="/invoices">Invoices</span>` pretending to be navigation |
|
|
85
|
+
| `hx-disabled-elt="this"` + visible `htmx-indicator` | Silent background mutation allowing rapid duplicate POSTs |
|
|
86
|
+
| `hx-swap="morph"` (Idiomorph) when preserving focus/form inputs | Blind `outerHTML` swap over an active input that drops keyboard focus |
|
|
87
|
+
| `@alpinejs/csp` + `Alpine.data(...)` under strict CSP headers | Relaxing CSP with `'unsafe-eval'` just to keep inline Alpine expressions |
|
|
88
|
+
| `@alpinejs/focus` `x-trap.inert.noscroll` or native `<dialog>` | Unmanaged `x-show` modal that lets Tab escape into the page behind it |
|
|
89
|
+
| Render validation fragment with preserved values and adjacent errors | Returning only `422` with a disappearing toast or clearing the form |
|
|
40
90
|
|
|
41
91
|
## Known traps
|
|
42
92
|
|
|
43
|
-
|
|
93
|
+
Forgetting that htmx 2 ignores 4xx/5xx swaps unless configured (`responseHandling` / 422 swap rule), missing separate `htmx-ext-sse`/`htmx-ext-ws`/`idiomorph` packages in htmx 2, invalid nested HTML after swaps, focus disappearing with replaced triggers, duplicated IDs across OOB swaps, Alpine CSP errors without `@alpinejs/csp`, breaking the no-JS baseline.
|
|
44
94
|
|
|
45
95
|
## Verification commands
|
|
46
96
|
|
|
@@ -50,4 +100,4 @@ Run the owning server framework's test suite and browser E2E suite without suppr
|
|
|
50
100
|
npm test && npx playwright test
|
|
51
101
|
```
|
|
52
102
|
|
|
53
|
-
Test both no-JS/full-page behavior and enhanced fragment behavior;
|
|
103
|
+
Test both no-JS/full-page behavior and enhanced fragment/SSE behavior in a real browser (`rendered`); both are separate evidence.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Internationalization and localization engineering
|
|
2
|
+
|
|
3
|
+
Internationalization is not string replacement. Ship locale-aware formatting (`Intl`), ICU plurals/selects, lazy-loaded translation chunks, explicit fallback chains, locale routing, RTL layout mirroring, and script-appropriate font fallback. For UX copy expansion, pseudo-localization, and RTL layout checks, see `pixelcraft-ux`.
|
|
4
|
+
|
|
5
|
+
## Library decision matrix
|
|
6
|
+
|
|
7
|
+
| Library | Model | Message format | Best fit | Primary trade-off |
|
|
8
|
+
|---|---|---|---|---|
|
|
9
|
+
| **`next-intl`** | Next.js App Router native RSC + client (`getTranslations`/`useTranslations`) + typed locale routing | **ICU MessageFormat** | Next.js App Router apps needing static/dynamic RSC i18n, locale prefix routing, and minimal client payload | Next.js-specific; avoid passing entire message catalogs into `<NextIntlClientProvider>` |
|
|
10
|
+
| **i18next** (`react-i18next`) | Runtime key/namespace lookup + backend plugins | i18next JSON (`_one`/`_other` CLDR) or ICU plugin | Multi-framework apps, CMS/TMS-driven runtime loading, React Native | Requires explicit `fallbackLng` (defaults to `false` in v27+) and `intl-pluralrules` polyfill on Hermes |
|
|
11
|
+
| **FormatJS / React Intl** | Runtime / pre-compiled AST | Standard **ICU MessageFormat** | Enterprise React apps needing strict ICU plurals, selects, and `Intl` skeletons | Larger runtime unless pre-compiling ASTs at build time |
|
|
12
|
+
| **Lingui** (v5+) | Compile-time macros + compiled `.po`/JSON catalogs | **ICU MessageFormat** (via macros) | React/RSC/Vite/Next.js apps wanting tiny runtime + clean source-text IDs | Requires Babel/SWC macro plugin + `lingui extract` / `lingui compile` pipeline |
|
|
13
|
+
| **Paraglide JS** | Compiler-first ESM functions | Compiled JS functions (`m.greeting(...)`) | Vite, SvelteKit, Astro, React Router apps prioritizing tree-shaking & type safety | Rebuild/compile step when messages change; best for static/build-time catalogs |
|
|
14
|
+
| **Vue I18n** (v11) | Framework-native Composition API (`legacy: false`) | Vue I18n / linked messages + `Intl` formats | Vue 3 / Nuxt (`@nuxtjs/i18n`) apps | Must set `legacy: false` for Composition API `useI18n()` |
|
|
15
|
+
| **Angular `@angular/localize`** | Compile-time AOT bundle-per-locale | XLIFF / JSON + ICU | Angular apps prioritizing zero runtime translation overhead | Switching locale reloads the app to the target locale bundle |
|
|
16
|
+
|
|
17
|
+
## Implementation idioms
|
|
18
|
+
|
|
19
|
+
### `next-intl` (Next.js App Router)
|
|
20
|
+
|
|
21
|
+
- Keep translations on the server via `await getTranslations('Checkout')` in Server Components (zero translation bytes sent to client). When Client Components need strings, pass only the specific namespace subset into `<NextIntlClientProvider messages={pick(messages, ['Checkout'])}>` and configure `defineRouting` + `createNavigation` for locale-prefixed `<Link>` / `redirect`.
|
|
22
|
+
|
|
23
|
+
### i18next (namespaces, lazy loading, fallback chains)
|
|
24
|
+
|
|
25
|
+
- Split translations by route/feature namespace and lazy-load via `i18next-resources-to-backend` or `i18next-http-backend` so the initial bundle does not ship every locale.
|
|
26
|
+
- Always configure `fallbackLng` explicitly (including regional/script fallbacks like `'zh-Hant': ['zh-Hans', 'en']`). Since i18next v24, pluralization depends on `Intl.PluralRules` with no legacy fallback; polyfill `import 'intl-pluralrules'` on runtimes lacking it (such as React Native Hermes).
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import i18next from 'i18next';
|
|
30
|
+
import resourcesToBackend from 'i18next-resources-to-backend';
|
|
31
|
+
|
|
32
|
+
i18next
|
|
33
|
+
.use(resourcesToBackend((lng: string, ns: string) => import(`./locales/${lng}/${ns}.json`)))
|
|
34
|
+
.init({
|
|
35
|
+
fallbackLng: {
|
|
36
|
+
'zh-Hant': ['zh-Hans', 'en'],
|
|
37
|
+
default: ['en'],
|
|
38
|
+
},
|
|
39
|
+
ns: ['common'],
|
|
40
|
+
defaultNS: 'common',
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### FormatJS / React Intl (ICU MessageFormat & `Intl` skeletons)
|
|
45
|
+
|
|
46
|
+
- Always include the required `other` branch in ICU `{plural}` and `{select}` expressions (omitting `other` throws at runtime).
|
|
47
|
+
- Let the formatter own currency symbols, decimal separators, and placement (`::currency/USD` or `intl.formatNumber`)—never concatenate `$` or `%` in template strings.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
intl.formatMessage(
|
|
51
|
+
{
|
|
52
|
+
id: 'cart.summary',
|
|
53
|
+
defaultMessage:
|
|
54
|
+
'{count, plural, one {# item} other {# items}} — total {total, number, ::currency/USD}',
|
|
55
|
+
},
|
|
56
|
+
{ count, total },
|
|
57
|
+
);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Lingui v5+ (macros, lazy catalogs, RSC)
|
|
61
|
+
|
|
62
|
+
- Import macros from `@lingui/core/macro` (`t`, `plural`, `select`, `msg`) and `@lingui/react/macro` (`Trans`, `useLingui`)—not the deprecated `@lingui/macro`.
|
|
63
|
+
- Never call `t` / `plural` / `select` at module top level (they freeze to the initial locale); use `msg` for module-level descriptors and translate with `i18n._(descriptor)` inside render.
|
|
64
|
+
- Lazy-load compiled catalogs with `i18n.loadAndActivate({ locale, messages })`. In React Server Components, call `setI18n` from `@lingui/react/server` in every page and layout.
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { i18n } from '@lingui/core';
|
|
68
|
+
|
|
69
|
+
export async function dynamicActivate(locale: string) {
|
|
70
|
+
const { messages } = await import(`./locales/${locale}/messages.mjs`);
|
|
71
|
+
i18n.loadAndActivate({ locale, messages });
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Paraglide JS & Vue I18n
|
|
76
|
+
|
|
77
|
+
- **Paraglide JS**: configure `paraglideVitePlugin({ project, outdir, strategy: ['url', 'cookie', 'baseLocale'] })`, call tree-shaken `m.greeting({ name })`, and switch locales via `setLocale('de')`.
|
|
78
|
+
- **Vue I18n**: initialize `createI18n({ legacy: false, locale, fallbackLocale })`, lazy-load locale JSON in `router.beforeEach` via `i18n.global.setLocaleMessage(locale, mod.default)`, and sync `<html lang>` and `dir`.
|
|
79
|
+
|
|
80
|
+
## Locale routing, RTL, bidirectional isolation, and script/font fallback
|
|
81
|
+
|
|
82
|
+
- **Document attributes & `hreflang` (`x-default`)**: update both `<html lang="ar">` and `<html dir="rtl">` (or `dir="ltr"`) whenever the active locale changes; on every SEO-indexed localized route, emit a self-referencing `<link rel="canonical" href="https://example.com/vi/pricing">`, reciprocal `<link rel="alternate" hreflang="vi" href="...">` links for every translated locale, and an explicit `<link rel="alternate" hreflang="x-default" href="https://example.com/pricing">` fallback URL.
|
|
83
|
+
- **Mixed-direction isolation (Unicode UAX #9)**: wrap interpolated user-generated or unknown-direction text (usernames, product titles, file paths) in `<bdi>` or set `dir="auto"` / `unicode-bidi: isolate` (never legacy `unicode-bidi: embed`) so opposite-direction characters do not bleed into surrounding punctuation and numbers.
|
|
84
|
+
- **Logical CSS & selective mirroring**: use CSS logical properties (`margin-inline-start`, `padding-inline-end`, `inset-inline-start`, `text-align: start`). Mirror directional navigation icons (back/forward arrows, chevrons) in RTL, but **never** mirror clocks, media playback scrubbers, checkmarks, or mathematical/time-series graphs.
|
|
85
|
+
- **Locale-aware formatting (`Intl.*` + `Temporal`)**: use `Intl.DateTimeFormat`, `Intl.NumberFormat`, `Intl.RelativeTimeFormat`, **`Intl.DurationFormat`** (`new Intl.DurationFormat(locale, { style: 'short' }).format({ hours: 1, minutes: 25 })`), `Intl.ListFormat`, and `Intl.Collator` instead of hardcoded `MM/DD/YYYY`, `"1h 25m"`, `.toFixed(2)`, or `.sort()`. For calendar-date and timezone/DST arithmetic, prefer **`Temporal`** (`Temporal.PlainDate`, `Temporal.ZonedDateTime`, backed by `temporal-polyfill` where native `Temporal` is not yet shipped) instead of error-prone legacy `Date` mutation. Track **Unicode MessageFormat 2 (LDML Part 9 / TC39 `Intl.MessageFormat`)** as the evolving standard successor to ICU MessageFormat 1.
|
|
86
|
+
- **Font and script fallback**: pair Latin display/body fonts with explicit script-specific fallbacks (`@font-face` with `unicode-range` for Arabic, Devanagari, Thai, CJK) and increase `line-height` slightly for tall/diacritic scripts (Arabic, Vietnamese, Thai) so ascenders/descenders do not clip.
|
|
87
|
+
|
|
88
|
+
## Do/don't pairs
|
|
89
|
+
|
|
90
|
+
| Do | Don't |
|
|
91
|
+
|---|---|
|
|
92
|
+
| Use ICU `{plural}` / `{select}` with an `other` branch | Concatenate `count + (count === 1 ? ' item' : ' items')` (breaks Slavic/Arabic plural rules) |
|
|
93
|
+
| Format dates, currencies, durations (`Intl.DurationFormat`), lists, and sorting with `Intl.*` + `Temporal` | Hardcode `$`, `MM/DD/YYYY`, `"2h 15m"`, or fragile `Date` timezone math |
|
|
94
|
+
| Lazy-load per-locale / per-namespace translation chunks (or keep them in RSC via `next-intl`) | Bundle all 15 language JSON files into the initial client chunk |
|
|
95
|
+
| Use `msg` at module scope in Lingui and `@lingui/core/macro` imports | Call `t` at module top level or import deprecated `@lingui/macro` |
|
|
96
|
+
| Sync `<html lang>` + `<html dir>` and use CSS logical properties | Use physical `left`/`right` margins or flip media scrubbers in RTL |
|
|
97
|
+
| Configure `fallbackLng` explicitly in i18next v27+ and `legacy: false` in Vue I18n | Assume i18next defaults to `'en'` or use Vue I18n legacy mode with `useI18n()` |
|
|
98
|
+
|
|
99
|
+
## Verification commands
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
npm run build
|
|
103
|
+
npx playwright test
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Verify that unused locale chunks are split out of the initial bundle (`static`), and test pseudo-localized / long-string locales (e.g. German +35% width), RTL (`ar`/`he`), and CJK/Vietnamese diacritic rendering in a real browser (`rendered`).
|