Shipyard theme-picker
БесплатноБез исполняемых скриптовНе проверенLet users of an app pick their own colours: preset themes plus a full colour picker (hue/saturation square and hex) for accent, buttons, background, cards and…
от philipposk73 установки в других каталогахОб этом скилле
Shipyard theme picker
Part of the Shipyard plugin. It needs the full plugin installed (https://github.com/philipposk/shipyard/blob/main/INSTALL.md): its scripts and key guard do not work on their own.
Read ${CLAUDE_PLUGIN_ROOT}/skills/new-app/references/working-rules.md now, before any other step, and follow it. The rules below only add to it.
1. Make every colour a CSS variable first
Before any picker, the app's CSS must read colours only from variables (--bg, --surface, --text, --accent, --inverse/--on-inverse for buttons, plus derived --subtle, --raised, --line, --muted). Search for hard-coded hex values and replace them. A picker over a half-variabled app looks broken.
2. Store a small, validated theme object
{ preset, accent, colors: { light: {bg, surface, text, button}, dark: {...} } }. Accept only #rrggbb (sanitize on read and on write; drop anything else). Save it with the user (for example Supabase user_metadata.custom_theme), not only in localStorage, so it follows them across devices.
3. Derive the rest, don't ask for it
Users pick 5 colours; compute the in-between tones with a colour mix (for example raised = mix(surface, text, 4%), line = mix(surface, text, 12%), muted = mix(text, bg, 40%)). Pick the readable text on a button by luminance. Warn (don't block) when contrast is below 4.5:1 for text and 3:1 for buttons.
4. Render it on the server, scoped tightly
Emit a <style> in the root layout from the saved theme, scoped like :root[data-ct][data-style][data-theme=dark] { ... } so it beats the presets on specificity and can never leak into other modes. Server rendering means no flash of the default theme. Live preview while editing just rewrites that style tag on the client.
5. The picker itself (about 150 lines, no library)
- Saturation/value square:
background-color: hsl(hue 100% 50%)with two gradient overlays (white→transparent left-to-right, transparent→black top-to-bottom). UsebackgroundColor, not thebackgroundshorthand, or React wipes the gradients. - Hue slider: a rainbow gradient strip.
- Hex input: commits on valid
#rrggbbonly. - Pointer drag with
setPointerCaptureone.currentTarget; arrow keys move 1% (Shift 10%); each control isrole="slider"with aria values. - Keep HSV in local state so the hue doesn't jump when saturation hits 0; resync from the prop with the "adjust state while rendering" pattern, not an effect.
6. Editor layout (phone first)
Presets on top. Below: "Exact colours" with a Light/Dark switch, one row per slot (swatch, name, hex, Clear), and the picker opening under the tapped row. Clear falls back to the preset value. Test at 390x844.
7. Check
Unit-test sanitize, HSV round trip and the generated CSS. Screenshot light and dark with a garish pick (yellow buttons) to catch any hard-coded colour that didn't follow.
Установить Shipyard theme-picker в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Shipyard theme-picker?
Let users of an app pick their own colours: preset themes plus a full colour picker (hue/saturation square and hex) for accent, buttons, background, cards and text, separately for light and dark, saved per user and rendered without a flash. Use for "theme editor", "custom colours", "colour picker", "let users choose their theme", "/shipyard:theme-picker". Not for designing the app's own default look (use design).
Как установить скилл Shipyard theme-picker?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Shipyard theme-picker запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic