codingbuddy-rules 4.4.0 → 5.0.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/.ai-rules/adapters/antigravity.md +6 -6
- package/.ai-rules/adapters/claude-code.md +107 -4
- package/.ai-rules/adapters/codex.md +5 -5
- package/.ai-rules/adapters/cursor.md +2 -2
- package/.ai-rules/adapters/kiro.md +8 -8
- package/.ai-rules/adapters/opencode.md +7 -7
- package/.ai-rules/adapters/q.md +2 -2
- package/.ai-rules/agents/README.md +66 -16
- package/.ai-rules/agents/accessibility-specialist.json +2 -1
- package/.ai-rules/agents/act-mode.json +2 -1
- package/.ai-rules/agents/agent-architect.json +8 -7
- package/.ai-rules/agents/ai-ml-engineer.json +1 -0
- package/.ai-rules/agents/architecture-specialist.json +1 -0
- package/.ai-rules/agents/auto-mode.json +4 -2
- package/.ai-rules/agents/backend-developer.json +1 -0
- package/.ai-rules/agents/code-quality-specialist.json +1 -0
- package/.ai-rules/agents/code-reviewer.json +65 -64
- package/.ai-rules/agents/data-engineer.json +8 -7
- package/.ai-rules/agents/data-scientist.json +10 -9
- package/.ai-rules/agents/devops-engineer.json +1 -0
- package/.ai-rules/agents/documentation-specialist.json +1 -0
- package/.ai-rules/agents/eval-mode.json +20 -19
- package/.ai-rules/agents/event-architecture-specialist.json +1 -0
- package/.ai-rules/agents/frontend-developer.json +1 -0
- package/.ai-rules/agents/i18n-specialist.json +2 -1
- package/.ai-rules/agents/integration-specialist.json +1 -0
- package/.ai-rules/agents/migration-specialist.json +1 -0
- package/.ai-rules/agents/mobile-developer.json +8 -7
- package/.ai-rules/agents/observability-specialist.json +1 -0
- package/.ai-rules/agents/parallel-orchestrator.json +346 -0
- package/.ai-rules/agents/performance-specialist.json +1 -0
- package/.ai-rules/agents/plan-mode.json +3 -1
- package/.ai-rules/agents/plan-reviewer.json +208 -0
- package/.ai-rules/agents/platform-engineer.json +1 -0
- package/.ai-rules/agents/security-engineer.json +9 -8
- package/.ai-rules/agents/security-specialist.json +2 -1
- package/.ai-rules/agents/seo-specialist.json +1 -0
- package/.ai-rules/agents/software-engineer.json +1 -0
- package/.ai-rules/agents/solution-architect.json +11 -10
- package/.ai-rules/agents/systems-developer.json +9 -8
- package/.ai-rules/agents/technical-planner.json +11 -10
- package/.ai-rules/agents/test-engineer.json +7 -6
- package/.ai-rules/agents/test-strategy-specialist.json +1 -0
- package/.ai-rules/agents/tooling-engineer.json +4 -3
- package/.ai-rules/agents/ui-ux-designer.json +1 -0
- package/.ai-rules/keyword-modes.json +4 -4
- package/.ai-rules/rules/clarification-guide.md +14 -14
- package/.ai-rules/rules/core.md +90 -1
- package/.ai-rules/rules/parallel-execution.md +217 -0
- package/.ai-rules/skills/README.md +23 -1
- package/.ai-rules/skills/agent-design/SKILL.md +5 -0
- package/.ai-rules/skills/agent-design/examples/agent-template.json +58 -0
- package/.ai-rules/skills/agent-design/references/expertise-guidelines.md +112 -0
- package/.ai-rules/skills/agent-discussion/SKILL.md +199 -0
- package/.ai-rules/skills/agent-discussion-panel/SKILL.md +448 -0
- package/.ai-rules/skills/api-design/SKILL.md +5 -0
- package/.ai-rules/skills/api-design/examples/error-response.json +159 -0
- package/.ai-rules/skills/api-design/examples/openapi-template.yaml +393 -0
- package/.ai-rules/skills/build-fix/SKILL.md +234 -0
- package/.ai-rules/skills/code-explanation/SKILL.md +4 -0
- package/.ai-rules/skills/context-management/SKILL.md +1 -0
- package/.ai-rules/skills/cost-budget/SKILL.md +348 -0
- package/.ai-rules/skills/cross-repo-issues/SKILL.md +257 -0
- package/.ai-rules/skills/database-migration/SKILL.md +1 -0
- package/.ai-rules/skills/deepsearch/SKILL.md +214 -0
- package/.ai-rules/skills/deployment-checklist/SKILL.md +1 -0
- package/.ai-rules/skills/error-analysis/SKILL.md +1 -0
- package/.ai-rules/skills/finishing-a-development-branch/SKILL.md +281 -0
- package/.ai-rules/skills/frontend-design/SKILL.md +5 -0
- package/.ai-rules/skills/frontend-design/examples/component-template.tsx +203 -0
- package/.ai-rules/skills/frontend-design/references/css-patterns.md +243 -0
- package/.ai-rules/skills/git-master/SKILL.md +358 -0
- package/.ai-rules/skills/incident-response/SKILL.md +1 -0
- package/.ai-rules/skills/legacy-modernization/SKILL.md +1 -0
- package/.ai-rules/skills/mcp-builder/SKILL.md +7 -0
- package/.ai-rules/skills/mcp-builder/examples/resource-example.ts +233 -0
- package/.ai-rules/skills/mcp-builder/examples/tool-example.ts +203 -0
- package/.ai-rules/skills/mcp-builder/references/protocol-spec.md +215 -0
- package/.ai-rules/skills/performance-optimization/SKILL.md +3 -0
- package/.ai-rules/skills/plan-and-review/SKILL.md +115 -0
- package/.ai-rules/skills/pr-all-in-one/SKILL.md +15 -13
- package/.ai-rules/skills/pr-all-in-one/configuration-guide.md +7 -7
- package/.ai-rules/skills/pr-all-in-one/pr-templates.md +10 -10
- package/.ai-rules/skills/pr-review/SKILL.md +4 -0
- package/.ai-rules/skills/receiving-code-review/SKILL.md +347 -0
- package/.ai-rules/skills/refactoring/SKILL.md +1 -0
- package/.ai-rules/skills/requesting-code-review/SKILL.md +348 -0
- package/.ai-rules/skills/rule-authoring/SKILL.md +5 -0
- package/.ai-rules/skills/rule-authoring/examples/rule-template.md +142 -0
- package/.ai-rules/skills/rule-authoring/examples/trigger-patterns.md +126 -0
- package/.ai-rules/skills/security-audit/SKILL.md +4 -0
- package/.ai-rules/skills/skill-creator/SKILL.md +461 -0
- package/.ai-rules/skills/skill-creator/agents/analyzer.md +206 -0
- package/.ai-rules/skills/skill-creator/agents/comparator.md +167 -0
- package/.ai-rules/skills/skill-creator/agents/grader.md +152 -0
- package/.ai-rules/skills/skill-creator/assets/eval_review.html +289 -0
- package/.ai-rules/skills/skill-creator/assets/skill-template.md +43 -0
- package/.ai-rules/skills/skill-creator/eval-viewer/generate_review.py +496 -0
- package/.ai-rules/skills/skill-creator/references/frontmatter-guide.md +632 -0
- package/.ai-rules/skills/skill-creator/references/multi-tool-compat.md +480 -0
- package/.ai-rules/skills/skill-creator/references/schemas.md +784 -0
- package/.ai-rules/skills/skill-creator/scripts/aggregate_benchmark.py +302 -0
- package/.ai-rules/skills/skill-creator/scripts/init_skill.sh +196 -0
- package/.ai-rules/skills/skill-creator/scripts/run_loop.py +327 -0
- package/.ai-rules/skills/systematic-debugging/SKILL.md +1 -0
- package/.ai-rules/skills/tech-debt/SKILL.md +1 -0
- package/.ai-rules/skills/test-coverage-gate/SKILL.md +303 -0
- package/.ai-rules/skills/tmux-master/SKILL.md +491 -0
- package/.ai-rules/skills/using-git-worktrees/SKILL.md +368 -0
- package/.ai-rules/skills/verification-before-completion/SKILL.md +234 -0
- package/.ai-rules/skills/widget-slot-architecture/SKILL.md +6 -0
- package/.ai-rules/skills/widget-slot-architecture/examples/parallel-route-setup.tsx +206 -0
- package/.ai-rules/skills/widget-slot-architecture/examples/widget-component.tsx +250 -0
- package/.ai-rules/skills/writing-plans/SKILL.md +78 -0
- package/bin/cli.js +178 -0
- package/lib/init/detect-stack.js +148 -0
- package/lib/init/generate-config.js +31 -0
- package/lib/init/index.js +86 -0
- package/lib/init/prompt.js +60 -0
- package/lib/init/scaffold.js +67 -0
- package/lib/init/suggest-agent.js +46 -0
- package/package.json +10 -2
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distinctive React Component Template
|
|
3
|
+
*
|
|
4
|
+
* This template demonstrates a production-grade React component
|
|
5
|
+
* with intentional design choices that avoid generic AI aesthetics.
|
|
6
|
+
*
|
|
7
|
+
* Key patterns:
|
|
8
|
+
* - CSS variables for theming consistency
|
|
9
|
+
* - Staggered reveal animations
|
|
10
|
+
* - Fluid typography with clamp()
|
|
11
|
+
* - Accessible focus management
|
|
12
|
+
* - Motion library integration (optional)
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { type ReactNode, type HTMLAttributes, forwardRef } from 'react';
|
|
16
|
+
|
|
17
|
+
// ─── Types ───────────────────────────────────────────────
|
|
18
|
+
|
|
19
|
+
interface FeatureCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
/** Card title — displayed as the main heading */
|
|
21
|
+
title: string;
|
|
22
|
+
/** Supporting description text */
|
|
23
|
+
description: string;
|
|
24
|
+
/** Icon or visual element displayed above the title */
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/** Visual variant controlling the color scheme */
|
|
27
|
+
variant?: 'default' | 'accent' | 'muted';
|
|
28
|
+
/** Stagger delay index for entrance animation (0-based) */
|
|
29
|
+
staggerIndex?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ─── Component ───────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
export const FeatureCard = forwardRef<HTMLDivElement, FeatureCardProps>(
|
|
35
|
+
function FeatureCard(
|
|
36
|
+
{
|
|
37
|
+
title,
|
|
38
|
+
description,
|
|
39
|
+
icon,
|
|
40
|
+
variant = 'default',
|
|
41
|
+
staggerIndex = 0,
|
|
42
|
+
className = '',
|
|
43
|
+
style,
|
|
44
|
+
...rest
|
|
45
|
+
},
|
|
46
|
+
ref,
|
|
47
|
+
) {
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
ref={ref}
|
|
51
|
+
className={`feature-card feature-card--${variant} ${className}`}
|
|
52
|
+
style={{
|
|
53
|
+
'--stagger-delay': `${staggerIndex * 0.1}s`,
|
|
54
|
+
...style,
|
|
55
|
+
} as React.CSSProperties}
|
|
56
|
+
{...rest}
|
|
57
|
+
>
|
|
58
|
+
{icon && <div className="feature-card__icon">{icon}</div>}
|
|
59
|
+
<h3 className="feature-card__title">{title}</h3>
|
|
60
|
+
<p className="feature-card__description">{description}</p>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
// ─── Styles (CSS Module or global stylesheet) ────────────
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
Use a separate .module.css file in production. Inline styles shown
|
|
70
|
+
here for template completeness.
|
|
71
|
+
|
|
72
|
+
.feature-card {
|
|
73
|
+
--card-bg: var(--color-surface-raised, hsl(0 0% 98%));
|
|
74
|
+
--card-border: var(--color-border, hsl(0 0% 90%));
|
|
75
|
+
--card-radius: 1rem;
|
|
76
|
+
|
|
77
|
+
position: relative;
|
|
78
|
+
padding: clamp(1.5rem, 3vw, 2.5rem);
|
|
79
|
+
background: var(--card-bg);
|
|
80
|
+
border: 1px solid var(--card-border);
|
|
81
|
+
border-radius: var(--card-radius);
|
|
82
|
+
|
|
83
|
+
/* Staggered entrance animation */
|
|
84
|
+
opacity: 0;
|
|
85
|
+
animation: card-reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
86
|
+
animation-delay: var(--stagger-delay);
|
|
87
|
+
|
|
88
|
+
/* Hover interaction */
|
|
89
|
+
transition:
|
|
90
|
+
transform 0.25s cubic-bezier(0.33, 1, 0.68, 1),
|
|
91
|
+
box-shadow 0.25s ease,
|
|
92
|
+
border-color 0.25s ease;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.feature-card:hover {
|
|
96
|
+
transform: translateY(-4px);
|
|
97
|
+
border-color: var(--color-primary, hsl(230 65% 50%));
|
|
98
|
+
box-shadow:
|
|
99
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.05),
|
|
100
|
+
0 10px 15px -3px rgba(0, 0, 0, 0.07);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.feature-card:active {
|
|
104
|
+
transform: translateY(-1px);
|
|
105
|
+
transition-duration: 0.1s;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.feature-card:focus-visible {
|
|
109
|
+
outline: 2px solid var(--color-primary);
|
|
110
|
+
outline-offset: 3px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* --- Variants --- */
|
|
114
|
+
|
|
115
|
+
.feature-card--accent {
|
|
116
|
+
--card-bg: hsl(var(--hue-accent, 350) 80% 97%);
|
|
117
|
+
--card-border: hsl(var(--hue-accent, 350) 60% 85%);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.feature-card--muted {
|
|
121
|
+
--card-bg: hsl(0 0% 96%);
|
|
122
|
+
--card-border: transparent;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* --- Children --- */
|
|
126
|
+
|
|
127
|
+
.feature-card__icon {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
width: 3rem;
|
|
132
|
+
height: 3rem;
|
|
133
|
+
margin-bottom: 1rem;
|
|
134
|
+
border-radius: 0.75rem;
|
|
135
|
+
background: var(--color-primary-light, hsl(230 65% 95%));
|
|
136
|
+
color: var(--color-primary, hsl(230 65% 50%));
|
|
137
|
+
font-size: 1.25rem;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.feature-card__title {
|
|
141
|
+
margin: 0 0 0.5rem;
|
|
142
|
+
font-family: var(--font-display, 'Playfair Display', serif);
|
|
143
|
+
font-size: clamp(1.125rem, 0.9rem + 0.5vw, 1.375rem);
|
|
144
|
+
font-weight: 700;
|
|
145
|
+
line-height: 1.2;
|
|
146
|
+
letter-spacing: -0.01em;
|
|
147
|
+
color: var(--color-text, hsl(0 0% 12%));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.feature-card__description {
|
|
151
|
+
margin: 0;
|
|
152
|
+
font-family: var(--font-body, 'Source Sans 3', sans-serif);
|
|
153
|
+
font-size: var(--text-base, 1rem);
|
|
154
|
+
line-height: 1.6;
|
|
155
|
+
color: var(--color-text-muted, hsl(0 0% 45%));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* --- Animation --- */
|
|
159
|
+
|
|
160
|
+
@keyframes card-reveal {
|
|
161
|
+
from {
|
|
162
|
+
opacity: 0;
|
|
163
|
+
transform: translateY(1.5rem);
|
|
164
|
+
}
|
|
165
|
+
to {
|
|
166
|
+
opacity: 1;
|
|
167
|
+
transform: translateY(0);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@media (prefers-reduced-motion: reduce) {
|
|
172
|
+
.feature-card {
|
|
173
|
+
animation: none;
|
|
174
|
+
opacity: 1;
|
|
175
|
+
}
|
|
176
|
+
.feature-card:hover {
|
|
177
|
+
transform: none;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
// ─── Usage Example ───────────────────────────────────────
|
|
183
|
+
|
|
184
|
+
/*
|
|
185
|
+
import { FeatureCard } from './FeatureCard';
|
|
186
|
+
import { Zap, Shield, Palette } from 'lucide-react';
|
|
187
|
+
|
|
188
|
+
export function FeaturesSection() {
|
|
189
|
+
const features = [
|
|
190
|
+
{ icon: <Zap />, title: 'Lightning Fast', description: 'Sub-100ms response times.' },
|
|
191
|
+
{ icon: <Shield />, title: 'Secure by Default', description: 'Zero-trust architecture.' },
|
|
192
|
+
{ icon: <Palette />, title: 'Fully Themeable', description: 'CSS variable driven.' },
|
|
193
|
+
];
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<section className="features-grid">
|
|
197
|
+
{features.map((f, i) => (
|
|
198
|
+
<FeatureCard key={f.title} {...f} staggerIndex={i} />
|
|
199
|
+
))}
|
|
200
|
+
</section>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
*/
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# CSS Design Patterns Reference
|
|
2
|
+
|
|
3
|
+
Reusable CSS patterns for building distinctive, production-grade interfaces. These patterns avoid generic "AI slop" aesthetics and prioritize intentional design choices.
|
|
4
|
+
|
|
5
|
+
## Typography Systems
|
|
6
|
+
|
|
7
|
+
### Font Pairing Strategy
|
|
8
|
+
|
|
9
|
+
```css
|
|
10
|
+
/* Display + Body pairing — choose contrast, not similarity */
|
|
11
|
+
:root {
|
|
12
|
+
--font-display: 'Playfair Display', serif; /* Headlines: high personality */
|
|
13
|
+
--font-body: 'Source Sans 3', sans-serif; /* Body: high readability */
|
|
14
|
+
--font-mono: 'JetBrains Mono', monospace; /* Code: developer-friendly */
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Typographic scale (Major Third — ratio 1.25) */
|
|
18
|
+
:root {
|
|
19
|
+
--text-xs: 0.64rem; /* 10.24px */
|
|
20
|
+
--text-sm: 0.8rem; /* 12.8px */
|
|
21
|
+
--text-base: 1rem; /* 16px */
|
|
22
|
+
--text-md: 1.25rem; /* 20px */
|
|
23
|
+
--text-lg: 1.563rem; /* 25px */
|
|
24
|
+
--text-xl: 1.953rem; /* 31.25px */
|
|
25
|
+
--text-2xl: 2.441rem; /* 39px */
|
|
26
|
+
--text-3xl: 3.052rem; /* 48.83px */
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Fluid Typography
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
/* Responsive type that scales smoothly between breakpoints */
|
|
34
|
+
h1 {
|
|
35
|
+
font-size: clamp(2rem, 1rem + 3vw, 4rem);
|
|
36
|
+
line-height: 1.1;
|
|
37
|
+
letter-spacing: -0.02em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
p {
|
|
41
|
+
font-size: clamp(1rem, 0.9rem + 0.25vw, 1.125rem);
|
|
42
|
+
line-height: 1.65;
|
|
43
|
+
max-width: 65ch; /* Optimal reading width */
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Color Systems
|
|
48
|
+
|
|
49
|
+
### HSL-Based Theme Tokens
|
|
50
|
+
|
|
51
|
+
```css
|
|
52
|
+
/* HSL gives intuitive control over lightness/saturation variants */
|
|
53
|
+
:root {
|
|
54
|
+
--hue-primary: 230;
|
|
55
|
+
--hue-accent: 350;
|
|
56
|
+
|
|
57
|
+
--color-primary: hsl(var(--hue-primary), 65%, 50%);
|
|
58
|
+
--color-primary-light: hsl(var(--hue-primary), 65%, 95%);
|
|
59
|
+
--color-primary-dark: hsl(var(--hue-primary), 65%, 30%);
|
|
60
|
+
|
|
61
|
+
--color-accent: hsl(var(--hue-accent), 80%, 55%);
|
|
62
|
+
|
|
63
|
+
--color-surface: hsl(0, 0%, 100%);
|
|
64
|
+
--color-surface-raised: hsl(0, 0%, 98%);
|
|
65
|
+
--color-text: hsl(0, 0%, 12%);
|
|
66
|
+
--color-text-muted: hsl(0, 0%, 45%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Dark mode — adjust lightness, not hue */
|
|
70
|
+
@media (prefers-color-scheme: dark) {
|
|
71
|
+
:root {
|
|
72
|
+
--color-primary: hsl(var(--hue-primary), 70%, 65%);
|
|
73
|
+
--color-surface: hsl(0, 0%, 8%);
|
|
74
|
+
--color-surface-raised: hsl(0, 0%, 14%);
|
|
75
|
+
--color-text: hsl(0, 0%, 92%);
|
|
76
|
+
--color-text-muted: hsl(0, 0%, 60%);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Layout Patterns
|
|
82
|
+
|
|
83
|
+
### Asymmetric Grid
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
/* Break the 12-column monotony */
|
|
87
|
+
.asymmetric-grid {
|
|
88
|
+
display: grid;
|
|
89
|
+
grid-template-columns: 2fr 1fr;
|
|
90
|
+
gap: clamp(1.5rem, 3vw, 4rem);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Overlap elements for depth */
|
|
94
|
+
.overlap-layout {
|
|
95
|
+
display: grid;
|
|
96
|
+
grid-template-columns: repeat(12, 1fr);
|
|
97
|
+
}
|
|
98
|
+
.overlap-layout > .primary {
|
|
99
|
+
grid-column: 1 / 9;
|
|
100
|
+
grid-row: 1;
|
|
101
|
+
}
|
|
102
|
+
.overlap-layout > .accent {
|
|
103
|
+
grid-column: 7 / 13;
|
|
104
|
+
grid-row: 1;
|
|
105
|
+
margin-top: 4rem; /* Intentional offset */
|
|
106
|
+
z-index: 1;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Container Queries
|
|
111
|
+
|
|
112
|
+
```css
|
|
113
|
+
/* Component-level responsive design */
|
|
114
|
+
.card-container {
|
|
115
|
+
container-type: inline-size;
|
|
116
|
+
container-name: card;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@container card (min-width: 400px) {
|
|
120
|
+
.card { flex-direction: row; }
|
|
121
|
+
.card__image { width: 40%; }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@container card (min-width: 700px) {
|
|
125
|
+
.card { gap: 2rem; }
|
|
126
|
+
.card__image { width: 50%; }
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Motion & Animation
|
|
131
|
+
|
|
132
|
+
### Staggered Reveal
|
|
133
|
+
|
|
134
|
+
```css
|
|
135
|
+
/* Page load animation with staggered children */
|
|
136
|
+
@keyframes reveal-up {
|
|
137
|
+
from {
|
|
138
|
+
opacity: 0;
|
|
139
|
+
transform: translateY(1.5rem);
|
|
140
|
+
}
|
|
141
|
+
to {
|
|
142
|
+
opacity: 1;
|
|
143
|
+
transform: translateY(0);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.stagger-reveal > * {
|
|
148
|
+
opacity: 0;
|
|
149
|
+
animation: reveal-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.stagger-reveal > *:nth-child(1) { animation-delay: 0.1s; }
|
|
153
|
+
.stagger-reveal > *:nth-child(2) { animation-delay: 0.2s; }
|
|
154
|
+
.stagger-reveal > *:nth-child(3) { animation-delay: 0.3s; }
|
|
155
|
+
.stagger-reveal > *:nth-child(4) { animation-delay: 0.4s; }
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Hover Interactions
|
|
159
|
+
|
|
160
|
+
```css
|
|
161
|
+
/* Magnetic lift with shadow depth */
|
|
162
|
+
.interactive-card {
|
|
163
|
+
transition:
|
|
164
|
+
transform 0.25s cubic-bezier(0.33, 1, 0.68, 1),
|
|
165
|
+
box-shadow 0.25s ease;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.interactive-card:hover {
|
|
169
|
+
transform: translateY(-4px);
|
|
170
|
+
box-shadow:
|
|
171
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.06),
|
|
172
|
+
0 10px 15px -3px rgba(0, 0, 0, 0.08),
|
|
173
|
+
0 20px 25px -5px rgba(0, 0, 0, 0.04);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.interactive-card:active {
|
|
177
|
+
transform: translateY(-1px);
|
|
178
|
+
transition-duration: 0.1s;
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Background & Texture
|
|
183
|
+
|
|
184
|
+
### Gradient Mesh
|
|
185
|
+
|
|
186
|
+
```css
|
|
187
|
+
/* Multi-stop gradient for organic feel */
|
|
188
|
+
.gradient-mesh {
|
|
189
|
+
background:
|
|
190
|
+
radial-gradient(ellipse at 20% 50%, hsla(200, 80%, 70%, 0.3), transparent 50%),
|
|
191
|
+
radial-gradient(ellipse at 80% 20%, hsla(340, 80%, 70%, 0.2), transparent 50%),
|
|
192
|
+
radial-gradient(ellipse at 50% 80%, hsla(260, 60%, 60%, 0.25), transparent 50%),
|
|
193
|
+
hsl(0, 0%, 98%);
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Noise Texture Overlay
|
|
198
|
+
|
|
199
|
+
```css
|
|
200
|
+
/* Subtle grain for depth — use a tiny noise PNG or SVG data URI */
|
|
201
|
+
.grain-overlay::after {
|
|
202
|
+
content: '';
|
|
203
|
+
position: absolute;
|
|
204
|
+
inset: 0;
|
|
205
|
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
|
|
206
|
+
pointer-events: none;
|
|
207
|
+
z-index: 1;
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Utility Patterns
|
|
212
|
+
|
|
213
|
+
### Accessible Focus Styles
|
|
214
|
+
|
|
215
|
+
```css
|
|
216
|
+
/* Visible focus ring that works on any background */
|
|
217
|
+
:focus-visible {
|
|
218
|
+
outline: 2px solid var(--color-primary);
|
|
219
|
+
outline-offset: 3px;
|
|
220
|
+
border-radius: 2px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Remove default outline only when :focus-visible is supported */
|
|
224
|
+
:focus:not(:focus-visible) {
|
|
225
|
+
outline: none;
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Scroll-Triggered Animations
|
|
230
|
+
|
|
231
|
+
```css
|
|
232
|
+
/* Native CSS scroll-driven animations (modern browsers) */
|
|
233
|
+
@keyframes fade-in-up {
|
|
234
|
+
from { opacity: 0; transform: translateY(2rem); }
|
|
235
|
+
to { opacity: 1; transform: translateY(0); }
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.scroll-reveal {
|
|
239
|
+
animation: fade-in-up linear both;
|
|
240
|
+
animation-timeline: view();
|
|
241
|
+
animation-range: entry 0% entry 40%;
|
|
242
|
+
}
|
|
243
|
+
```
|