picasso-skill 2.4.0 → 2.6.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/picasso.md +26 -542
- package/commands/godmode.md +3 -13
- package/commands/roast.md +3 -14
- package/commands/score.md +3 -18
- package/commands/steal.md +3 -31
- package/package.json +1 -1
- package/references/accessibility-wcag.md +3 -0
- package/references/code-typography.md +36 -166
- package/references/color-and-contrast.md +78 -345
- package/references/generative-art.md +49 -561
- package/references/modern-css-performance.md +46 -258
- package/references/motion-and-animation.md +225 -88
- package/references/navigation-patterns.md +29 -186
- package/references/performance-optimization.md +42 -678
- package/references/react-patterns.md +56 -216
- package/references/responsive-design.md +77 -379
- package/references/sensory-design.md +62 -263
- package/references/ux-writing.md +64 -354
- package/references/animation-performance.md +0 -244
- package/references/interaction-design.md +0 -162
package/commands/godmode.md
CHANGED
|
@@ -2,49 +2,39 @@ Run the Picasso /godmode command -- the ultimate design transformation pipeline.
|
|
|
2
2
|
|
|
3
3
|
Use the Picasso agent (subagent_type: "picasso") to execute the full godmode pipeline:
|
|
4
4
|
|
|
5
|
-
ANTI-HALLUCINATION RULE: Every phase that makes visual claims MUST gather evidence first.
|
|
5
|
+
ANTI-HALLUCINATION RULE: Every phase that makes visual claims MUST gather evidence first. Take screenshots via `npx playwright screenshot` AND view them with the Read tool. Never claim light/dark mode, color, or layout from code alone.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Live site:** Playwright screenshots (take AND view with Read tool)
|
|
9
|
-
- **Figma file:** MCP data (structural facts) + `mcp__figma__get_image` (visual verification)
|
|
10
|
-
- **Both available:** Use Figma as design intent, Playwright as implementation reality. Flag gaps.
|
|
7
|
+
If a Figma URL is provided, run /figma first to extract design tokens, then proceed with those as ground truth.
|
|
11
8
|
|
|
12
9
|
Phase 1: UNDERSTAND
|
|
13
10
|
- Check for .picasso.md config. If not found, run the design interview (ask what we're building, who it's for, aesthetic direction, priorities 1-5 for animations/mobile/a11y/dark mode/performance, constraints).
|
|
14
11
|
- Gather context: read all frontend files, find design system, detect component library.
|
|
15
|
-
- If a Figma URL is available or Figma MCP is configured, fetch the design file structure and styles as ground truth.
|
|
16
12
|
|
|
17
13
|
Phase 2: ASSESS
|
|
18
14
|
- Take BEFORE screenshots (desktop + mobile) and VIEW them with the Read tool.
|
|
19
|
-
- If Figma source exists, fetch design tokens via MCP and compare against implementation.
|
|
20
15
|
- Run /score to establish the BEFORE score (0-100 with category breakdown).
|
|
21
|
-
- Run /roast for the brutally honest assessment (must be based on screenshots
|
|
16
|
+
- Run /roast for the brutally honest assessment (must be based on screenshots, not code guessing).
|
|
22
17
|
- Run /audit for full technical audit with severity-ranked findings.
|
|
23
18
|
- Run /a11y (axe-core + pa11y + Lighthouse accessibility).
|
|
24
19
|
- Run /perf (Lighthouse Core Web Vitals).
|
|
25
20
|
- Run /lint-design (find hardcoded colors, spacing violations, font inconsistencies).
|
|
26
|
-
- If Figma MCP available: Run /figma --audit for Figma-specific design system health check.
|
|
27
21
|
|
|
28
22
|
Phase 3: PLAN
|
|
29
23
|
- Compile all findings into a prioritized fix list (Critical -> High -> Medium -> Low).
|
|
30
|
-
- If Figma source exists, prioritize design-implementation gaps as High severity.
|
|
31
24
|
- Present the plan: "Found X issues. Fixing all = score ~Y. Proceed?"
|
|
32
25
|
- WAIT for user confirmation before proceeding.
|
|
33
26
|
|
|
34
27
|
Phase 4: FIX
|
|
35
28
|
- Execute fixes in priority order: typography, color, spacing, layout, motion, accessibility, interaction, performance, copy.
|
|
36
|
-
- When Figma tokens are available, use them as the source of truth for fixes.
|
|
37
29
|
- Re-verify after each category.
|
|
38
30
|
|
|
39
31
|
Phase 5: VERIFY
|
|
40
32
|
- Run /score again for the AFTER score.
|
|
41
33
|
- Take AFTER screenshots and VIEW them with the Read tool.
|
|
42
|
-
- If Figma source exists, re-compare to check implementation now matches design intent.
|
|
43
34
|
- Generate before/after comparison.
|
|
44
35
|
|
|
45
36
|
Phase 6: REPORT
|
|
46
37
|
- Show final score comparison with per-category breakdown.
|
|
47
38
|
- Show files modified and issues fixed.
|
|
48
|
-
- If Figma comparison was done, show design fidelity score (% match).
|
|
49
39
|
|
|
50
40
|
If the before score is already 85+, say so and suggest the 3-4 things that would take it to 95+.
|
package/commands/roast.md
CHANGED
|
@@ -4,30 +4,19 @@ Use the Picasso agent to review the current project's frontend with sharp, desig
|
|
|
4
4
|
|
|
5
5
|
MANDATORY FIRST STEP -- Gather visual evidence before writing anything:
|
|
6
6
|
|
|
7
|
-
**Option A: Live site (localhost or URL)**
|
|
8
7
|
1. Take screenshots: `npx playwright screenshot http://localhost:PORT /tmp/picasso-roast-desktop.png --viewport-size=1440,900` (and mobile at 375,812)
|
|
9
8
|
2. Use the Read tool to VIEW the screenshot files: `Read /tmp/picasso-roast-desktop.png` and `Read /tmp/picasso-roast-mobile.png`
|
|
10
9
|
3. Base ALL visual observations on what you actually see in the screenshots, NOT on code/CSS classes
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
1. Extract file_key from the Figma URL
|
|
14
|
-
2. Fetch the target frame via `mcp__figma__get_node` for structural data (spacing, colors, typography, auto-layout)
|
|
15
|
-
3. Export the frame as an image via `mcp__figma__get_image` for visual review
|
|
16
|
-
4. Fetch styles via `mcp__figma__get_styles` to check design system usage
|
|
17
|
-
5. Base structural observations on MCP data (exact values) and visual observations on the exported image
|
|
11
|
+
If a Figma URL is provided, run /figma first to extract design tokens, then proceed with those as ground truth.
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
1. Do both A and B
|
|
21
|
-
2. Include a "Design vs Implementation" delta section in the roast — flag where the dev diverged from the design
|
|
22
|
-
|
|
23
|
-
4. If NEITHER screenshots NOR Figma MCP work, tell the user and DO NOT make visual claims. You can still audit code patterns but must prefix findings with "Based on code analysis only (no screenshot):"
|
|
13
|
+
If NEITHER screenshots NOR Figma MCP work, tell the user and DO NOT make visual claims. You can still audit code patterns but must prefix findings with "Based on code analysis only (no screenshot):"
|
|
24
14
|
|
|
25
15
|
ANTI-HALLUCINATION RULES:
|
|
26
16
|
- NEVER say "this is light mode" or "dark mode" without viewing a screenshot or Figma frame data
|
|
27
17
|
- NEVER describe colors, layouts, or visual appearance from code alone
|
|
28
18
|
- NEVER claim "this looks like X" without a screenshot or Figma export to verify
|
|
29
|
-
- Code classes (e.g. `dark:bg-gray-900`) tell you what COULD render; only screenshots
|
|
30
|
-
- When using Figma MCP data, you CAN state exact values (e.g., "spacing is 17px" or "fill is #808080") because these are structural facts, not visual guesses
|
|
19
|
+
- Code classes (e.g. `dark:bg-gray-900`) tell you what COULD render; only screenshots show what DOES render
|
|
31
20
|
|
|
32
21
|
Rules:
|
|
33
22
|
- Be specific about every criticism (file:line, element reference, or Figma node name)
|
package/commands/score.md
CHANGED
|
@@ -4,27 +4,16 @@ Use the Picasso agent to score the current project's frontend design on a 0-100
|
|
|
4
4
|
|
|
5
5
|
MANDATORY FIRST STEP -- Gather visual evidence before scoring:
|
|
6
6
|
|
|
7
|
-
**Option A: Live site (localhost or URL)**
|
|
8
7
|
1. Take screenshots: `npx playwright screenshot http://localhost:PORT /tmp/picasso-score-desktop.png --viewport-size=1440,900` (and mobile at 375,812)
|
|
9
8
|
2. Use the Read tool to VIEW the screenshot files before scoring visual categories
|
|
10
9
|
3. If screenshots fail, tell the user and score only code-auditable categories (mark visual categories as "N/A - no screenshot")
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
1. Fetch the target frame via `mcp__figma__get_node` for structural data
|
|
14
|
-
2. Fetch styles via `mcp__figma__get_styles` for design system analysis
|
|
15
|
-
3. Export frame as image via `mcp__figma__get_image` for visual review
|
|
16
|
-
4. Score based on both structural data (exact values) and exported image
|
|
17
|
-
5. Add bonus category: Design System Health (0-10)
|
|
18
|
-
|
|
19
|
-
**Option C: Both (Figma + live site)**
|
|
20
|
-
1. Do both A and B
|
|
21
|
-
2. Add category: Design Fidelity (0-10) -- how closely implementation matches Figma intent
|
|
11
|
+
If a Figma URL is provided, run /figma first to extract design tokens, then proceed with those as ground truth.
|
|
22
12
|
|
|
23
13
|
ANTI-HALLUCINATION RULES:
|
|
24
|
-
- Visual categories (Typography appearance, Color in practice, Spacing rhythm, Anti-Slop visual check) MUST be scored from screenshots
|
|
14
|
+
- Visual categories (Typography appearance, Color in practice, Spacing rhythm, Anti-Slop visual check) MUST be scored from screenshots, not code alone
|
|
25
15
|
- Code-auditable categories (a11y violations via axe, transition:all grep, prefers-reduced-motion grep) can be scored from code
|
|
26
|
-
-
|
|
27
|
-
- Never claim "this looks like X" without viewing a screenshot or Figma export
|
|
16
|
+
- Never claim "this looks like X" without viewing a screenshot
|
|
28
17
|
|
|
29
18
|
Categories:
|
|
30
19
|
- Typography (0-15): font choice, type scale, max-width, line-height, letter-spacing
|
|
@@ -36,8 +25,4 @@ Categories:
|
|
|
36
25
|
- Performance (0-10): Lighthouse perf score mapped 0-100 -> 0-10
|
|
37
26
|
- Anti-Slop (0-10): deductions for each AI-slop fingerprint detected (-2 each)
|
|
38
27
|
|
|
39
|
-
Bonus categories (when Figma MCP is available):
|
|
40
|
-
- Design System Health (0-10): style usage %, component coverage, naming consistency, auto-layout adoption
|
|
41
|
-
- Design Fidelity (0-10, only when both Figma + live): token match, spacing accuracy, structural parity
|
|
42
|
-
|
|
43
28
|
Output format with visual bars and top fixes for maximum point improvement.
|
package/commands/steal.md
CHANGED
|
@@ -2,30 +2,7 @@ Run the Picasso /steal command -- extract design DNA from a URL or Figma file.
|
|
|
2
2
|
|
|
3
3
|
Use the Picasso agent to extract the design language from the provided source: $ARGUMENTS
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
- **Figma URL** (contains `figma.com/design/` or `figma.com/file/`): Use Figma MCP for precise extraction
|
|
8
|
-
- **Live URL** (any other http/https): Use Playwright screenshots + source scraping
|
|
9
|
-
- **Both provided**: Use both sources, Figma as ground truth and live site for verification
|
|
10
|
-
|
|
11
|
-
## Steps: Figma URL (Preferred)
|
|
12
|
-
|
|
13
|
-
1. Extract `file_key` and optional `node_id` from the Figma URL
|
|
14
|
-
2. Fetch styles via `mcp__figma__get_styles` — extract all color styles, text styles, effect styles
|
|
15
|
-
3. Fetch target frame via `mcp__figma__get_node` — extract auto-layout spacing, fills, strokes, radii
|
|
16
|
-
4. Fetch components via `mcp__figma__get_components` — understand component structure
|
|
17
|
-
5. Export frame as image via `mcp__figma__get_image` for visual reference
|
|
18
|
-
6. Analyze the extracted data:
|
|
19
|
-
- **Colors:** All fill/stroke colors → convert to OKLCH. Identify primary, secondary, accent, neutral.
|
|
20
|
-
- **Typography:** Font families, size scale, weight distribution, line-height ratios.
|
|
21
|
-
- **Spacing:** Auto-layout itemSpacing and padding → detect base unit (4px? 8px?) and scale.
|
|
22
|
-
- **Shadows:** Effect styles → map to elevation scale.
|
|
23
|
-
- **Radii:** Border radius values → detect pattern (uniform? progressive?).
|
|
24
|
-
- **Layout:** Auto-layout direction, alignment, wrapping → grid/flex patterns.
|
|
25
|
-
7. Generate a `.picasso.md` config matching the extracted aesthetic
|
|
26
|
-
8. Optionally generate a `DESIGN.md` with the full token set
|
|
27
|
-
|
|
28
|
-
## Steps: Live URL
|
|
5
|
+
## Steps
|
|
29
6
|
|
|
30
7
|
1. Screenshot the URL at desktop (1440x900) and mobile (375x812)
|
|
31
8
|
2. Fetch the page source and extract: font-family declarations, color values (#hex, rgb, oklch), border-radius values, box-shadow values
|
|
@@ -33,11 +10,6 @@ Use the Picasso agent to extract the design language from the provided source: $
|
|
|
33
10
|
4. Generate a `.picasso.md` config that matches the extracted aesthetic
|
|
34
11
|
5. Optionally generate a `DESIGN.md` with the full token set
|
|
35
12
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
1. Run Figma extraction (ground truth for intended design)
|
|
39
|
-
2. Run live URL extraction (what actually shipped)
|
|
40
|
-
3. Generate tokens from Figma source
|
|
41
|
-
4. Note any divergences between design and implementation in the output
|
|
13
|
+
If a Figma URL is provided, run /figma first to extract design tokens, then proceed with those as ground truth.
|
|
42
14
|
|
|
43
|
-
If no URL is provided, ask the user for one.
|
|
15
|
+
If no URL is provided, ask the user for one.
|
package/package.json
CHANGED
|
@@ -86,6 +86,9 @@ Move focus to `<h1>` of new view (add `tabindex="-1"`) or main content landmark.
|
|
|
86
86
|
<main id="main" tabindex="-1">...</main>
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
### Focus Indicator Rule
|
|
90
|
+
Never remove focus outlines without replacement. Use `:focus-visible` (not `:focus`) to show focus rings only for keyboard navigation, not mouse clicks.
|
|
91
|
+
|
|
89
92
|
### Focus Trapping
|
|
90
93
|
Contain Tab/Shift+Tab within overlays. Use `inert` attribute on background content (modern browsers) or manage via JS. On last focusable element, Tab wraps to first.
|
|
91
94
|
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
# Code Typography Reference
|
|
2
2
|
|
|
3
|
-
## Table of Contents
|
|
4
|
-
1. Monospace Font Selection
|
|
5
|
-
2. Code Block Design
|
|
6
|
-
3. Syntax Highlighting Accessibility
|
|
7
|
-
4. Copy-to-Clipboard
|
|
8
|
-
5. Responsive Code Blocks
|
|
9
|
-
6. Inline Code Styling
|
|
10
|
-
7. Diff Views
|
|
11
|
-
8. Terminal Output
|
|
12
|
-
9. Common Mistakes
|
|
13
|
-
|
|
14
3
|
---
|
|
15
4
|
|
|
16
5
|
## 1. Monospace Font Selection
|
|
@@ -19,204 +8,85 @@
|
|
|
19
8
|
|---|---|---|---|
|
|
20
9
|
| JetBrains Mono | Yes | Clean, geometric | General purpose, IDEs |
|
|
21
10
|
| Fira Code | Yes | Slightly rounded | Tutorials, docs |
|
|
22
|
-
| Source Code Pro | No | Adobe, professional | Enterprise
|
|
11
|
+
| Source Code Pro | No | Adobe, professional | Enterprise |
|
|
23
12
|
| IBM Plex Mono | No | Corporate, legible | Documentation |
|
|
24
13
|
| Geist Mono | No | Vercel, modern | Next.js projects |
|
|
25
14
|
| Cascadia Code | Yes | Microsoft, playful | Terminals |
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
code, pre, .mono {
|
|
29
|
-
font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
|
|
30
|
-
font-feature-settings: 'liga' 1, 'calt' 1; /* enable ligatures */
|
|
31
|
-
font-variant-ligatures: common-ligatures;
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Ligatures: `=>` becomes ⇒, `!==` becomes ≢, `>=` becomes ≥. Enable for display, disable for editing if users copy code.
|
|
16
|
+
Always specify a modern monospace font first, then fallback to `monospace`. Enable ligatures with `font-feature-settings: 'liga' 1, 'calt' 1` for display; disable for editing if users copy code.
|
|
36
17
|
|
|
37
18
|
---
|
|
38
19
|
|
|
39
20
|
## 2. Code Block Design
|
|
40
21
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
padding: 1rem 1.25rem;
|
|
47
|
-
font-size: 0.875rem; /* 14px — slightly smaller than body */
|
|
48
|
-
line-height: 1.65; /* Looser than body text for readability */
|
|
49
|
-
overflow-x: auto;
|
|
50
|
-
tab-size: 2;
|
|
51
|
-
-moz-tab-size: 2;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Dark mode code blocks on light sites */
|
|
55
|
-
[data-theme="light"] pre {
|
|
56
|
-
background: oklch(0.14 0.02 230);
|
|
57
|
-
color: oklch(0.90 0.01 230);
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Line numbers (optional):
|
|
62
|
-
```css
|
|
63
|
-
pre.line-numbers {
|
|
64
|
-
counter-reset: line;
|
|
65
|
-
padding-left: 3.5rem;
|
|
66
|
-
position: relative;
|
|
67
|
-
}
|
|
68
|
-
pre.line-numbers .line::before {
|
|
69
|
-
counter-increment: line;
|
|
70
|
-
content: counter(line);
|
|
71
|
-
position: absolute;
|
|
72
|
-
left: 1rem;
|
|
73
|
-
color: var(--text-muted);
|
|
74
|
-
font-size: 0.75rem;
|
|
75
|
-
user-select: none; /* don't copy line numbers */
|
|
76
|
-
}
|
|
77
|
-
```
|
|
22
|
+
- Background: `var(--surface-1)` with 1px border, 8px radius
|
|
23
|
+
- Font size: 0.875rem (14px), line-height: 1.65 (looser than body for readability)
|
|
24
|
+
- `overflow-x: auto; tab-size: 2`
|
|
25
|
+
- Dark code blocks on light sites: `oklch(0.14 0.02 230)` background
|
|
26
|
+
- Line numbers: use CSS counters with `user-select: none` so they don't get copied
|
|
78
27
|
|
|
79
28
|
---
|
|
80
29
|
|
|
81
30
|
## 3. Syntax Highlighting Accessibility
|
|
82
31
|
|
|
83
|
-
Every token color must have **minimum 3:1 contrast** against the code block background. Don't rely on color alone
|
|
32
|
+
Every token color must have **minimum 3:1 contrast** against the code block background. Don't rely on color alone; use font-weight or font-style for emphasis.
|
|
84
33
|
|
|
85
|
-
| Token Type | Suggested OKLCH (dark bg) |
|
|
34
|
+
| Token Type | Suggested OKLCH (dark bg) | Style |
|
|
86
35
|
|---|---|---|
|
|
87
|
-
| Keywords | `oklch(0.75 0.15 300)` |
|
|
88
|
-
| Strings | `oklch(0.72 0.14 150)` |
|
|
89
|
-
| Numbers | `oklch(0.75 0.12 60)` |
|
|
90
|
-
| Comments | `oklch(0.50 0.01 230)` |
|
|
91
|
-
| Functions | `oklch(0.78 0.10 230)` |
|
|
92
|
-
| Variables | `oklch(0.85 0.01 230)` |
|
|
93
|
-
|
|
94
|
-
```css
|
|
95
|
-
.token-keyword { color: oklch(0.75 0.15 300); font-weight: 600; }
|
|
96
|
-
.token-string { color: oklch(0.72 0.14 150); }
|
|
97
|
-
.token-comment { color: oklch(0.50 0.01 230); font-style: italic; }
|
|
98
|
-
```
|
|
36
|
+
| Keywords | `oklch(0.75 0.15 300)` | bold |
|
|
37
|
+
| Strings | `oklch(0.72 0.14 150)` | normal |
|
|
38
|
+
| Numbers | `oklch(0.75 0.12 60)` | normal |
|
|
39
|
+
| Comments | `oklch(0.50 0.01 230)` | italic |
|
|
40
|
+
| Functions | `oklch(0.78 0.10 230)` | normal |
|
|
41
|
+
| Variables | `oklch(0.85 0.01 230)` | normal |
|
|
99
42
|
|
|
100
43
|
---
|
|
101
44
|
|
|
102
45
|
## 4. Copy-to-Clipboard
|
|
103
46
|
|
|
104
|
-
Position
|
|
105
|
-
|
|
106
|
-
```jsx
|
|
107
|
-
function CopyButton({ code }) {
|
|
108
|
-
const [copied, setCopied] = useState(false);
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<button
|
|
112
|
-
onClick={() => {
|
|
113
|
-
navigator.clipboard.writeText(code);
|
|
114
|
-
setCopied(true);
|
|
115
|
-
setTimeout(() => setCopied(false), 2000);
|
|
116
|
-
}}
|
|
117
|
-
className="absolute top-2 right-2 p-1.5 rounded-md bg-white/5 hover:bg-white/10 text-xs text-muted"
|
|
118
|
-
aria-label="Copy code"
|
|
119
|
-
>
|
|
120
|
-
{copied ? 'Copied' : 'Copy'}
|
|
121
|
-
</button>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
```
|
|
47
|
+
Position top-right, show on hover, visual feedback ("Copied" for 2s). Use `navigator.clipboard.writeText()`. Add `aria-label="Copy code"`.
|
|
125
48
|
|
|
126
49
|
---
|
|
127
50
|
|
|
128
51
|
## 5. Responsive Code Blocks
|
|
129
52
|
|
|
130
|
-
Code
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
overflow-x: auto;
|
|
135
|
-
white-space: pre; /* code: no wrap */
|
|
136
|
-
-webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
pre.terminal {
|
|
140
|
-
white-space: pre-wrap; /* terminal: wrap is OK */
|
|
141
|
-
word-break: break-all;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* Hide scrollbar but keep functionality */
|
|
145
|
-
pre::-webkit-scrollbar { height: 4px; }
|
|
146
|
-
pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
On very small screens (< 375px), consider reducing code font-size to 12px.
|
|
53
|
+
- Code: `white-space: pre; overflow-x: auto` (never wrap)
|
|
54
|
+
- Terminal output: `white-space: pre-wrap` (wrapping OK)
|
|
55
|
+
- Thin scrollbar: 4px height, subtle thumb color
|
|
56
|
+
- Below 375px, consider reducing to 12px font size
|
|
150
57
|
|
|
151
58
|
---
|
|
152
59
|
|
|
153
60
|
## 6. Inline Code Styling
|
|
154
61
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
```css
|
|
158
|
-
code:not(pre code) {
|
|
159
|
-
background: var(--surface-2);
|
|
160
|
-
padding: 0.15em 0.4em;
|
|
161
|
-
border-radius: 4px;
|
|
162
|
-
font-size: 0.9em; /* slightly smaller than surrounding text */
|
|
163
|
-
font-weight: 500;
|
|
164
|
-
border: 1px solid var(--border);
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Never use inline code for emphasis. It's for code references (`useState`, `border-radius`, `GET /api/users`), not for highlighting words.
|
|
62
|
+
Subtle distinction from body text: light background, 0.15em/0.4em padding, 4px radius, 0.9em font-size, 1px border. Never use inline code for emphasis; it's for code references (`useState`, `GET /api/users`).
|
|
169
63
|
|
|
170
64
|
---
|
|
171
65
|
|
|
172
66
|
## 7. Diff Views
|
|
173
67
|
|
|
174
|
-
Use color + icon
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
.diff-add {
|
|
178
|
-
background: oklch(0.62 0.19 150 / 0.1);
|
|
179
|
-
border-left: 3px solid oklch(0.62 0.19 150);
|
|
180
|
-
}
|
|
181
|
-
.diff-add::before { content: '+'; color: oklch(0.62 0.19 150); }
|
|
182
|
-
|
|
183
|
-
.diff-remove {
|
|
184
|
-
background: oklch(0.55 0.22 25 / 0.1);
|
|
185
|
-
border-left: 3px solid oklch(0.55 0.22 25);
|
|
186
|
-
text-decoration: line-through;
|
|
187
|
-
opacity: 0.7;
|
|
188
|
-
}
|
|
189
|
-
.diff-remove::before { content: '-'; color: oklch(0.55 0.22 25); }
|
|
190
|
-
```
|
|
68
|
+
Use color + icon (not color alone, for colorblind users):
|
|
69
|
+
- Added: green-tinted background + left border + `+` prefix
|
|
70
|
+
- Removed: red-tinted background + left border + `-` prefix + `line-through` + reduced opacity
|
|
191
71
|
|
|
192
72
|
---
|
|
193
73
|
|
|
194
74
|
## 8. Terminal Output
|
|
195
75
|
|
|
196
|
-
Terminal
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
background: oklch(0.08 0.01 230);
|
|
201
|
-
color: oklch(0.80 0.01 150); /* slight green tint for terminal feel */
|
|
202
|
-
font-family: 'JetBrains Mono', monospace;
|
|
203
|
-
padding: 1rem;
|
|
204
|
-
border-radius: 8px;
|
|
205
|
-
}
|
|
206
|
-
.terminal .prompt { color: oklch(0.65 0.10 230); } /* blue prompt */
|
|
207
|
-
.terminal .output { color: oklch(0.75 0.01 230); } /* neutral output */
|
|
208
|
-
.terminal .error { color: oklch(0.65 0.22 25); } /* red errors */
|
|
209
|
-
```
|
|
76
|
+
Terminal styling should feel distinct from code blocks:
|
|
77
|
+
- Darker background: `oklch(0.08 0.01 230)`
|
|
78
|
+
- Slight green tint for text: `oklch(0.80 0.01 150)`
|
|
79
|
+
- Blue prompt, neutral output, red errors
|
|
210
80
|
|
|
211
81
|
---
|
|
212
82
|
|
|
213
83
|
## 9. Common Mistakes
|
|
214
84
|
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
85
|
+
- Code font too large (14px for blocks, 0.9em for inline)
|
|
86
|
+
- No horizontal scroll on code blocks
|
|
87
|
+
- Syntax colors with < 3:1 contrast (especially comments)
|
|
88
|
+
- Color-only diff indication (add +/- markers)
|
|
89
|
+
- Copying includes line numbers (use `user-select: none`)
|
|
90
|
+
- Same styling for code blocks and terminal (different purposes)
|
|
91
|
+
- `font-family: monospace` without named fonts (defaults to Courier New)
|
|
92
|
+
- No copy button
|