@theproductguy/create-mission-control 1.0.3 → 1.0.4
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/bin/cli.js +11 -4
- package/package.json +2 -2
- package/src/template/agent-os/commands/export-product/export-product.md +24 -0
- package/src/template/agent-os/commands/initialize-design/initialize-design.md +10 -1
- package/src/template/control-center/backend/index.js +9 -3
- package/src/template/control-center/frontend/src/App.tsx +34 -1
- package/src/template/design-system/{.claude → .gemini}/commands/design-os/design-shell.md +95 -69
- package/src/template/design-system/.gemini/commands/design-os/design-tokens.md +211 -0
- package/src/template/design-system/.gemini/commands/impeccable/WORKFLOW.md +163 -0
- package/src/template/design-system/.gemini/commands/impeccable/adapt.md +189 -0
- package/src/template/design-system/.gemini/commands/impeccable/animate.md +184 -0
- package/src/template/design-system/.gemini/commands/impeccable/audit.md +123 -0
- package/src/template/design-system/.gemini/commands/impeccable/bolder.md +126 -0
- package/src/template/design-system/.gemini/commands/impeccable/clarify.md +173 -0
- package/src/template/design-system/.gemini/commands/impeccable/colorize.md +152 -0
- package/src/template/design-system/.gemini/commands/impeccable/critique.md +112 -0
- package/src/template/design-system/.gemini/commands/impeccable/delight.md +311 -0
- package/src/template/design-system/.gemini/commands/impeccable/extract.md +88 -0
- package/src/template/design-system/.gemini/commands/impeccable/harden.md +351 -0
- package/src/template/design-system/.gemini/commands/impeccable/normalize.md +61 -0
- package/src/template/design-system/.gemini/commands/impeccable/onboard.md +236 -0
- package/src/template/design-system/.gemini/commands/impeccable/optimize.md +262 -0
- package/src/template/design-system/.gemini/commands/impeccable/polish.md +196 -0
- package/src/template/design-system/.gemini/commands/impeccable/quieter.md +112 -0
- package/src/template/design-system/.gemini/commands/impeccable/simplify.md +131 -0
- package/src/template/design-system/.gemini/commands/impeccable/teach-impeccable.md +67 -0
- package/src/template/design-system/.gemini/skills/frontend-design/SKILL.md +126 -0
- package/src/template/design-system/.gemini/skills/frontend-design/reference/color-and-contrast.md +132 -0
- package/src/template/design-system/.gemini/skills/frontend-design/reference/interaction-design.md +123 -0
- package/src/template/design-system/.gemini/skills/frontend-design/reference/motion-design.md +99 -0
- package/src/template/design-system/.gemini/skills/frontend-design/reference/responsive-design.md +114 -0
- package/src/template/design-system/.gemini/skills/frontend-design/reference/spatial-design.md +100 -0
- package/src/template/design-system/.gemini/skills/frontend-design/reference/typography.md +131 -0
- package/src/template/design-system/.gemini/skills/frontend-design/reference/ux-writing.md +107 -0
- package/src/template/design-system/src/components/DesignPage.tsx +104 -0
- package/src/template/package-lock.json +10308 -0
- package/src/template/design-system/.claude/commands/design-os/design-tokens.md +0 -166
- package/src/template/design-system/.claude/skills/frontend-design/SKILL.md +0 -42
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/data-model.md +0 -0
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/design-screen.md +0 -0
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/export-product.md +0 -0
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/product-roadmap.md +0 -0
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/product-vision.md +0 -0
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/sample-data.md +0 -0
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/screenshot-design.md +0 -0
- /package/src/template/design-system/{.claude → .gemini}/commands/design-os/shape-section.md +0 -0
- /package/src/template/design-system/{claude.md → gemini.md} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Motion Design
|
|
2
|
+
|
|
3
|
+
## Duration: The 100/300/500 Rule
|
|
4
|
+
|
|
5
|
+
Timing matters more than easing. These durations feel right for most UI:
|
|
6
|
+
|
|
7
|
+
| Duration | Use Case | Examples |
|
|
8
|
+
|----------|----------|----------|
|
|
9
|
+
| **100-150ms** | Instant feedback | Button press, toggle, color change |
|
|
10
|
+
| **200-300ms** | State changes | Menu open, tooltip, hover states |
|
|
11
|
+
| **300-500ms** | Layout changes | Accordion, modal, drawer |
|
|
12
|
+
| **500-800ms** | Entrance animations | Page load, hero reveals |
|
|
13
|
+
|
|
14
|
+
**Exit animations are faster than entrances**—use ~75% of enter duration.
|
|
15
|
+
|
|
16
|
+
## Easing: Pick the Right Curve
|
|
17
|
+
|
|
18
|
+
**Don't use `ease`.** It's a compromise that's rarely optimal. Instead:
|
|
19
|
+
|
|
20
|
+
| Curve | Use For | CSS |
|
|
21
|
+
|-------|---------|-----|
|
|
22
|
+
| **ease-out** | Elements entering | `cubic-bezier(0.16, 1, 0.3, 1)` |
|
|
23
|
+
| **ease-in** | Elements leaving | `cubic-bezier(0.7, 0, 0.84, 0)` |
|
|
24
|
+
| **ease-in-out** | State toggles (there → back) | `cubic-bezier(0.65, 0, 0.35, 1)` |
|
|
25
|
+
|
|
26
|
+
**For micro-interactions, use exponential curves**—they feel natural because they mimic real physics (friction, deceleration):
|
|
27
|
+
|
|
28
|
+
```css
|
|
29
|
+
/* Quart out - smooth, refined (recommended default) */
|
|
30
|
+
--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
|
|
31
|
+
|
|
32
|
+
/* Quint out - slightly more dramatic */
|
|
33
|
+
--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
|
|
34
|
+
|
|
35
|
+
/* Expo out - snappy, confident */
|
|
36
|
+
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Avoid bounce and elastic curves.** They were trendy in 2015 but now feel tacky and amateurish. Real objects don't bounce when they stop—they decelerate smoothly. Overshoot effects draw attention to the animation itself rather than the content.
|
|
40
|
+
|
|
41
|
+
## The Only Two Properties You Should Animate
|
|
42
|
+
|
|
43
|
+
**transform** and **opacity** only—everything else causes layout recalculation. For height animations (accordions), use `grid-template-rows: 0fr → 1fr` instead of animating `height` directly.
|
|
44
|
+
|
|
45
|
+
## Staggered Animations
|
|
46
|
+
|
|
47
|
+
Use CSS custom properties for cleaner stagger: `animation-delay: calc(var(--i, 0) * 50ms)` with `style="--i: 0"` on each item. **Cap total stagger time**—10 items at 50ms = 500ms total. For many items, reduce per-item delay or cap staggered count.
|
|
48
|
+
|
|
49
|
+
## Reduced Motion
|
|
50
|
+
|
|
51
|
+
This is not optional. Vestibular disorders affect ~35% of adults over 40.
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
/* Define animations normally */
|
|
55
|
+
.card {
|
|
56
|
+
animation: slide-up 500ms ease-out;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Provide alternative for reduced motion */
|
|
60
|
+
@media (prefers-reduced-motion: reduce) {
|
|
61
|
+
.card {
|
|
62
|
+
animation: fade-in 200ms ease-out; /* Crossfade instead of motion */
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Or disable entirely */
|
|
67
|
+
@media (prefers-reduced-motion: reduce) {
|
|
68
|
+
*, *::before, *::after {
|
|
69
|
+
animation-duration: 0.01ms !important;
|
|
70
|
+
transition-duration: 0.01ms !important;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**What to preserve**: Functional animations like progress bars, loading spinners (slowed down), and focus indicators should still work—just without spatial movement.
|
|
76
|
+
|
|
77
|
+
## Perceived Performance
|
|
78
|
+
|
|
79
|
+
**Nobody cares how fast your site is—just how fast it feels.** Perception can be as effective as actual performance.
|
|
80
|
+
|
|
81
|
+
**The 80ms threshold**: Our brains buffer sensory input for ~80ms to synchronize perception. Anything under 80ms feels instant and simultaneous. This is your target for micro-interactions.
|
|
82
|
+
|
|
83
|
+
**Active vs passive time**: Passive waiting (staring at a spinner) feels longer than active engagement. Strategies to shift the balance:
|
|
84
|
+
|
|
85
|
+
- **Preemptive start**: Begin transitions immediately while loading (iOS app zoom, skeleton UI). Users perceive work happening.
|
|
86
|
+
- **Early completion**: Show content progressively—don't wait for everything. Video buffering, progressive images, streaming HTML.
|
|
87
|
+
- **Optimistic UI**: Update the interface immediately, handle failures gracefully. Instagram likes work offline—the UI updates instantly, syncs later. Use for low-stakes actions; avoid for payments or destructive operations.
|
|
88
|
+
|
|
89
|
+
**Easing affects perceived duration**: Ease-in (accelerating toward completion) makes tasks feel shorter because the peak-end effect weights final moments heavily. Ease-out feels satisfying for entrances, but ease-in toward a task's end compresses perceived time.
|
|
90
|
+
|
|
91
|
+
**Caution**: Too-fast responses can decrease perceived value. Users may distrust instant results for complex operations (search, analysis). Sometimes a brief delay signals "real work" is happening.
|
|
92
|
+
|
|
93
|
+
## Performance
|
|
94
|
+
|
|
95
|
+
Don't use `will-change` preemptively—only when animation is imminent (`:hover`, `.animating`). For scroll-triggered animations, use Intersection Observer instead of scroll events; unobserve after animating once. Create motion tokens for consistency (durations, easings, common transitions).
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
**Avoid**: Animating everything (animation fatigue is real). Using >500ms for UI feedback. Ignoring `prefers-reduced-motion`. Using animation to hide slow loading.
|
package/src/template/design-system/.gemini/skills/frontend-design/reference/responsive-design.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Responsive Design
|
|
2
|
+
|
|
3
|
+
## Mobile-First: Write It Right
|
|
4
|
+
|
|
5
|
+
Start with base styles for mobile, use `min-width` queries to layer complexity. Desktop-first (`max-width`) means mobile loads unnecessary styles first.
|
|
6
|
+
|
|
7
|
+
## Breakpoints: Content-Driven
|
|
8
|
+
|
|
9
|
+
Don't chase device sizes—let content tell you where to break. Start narrow, stretch until design breaks, add breakpoint there. Three breakpoints usually suffice (640, 768, 1024px). Use `clamp()` for fluid values without breakpoints.
|
|
10
|
+
|
|
11
|
+
## Detect Input Method, Not Just Screen Size
|
|
12
|
+
|
|
13
|
+
**Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard—use pointer and hover queries:
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
/* Fine pointer (mouse, trackpad) */
|
|
17
|
+
@media (pointer: fine) {
|
|
18
|
+
.button { padding: 8px 16px; }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Coarse pointer (touch, stylus) */
|
|
22
|
+
@media (pointer: coarse) {
|
|
23
|
+
.button { padding: 12px 20px; } /* Larger touch target */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Device supports hover */
|
|
27
|
+
@media (hover: hover) {
|
|
28
|
+
.card:hover { transform: translateY(-2px); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Device doesn't support hover (touch) */
|
|
32
|
+
@media (hover: none) {
|
|
33
|
+
.card { /* No hover state - use active instead */ }
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Critical**: Don't rely on hover for functionality. Touch users can't hover.
|
|
38
|
+
|
|
39
|
+
## Safe Areas: Handle the Notch
|
|
40
|
+
|
|
41
|
+
Modern phones have notches, rounded corners, and home indicators. Use `env()`:
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
body {
|
|
45
|
+
padding-top: env(safe-area-inset-top);
|
|
46
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
47
|
+
padding-left: env(safe-area-inset-left);
|
|
48
|
+
padding-right: env(safe-area-inset-right);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* With fallback */
|
|
52
|
+
.footer {
|
|
53
|
+
padding-bottom: max(1rem, env(safe-area-inset-bottom));
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Enable viewport-fit** in your meta tag:
|
|
58
|
+
```html
|
|
59
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Responsive Images: Get It Right
|
|
63
|
+
|
|
64
|
+
### srcset with Width Descriptors
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<img
|
|
68
|
+
src="hero-800.jpg"
|
|
69
|
+
srcset="
|
|
70
|
+
hero-400.jpg 400w,
|
|
71
|
+
hero-800.jpg 800w,
|
|
72
|
+
hero-1200.jpg 1200w
|
|
73
|
+
"
|
|
74
|
+
sizes="(max-width: 768px) 100vw, 50vw"
|
|
75
|
+
alt="Hero image"
|
|
76
|
+
>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**How it works**:
|
|
80
|
+
- `srcset` lists available images with their actual widths (`w` descriptors)
|
|
81
|
+
- `sizes` tells the browser how wide the image will display
|
|
82
|
+
- Browser picks the best file based on viewport width AND device pixel ratio
|
|
83
|
+
|
|
84
|
+
### Picture Element for Art Direction
|
|
85
|
+
|
|
86
|
+
When you need different crops/compositions (not just resolutions):
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<picture>
|
|
90
|
+
<source media="(min-width: 768px)" srcset="wide.jpg">
|
|
91
|
+
<source media="(max-width: 767px)" srcset="tall.jpg">
|
|
92
|
+
<img src="fallback.jpg" alt="...">
|
|
93
|
+
</picture>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Layout Adaptation Patterns
|
|
97
|
+
|
|
98
|
+
**Navigation**: Three stages—hamburger + drawer on mobile, horizontal compact on tablet, full with labels on desktop. **Tables**: Transform to cards on mobile using `display: block` and `data-label` attributes. **Progressive disclosure**: Use `<details>/<summary>` for content that can collapse on mobile.
|
|
99
|
+
|
|
100
|
+
## Testing: Don't Trust DevTools Alone
|
|
101
|
+
|
|
102
|
+
DevTools device emulation is useful for layout but misses:
|
|
103
|
+
|
|
104
|
+
- Actual touch interactions
|
|
105
|
+
- Real CPU/memory constraints
|
|
106
|
+
- Network latency patterns
|
|
107
|
+
- Font rendering differences
|
|
108
|
+
- Browser chrome/keyboard appearances
|
|
109
|
+
|
|
110
|
+
**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
**Avoid**: Desktop-first design. Device detection instead of feature detection. Separate mobile/desktop codebases. Ignoring tablet and landscape. Assuming all mobile devices are powerful.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Spatial Design
|
|
2
|
+
|
|
3
|
+
## Spacing Systems
|
|
4
|
+
|
|
5
|
+
### Use 4pt Base, Not 8pt
|
|
6
|
+
|
|
7
|
+
8pt systems are too coarse—you'll frequently need 12px (between 8 and 16). Use 4pt for granularity: 4, 8, 12, 16, 24, 32, 48, 64, 96px.
|
|
8
|
+
|
|
9
|
+
### Name Tokens Semantically
|
|
10
|
+
|
|
11
|
+
Name by relationship (`--space-sm`, `--space-lg`), not value (`--spacing-8`). Use `gap` instead of margins for sibling spacing—it eliminates margin collapse and cleanup hacks.
|
|
12
|
+
|
|
13
|
+
## Grid Systems
|
|
14
|
+
|
|
15
|
+
### The Self-Adjusting Grid
|
|
16
|
+
|
|
17
|
+
Use `repeat(auto-fit, minmax(280px, 1fr))` for responsive grids without breakpoints. Columns are at least 280px, as many as fit per row, leftovers stretch. For complex layouts, use named grid areas (`grid-template-areas`) and redefine them at breakpoints.
|
|
18
|
+
|
|
19
|
+
## Visual Hierarchy
|
|
20
|
+
|
|
21
|
+
### The Squint Test
|
|
22
|
+
|
|
23
|
+
Blur your eyes (or screenshot and blur). Can you still identify:
|
|
24
|
+
- The most important element?
|
|
25
|
+
- The second most important?
|
|
26
|
+
- Clear groupings?
|
|
27
|
+
|
|
28
|
+
If everything looks the same weight blurred, you have a hierarchy problem.
|
|
29
|
+
|
|
30
|
+
### Hierarchy Through Multiple Dimensions
|
|
31
|
+
|
|
32
|
+
Don't rely on size alone. Combine:
|
|
33
|
+
|
|
34
|
+
| Tool | Strong Hierarchy | Weak Hierarchy |
|
|
35
|
+
|------|------------------|----------------|
|
|
36
|
+
| **Size** | 3:1 ratio or more | <2:1 ratio |
|
|
37
|
+
| **Weight** | Bold vs Regular | Medium vs Regular |
|
|
38
|
+
| **Color** | High contrast | Similar tones |
|
|
39
|
+
| **Position** | Top/left (primary) | Bottom/right |
|
|
40
|
+
| **Space** | Surrounded by white space | Crowded |
|
|
41
|
+
|
|
42
|
+
**The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
|
|
43
|
+
|
|
44
|
+
### Cards Are Not Required
|
|
45
|
+
|
|
46
|
+
Cards are overused. Spacing and alignment create visual grouping naturally. Use cards only when content is truly distinct and actionable, items need visual comparison in a grid, or content needs clear interaction boundaries. **Never nest cards inside cards**—use spacing, typography, and subtle dividers for hierarchy within a card.
|
|
47
|
+
|
|
48
|
+
## Container Queries
|
|
49
|
+
|
|
50
|
+
Viewport queries are for page layouts. **Container queries are for components**:
|
|
51
|
+
|
|
52
|
+
```css
|
|
53
|
+
.card-container {
|
|
54
|
+
container-type: inline-size;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.card {
|
|
58
|
+
display: grid;
|
|
59
|
+
gap: var(--space-md);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Card layout changes based on its container, not viewport */
|
|
63
|
+
@container (min-width: 400px) {
|
|
64
|
+
.card {
|
|
65
|
+
grid-template-columns: 120px 1fr;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
|
|
71
|
+
|
|
72
|
+
## Optical Adjustments
|
|
73
|
+
|
|
74
|
+
Text at `margin-left: 0` looks indented due to letterform whitespace—use negative margin (`-0.05em`) to optically align. Geometrically centered icons often look off-center; play icons need to shift right, arrows shift toward their direction.
|
|
75
|
+
|
|
76
|
+
### Touch Targets vs Visual Size
|
|
77
|
+
|
|
78
|
+
Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
|
|
79
|
+
|
|
80
|
+
```css
|
|
81
|
+
.icon-button {
|
|
82
|
+
width: 24px; /* Visual size */
|
|
83
|
+
height: 24px;
|
|
84
|
+
position: relative;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.icon-button::before {
|
|
88
|
+
content: '';
|
|
89
|
+
position: absolute;
|
|
90
|
+
inset: -10px; /* Expand tap target to 44px */
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Depth & Elevation
|
|
95
|
+
|
|
96
|
+
Create semantic z-index scales (dropdown → sticky → modal-backdrop → modal → toast → tooltip) instead of arbitrary numbers. For shadows, create a consistent elevation scale (sm → md → lg → xl). **Key insight**: Shadows should be subtle—if you can clearly see it, it's probably too strong.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
**Avoid**: Arbitrary spacing values outside your scale. Making all spacing equal (variety creates hierarchy). Creating hierarchy through size alone - combine size, weight, color, and space.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
## Classic Typography Principles
|
|
4
|
+
|
|
5
|
+
### Vertical Rhythm
|
|
6
|
+
|
|
7
|
+
Your line-height should be the base unit for ALL vertical spacing. If body text has `line-height: 1.5` on `16px` type (= 24px), spacing values should be multiples of 24px. This creates subconscious harmony—text and space share a mathematical foundation.
|
|
8
|
+
|
|
9
|
+
### Modular Scale & Hierarchy
|
|
10
|
+
|
|
11
|
+
The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
|
|
12
|
+
|
|
13
|
+
**Use fewer sizes with more contrast.** A 5-size system covers most needs:
|
|
14
|
+
|
|
15
|
+
| Role | Typical Ratio | Use Case |
|
|
16
|
+
|------|---------------|----------|
|
|
17
|
+
| xs | 0.75rem | Captions, legal |
|
|
18
|
+
| sm | 0.875rem | Secondary UI, metadata |
|
|
19
|
+
| base | 1rem | Body text |
|
|
20
|
+
| lg | 1.25-1.5rem | Subheadings, lead text |
|
|
21
|
+
| xl+ | 2-4rem | Headlines, hero text |
|
|
22
|
+
|
|
23
|
+
Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
|
|
24
|
+
|
|
25
|
+
### Readability & Measure
|
|
26
|
+
|
|
27
|
+
Use `ch` units for character-based measure (`max-width: 65ch`). Line-height scales inversely with line length—narrow columns need tighter leading, wide columns need more.
|
|
28
|
+
|
|
29
|
+
**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
|
|
30
|
+
|
|
31
|
+
## Font Selection & Pairing
|
|
32
|
+
|
|
33
|
+
### Choosing Distinctive Fonts
|
|
34
|
+
|
|
35
|
+
**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
|
|
36
|
+
|
|
37
|
+
**Better Google Fonts alternatives**:
|
|
38
|
+
- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
|
|
39
|
+
- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
|
|
40
|
+
- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
|
|
41
|
+
- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
|
|
42
|
+
|
|
43
|
+
**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
|
|
44
|
+
|
|
45
|
+
### Pairing Principles
|
|
46
|
+
|
|
47
|
+
**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
|
|
48
|
+
|
|
49
|
+
When pairing, contrast on multiple axes:
|
|
50
|
+
- Serif + Sans (structure contrast)
|
|
51
|
+
- Geometric + Humanist (personality contrast)
|
|
52
|
+
- Condensed display + Wide body (proportion contrast)
|
|
53
|
+
|
|
54
|
+
**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
|
|
55
|
+
|
|
56
|
+
### Web Font Loading
|
|
57
|
+
|
|
58
|
+
The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
/* 1. Use font-display: swap for visibility */
|
|
62
|
+
@font-face {
|
|
63
|
+
font-family: 'CustomFont';
|
|
64
|
+
src: url('font.woff2') format('woff2');
|
|
65
|
+
font-display: swap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* 2. Match fallback metrics to minimize shift */
|
|
69
|
+
@font-face {
|
|
70
|
+
font-family: 'CustomFont-Fallback';
|
|
71
|
+
src: local('Arial');
|
|
72
|
+
size-adjust: 105%; /* Scale to match x-height */
|
|
73
|
+
ascent-override: 90%; /* Match ascender height */
|
|
74
|
+
descent-override: 20%; /* Match descender depth */
|
|
75
|
+
line-gap-override: 10%; /* Match line spacing */
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
body {
|
|
79
|
+
font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
|
|
84
|
+
|
|
85
|
+
## Modern Web Typography
|
|
86
|
+
|
|
87
|
+
### Fluid Type
|
|
88
|
+
|
|
89
|
+
Use `clamp(min, preferred, max)` for fluid typography. The middle value (e.g., `5vw + 1rem`) controls scaling rate—higher vw = faster scaling. Add a rem offset so it doesn't collapse to 0 on small screens.
|
|
90
|
+
|
|
91
|
+
**When NOT to use fluid type**: Button text, labels, UI elements (should be consistent), very short text, or when you need precise breakpoint control.
|
|
92
|
+
|
|
93
|
+
### OpenType Features
|
|
94
|
+
|
|
95
|
+
Most developers don't know these exist. Use them for polish:
|
|
96
|
+
|
|
97
|
+
```css
|
|
98
|
+
/* Tabular numbers for data alignment */
|
|
99
|
+
.data-table { font-variant-numeric: tabular-nums; }
|
|
100
|
+
|
|
101
|
+
/* Proper fractions */
|
|
102
|
+
.recipe-amount { font-variant-numeric: diagonal-fractions; }
|
|
103
|
+
|
|
104
|
+
/* Small caps for abbreviations */
|
|
105
|
+
abbr { font-variant-caps: all-small-caps; }
|
|
106
|
+
|
|
107
|
+
/* Disable ligatures in code */
|
|
108
|
+
code { font-variant-ligatures: none; }
|
|
109
|
+
|
|
110
|
+
/* Enable kerning (usually on by default, but be explicit) */
|
|
111
|
+
body { font-kerning: normal; }
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
|
|
115
|
+
|
|
116
|
+
## Typography System Architecture
|
|
117
|
+
|
|
118
|
+
Name tokens semantically (`--text-body`, `--text-heading`), not by value (`--font-size-16`). Include font stacks, size scale, weights, line-heights, and letter-spacing in your token system.
|
|
119
|
+
|
|
120
|
+
## Accessibility Considerations
|
|
121
|
+
|
|
122
|
+
Beyond contrast ratios (which are well-documented), consider:
|
|
123
|
+
|
|
124
|
+
- **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
|
|
125
|
+
- **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
|
|
126
|
+
- **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
|
|
127
|
+
- **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
**Avoid**: More than 2-3 font families per project. Skipping fallback font definitions. Ignoring font loading performance (FOUT/FOIT). Using decorative fonts for body text.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# UX Writing
|
|
2
|
+
|
|
3
|
+
## The Button Label Problem
|
|
4
|
+
|
|
5
|
+
**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
|
|
6
|
+
|
|
7
|
+
| Bad | Good | Why |
|
|
8
|
+
|-----|------|-----|
|
|
9
|
+
| OK | Save changes | Says what will happen |
|
|
10
|
+
| Submit | Create account | Outcome-focused |
|
|
11
|
+
| Yes | Delete message | Confirms the action |
|
|
12
|
+
| Cancel | Keep editing | Clarifies what "cancel" means |
|
|
13
|
+
| Click here | Download PDF | Describes the destination |
|
|
14
|
+
|
|
15
|
+
**For destructive actions**, name the destruction:
|
|
16
|
+
- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
|
|
17
|
+
- "Delete 5 items" not "Delete selected" (show the count)
|
|
18
|
+
|
|
19
|
+
## Error Messages: The Formula
|
|
20
|
+
|
|
21
|
+
Every error message should answer: (1) What happened? (2) Why? (3) How to fix it? Example: "Email address isn't valid. Please include an @ symbol." not "Invalid input".
|
|
22
|
+
|
|
23
|
+
### Error Message Templates
|
|
24
|
+
|
|
25
|
+
| Situation | Template |
|
|
26
|
+
|-----------|----------|
|
|
27
|
+
| **Format error** | "[Field] needs to be [format]. Example: [example]" |
|
|
28
|
+
| **Missing required** | "Please enter [what's missing]" |
|
|
29
|
+
| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
|
|
30
|
+
| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
|
|
31
|
+
| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
|
|
32
|
+
|
|
33
|
+
### Don't Blame the User
|
|
34
|
+
|
|
35
|
+
Reframe errors: "Please enter a date in MM/DD/YYYY format" not "You entered an invalid date".
|
|
36
|
+
|
|
37
|
+
## Empty States Are Opportunities
|
|
38
|
+
|
|
39
|
+
Empty states are onboarding moments: (1) Acknowledge briefly, (2) Explain the value of filling it, (3) Provide a clear action. "No projects yet. Create your first one to get started." not just "No items".
|
|
40
|
+
|
|
41
|
+
## Voice vs Tone
|
|
42
|
+
|
|
43
|
+
**Voice** is your brand's personality—consistent everywhere.
|
|
44
|
+
**Tone** adapts to the moment.
|
|
45
|
+
|
|
46
|
+
| Moment | Tone Shift |
|
|
47
|
+
|--------|------------|
|
|
48
|
+
| Success | Celebratory, brief: "Done! Your changes are live." |
|
|
49
|
+
| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
|
|
50
|
+
| Loading | Reassuring: "Saving your work..." |
|
|
51
|
+
| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
|
|
52
|
+
|
|
53
|
+
**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
|
|
54
|
+
|
|
55
|
+
## Writing for Accessibility
|
|
56
|
+
|
|
57
|
+
**Link text** must have standalone meaning—"View pricing plans" not "Click here". **Alt text** describes information, not the image—"Revenue increased 40% in Q4" not "Chart". Use `alt=""` for decorative images. **Icon buttons** need `aria-label` for screen reader context.
|
|
58
|
+
|
|
59
|
+
## Writing for Translation
|
|
60
|
+
|
|
61
|
+
### Plan for Expansion
|
|
62
|
+
|
|
63
|
+
German text is ~30% longer than English. Allocate space:
|
|
64
|
+
|
|
65
|
+
| Language | Expansion |
|
|
66
|
+
|----------|-----------|
|
|
67
|
+
| German | +30% |
|
|
68
|
+
| French | +20% |
|
|
69
|
+
| Finnish | +30-40% |
|
|
70
|
+
| Chinese | -30% (fewer chars, but same width) |
|
|
71
|
+
|
|
72
|
+
### Translation-Friendly Patterns
|
|
73
|
+
|
|
74
|
+
Keep numbers separate ("New messages: 3" not "You have 3 new messages"). Use full sentences as single strings (word order varies by language). Avoid abbreviations ("5 minutes ago" not "5 mins ago"). Give translators context about where strings appear.
|
|
75
|
+
|
|
76
|
+
## Consistency: The Terminology Problem
|
|
77
|
+
|
|
78
|
+
Pick one term and stick with it:
|
|
79
|
+
|
|
80
|
+
| Inconsistent | Consistent |
|
|
81
|
+
|--------------|------------|
|
|
82
|
+
| Delete / Remove / Trash | Delete |
|
|
83
|
+
| Settings / Preferences / Options | Settings |
|
|
84
|
+
| Sign in / Log in / Enter | Sign in |
|
|
85
|
+
| Create / Add / New | Create |
|
|
86
|
+
|
|
87
|
+
Build a terminology glossary and enforce it. Variety creates confusion.
|
|
88
|
+
|
|
89
|
+
## Avoid Redundant Copy
|
|
90
|
+
|
|
91
|
+
If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
|
|
92
|
+
|
|
93
|
+
## Loading States
|
|
94
|
+
|
|
95
|
+
Be specific: "Saving your draft..." not "Loading...". For long waits, set expectations ("This usually takes 30 seconds") or show progress.
|
|
96
|
+
|
|
97
|
+
## Confirmation Dialogs: Use Sparingly
|
|
98
|
+
|
|
99
|
+
Most confirmation dialogs are design failures—consider undo instead. When you must confirm: name the action, explain consequences, use specific button labels ("Delete project" / "Keep project", not "Yes" / "No").
|
|
100
|
+
|
|
101
|
+
## Form Instructions
|
|
102
|
+
|
|
103
|
+
Show format with placeholders, not instructions. For non-obvious fields, explain why you're asking.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
**Avoid**: Jargon without explanation. Blaming users ("You made an error" → "This field is required"). Vague errors ("Something went wrong"). Varying terminology for variety. Humor for errors.
|
|
@@ -239,6 +239,81 @@ export function DesignPage() {
|
|
|
239
239
|
)}
|
|
240
240
|
</StepIndicator>
|
|
241
241
|
|
|
242
|
+
{/* Impeccable QA Commands - Always visible */}
|
|
243
|
+
<Card className="border-stone-200 dark:border-stone-700 shadow-sm mt-8">
|
|
244
|
+
<CardHeader className="pb-4">
|
|
245
|
+
<CardTitle className="text-lg font-semibold text-stone-900 dark:text-stone-100 flex items-center gap-2">
|
|
246
|
+
<span className="text-xl">✨</span> Impeccable Commands
|
|
247
|
+
</CardTitle>
|
|
248
|
+
<p className="text-sm text-stone-500 dark:text-stone-400">
|
|
249
|
+
Quality commands that transform your designs. Auto-audit runs after each design step.
|
|
250
|
+
</p>
|
|
251
|
+
</CardHeader>
|
|
252
|
+
<CardContent className="space-y-4">
|
|
253
|
+
{/* Diagnose */}
|
|
254
|
+
<div>
|
|
255
|
+
<h4 className="text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide mb-2">
|
|
256
|
+
🔍 Diagnose
|
|
257
|
+
</h4>
|
|
258
|
+
<div className="grid grid-cols-2 gap-2">
|
|
259
|
+
<CommandCard
|
|
260
|
+
name="/audit"
|
|
261
|
+
description="Comprehensive quality audit"
|
|
262
|
+
leads={["/normalize", "/harden", "/optimize"]}
|
|
263
|
+
/>
|
|
264
|
+
<CommandCard
|
|
265
|
+
name="/critique"
|
|
266
|
+
description="UX evaluation"
|
|
267
|
+
leads={["/polish", "/simplify", "/bolder"]}
|
|
268
|
+
/>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
|
|
272
|
+
{/* Quality */}
|
|
273
|
+
<div>
|
|
274
|
+
<h4 className="text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide mb-2">
|
|
275
|
+
✅ Quality
|
|
276
|
+
</h4>
|
|
277
|
+
<div className="grid grid-cols-4 gap-2">
|
|
278
|
+
<CommandCard name="/normalize" description="Design system consistency" />
|
|
279
|
+
<CommandCard name="/harden" description="Resilience & edge cases" />
|
|
280
|
+
<CommandCard name="/optimize" description="Performance" />
|
|
281
|
+
<CommandCard name="/polish" description="Final details" />
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
{/* Intensity */}
|
|
286
|
+
<div>
|
|
287
|
+
<h4 className="text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide mb-2">
|
|
288
|
+
🎚️ Intensity
|
|
289
|
+
</h4>
|
|
290
|
+
<div className="grid grid-cols-2 gap-2">
|
|
291
|
+
<CommandCard name="/bolder" description="Amplify safe designs" />
|
|
292
|
+
<CommandCard name="/quieter" description="Tone down aggressive designs" />
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
{/* Enhancement */}
|
|
297
|
+
<div>
|
|
298
|
+
<h4 className="text-xs font-medium text-stone-500 dark:text-stone-400 uppercase tracking-wide mb-2">
|
|
299
|
+
✨ Enhancement
|
|
300
|
+
</h4>
|
|
301
|
+
<div className="grid grid-cols-3 gap-2">
|
|
302
|
+
<CommandCard name="/animate" description="Add motion" />
|
|
303
|
+
<CommandCard name="/colorize" description="Add strategic color" />
|
|
304
|
+
<CommandCard name="/delight" description="Add moments of joy" />
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
{/* Workflow hint */}
|
|
309
|
+
<div className="bg-stone-100 dark:bg-stone-800 rounded-md px-4 py-2.5">
|
|
310
|
+
<p className="text-xs text-stone-500 dark:text-stone-400">
|
|
311
|
+
See <code className="font-mono text-stone-700 dark:text-stone-300">.gemini/commands/impeccable/WORKFLOW.md</code> for command relationships
|
|
312
|
+
</p>
|
|
313
|
+
</div>
|
|
314
|
+
</CardContent>
|
|
315
|
+
</Card>
|
|
316
|
+
|
|
242
317
|
{/* Next Phase Button - shown when all steps complete */}
|
|
243
318
|
{allStepsComplete && (
|
|
244
319
|
<StepIndicator step={3} status="current" isLast>
|
|
@@ -282,3 +357,32 @@ function ColorSwatch({ label, colorName }: ColorSwatchProps) {
|
|
|
282
357
|
</div>
|
|
283
358
|
)
|
|
284
359
|
}
|
|
360
|
+
|
|
361
|
+
interface CommandCardProps {
|
|
362
|
+
name: string
|
|
363
|
+
description: string
|
|
364
|
+
leads?: string[]
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function CommandCard({ name, description, leads }: CommandCardProps) {
|
|
368
|
+
const copyCommand = () => {
|
|
369
|
+
navigator.clipboard.writeText(`Antigravity, run ${name}. Read '.gemini/commands/impeccable/${name.slice(1)}.md'.`)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return (
|
|
373
|
+
<button
|
|
374
|
+
onClick={copyCommand}
|
|
375
|
+
className="text-left p-3 rounded-lg border border-stone-200 dark:border-stone-700 bg-white dark:bg-stone-800 hover:border-stone-400 dark:hover:border-stone-500 transition-all group"
|
|
376
|
+
>
|
|
377
|
+
<code className="text-sm font-mono font-semibold text-stone-900 dark:text-stone-100 group-hover:text-violet-600 dark:group-hover:text-violet-400">
|
|
378
|
+
{name}
|
|
379
|
+
</code>
|
|
380
|
+
<p className="text-xs text-stone-500 dark:text-stone-400 mt-1">{description}</p>
|
|
381
|
+
{leads && leads.length > 0 && (
|
|
382
|
+
<p className="text-[10px] text-stone-400 dark:text-stone-500 mt-1">
|
|
383
|
+
→ {leads.join(', ')}
|
|
384
|
+
</p>
|
|
385
|
+
)}
|
|
386
|
+
</button>
|
|
387
|
+
)
|
|
388
|
+
}
|