@schalkneethling/toolkit 0.2.0 → 0.4.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/README.md +29 -7
- package/commands/rpm-advance.md +13 -0
- package/commands/rpm-checkpoint.md +13 -0
- package/commands/rpm-feedback.md +15 -0
- package/commands/rpm-handoff.md +14 -0
- package/commands/rpm-review.md +13 -0
- package/commands/rpm-start.md +13 -0
- package/dist/index.mjs +90 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/skills/css-coder/SKILL.md +95 -0
- package/skills/css-coder/references/patterns.md +224 -0
- package/skills/css-tokens/README.md +152 -0
- package/skills/css-tokens/SKILL.md +125 -0
- package/skills/css-tokens/references/tokens.css +162 -0
- package/skills/frontend-security/SKILL.md +134 -0
- package/skills/frontend-security/references/csp-configuration.md +191 -0
- package/skills/frontend-security/references/csrf-protection.md +327 -0
- package/skills/frontend-security/references/dom-security.md +229 -0
- package/skills/frontend-security/references/file-upload-security.md +310 -0
- package/skills/frontend-security/references/framework-patterns.md +307 -0
- package/skills/frontend-security/references/input-validation.md +232 -0
- package/skills/frontend-security/references/jwt-security.md +300 -0
- package/skills/frontend-security/references/nodejs-npm-security.md +261 -0
- package/skills/frontend-security/references/xss-prevention.md +163 -0
- package/skills/frontend-testing/SKILL.md +357 -0
- package/skills/frontend-testing/references/accessibility-testing.md +368 -0
- package/skills/frontend-testing/references/aria-snapshots.md +517 -0
- package/skills/frontend-testing/references/locator-strategies.md +295 -0
- package/skills/frontend-testing/references/visual-regression.md +466 -0
- package/skills/refined-plan-mode/SKILL.md +84 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# CSS Patterns and Snippets
|
|
2
|
+
|
|
3
|
+
This file contains reusable CSS patterns, snippets, and conventions. Consult before writing CSS.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Utility Patterns
|
|
8
|
+
|
|
9
|
+
### Visually Hidden (Screen Reader Only)
|
|
10
|
+
|
|
11
|
+
Use when content should be accessible to assistive technologies but not visible on screen.
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
.visually-hidden {
|
|
15
|
+
position: absolute;
|
|
16
|
+
width: 1px;
|
|
17
|
+
height: 1px;
|
|
18
|
+
padding: 0;
|
|
19
|
+
margin: -1px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
clip: rect(0, 0, 0, 0);
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
border: 0;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## User Preference Queries
|
|
30
|
+
|
|
31
|
+
### Reduced Motion
|
|
32
|
+
|
|
33
|
+
Always wrap animations and transitions for users who prefer reduced motion.
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
@media (prefers-reduced-motion: reduce) {
|
|
37
|
+
*,
|
|
38
|
+
*::before,
|
|
39
|
+
*::after {
|
|
40
|
+
animation-duration: 0.01ms !important;
|
|
41
|
+
animation-iteration-count: 1 !important;
|
|
42
|
+
transition-duration: 0.01ms !important;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Color Scheme
|
|
48
|
+
|
|
49
|
+
```css
|
|
50
|
+
@media (prefers-color-scheme: dark) {
|
|
51
|
+
:root {
|
|
52
|
+
/* dark mode custom properties */
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### High Contrast
|
|
58
|
+
|
|
59
|
+
```css
|
|
60
|
+
@media (prefers-contrast: more) {
|
|
61
|
+
:root {
|
|
62
|
+
/* increased contrast custom properties */
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Color Patterns
|
|
70
|
+
|
|
71
|
+
### Modern Color Syntax
|
|
72
|
+
|
|
73
|
+
Always use space-separated syntax for color functions. This is the current standard and required for modern color features.
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
/* Legacy — avoid */
|
|
77
|
+
.legacy {
|
|
78
|
+
background-color: hsla(10, 100%, 50%, 0.75);
|
|
79
|
+
color: rgba(0, 0, 0, 0.9);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Modern — preferred */
|
|
83
|
+
.modern {
|
|
84
|
+
background-color: hsl(10 100% 50% / 0.75);
|
|
85
|
+
color: rgb(0 0 0 / 0.9);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Key points:
|
|
90
|
+
|
|
91
|
+
- Use `rgb()` and `hsl()` — the `a` suffix (`rgba`, `hsla`) is no longer needed.
|
|
92
|
+
- Separate components with spaces, not commas.
|
|
93
|
+
- Use `/` before the alpha value for transparency.
|
|
94
|
+
|
|
95
|
+
### Wide Gamut Colors (oklch, oklab)
|
|
96
|
+
|
|
97
|
+
Use `oklch()` when users request "vibrant", "bright", or "punchy" colors. It supports a wider gamut than sRGB and is perceptually uniform, making adjustments more predictable.
|
|
98
|
+
|
|
99
|
+
```css
|
|
100
|
+
:root {
|
|
101
|
+
--color-accent: oklch(65% 0.25 340);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Note: `oklch()`, `oklab()`, and `color()` only support space-separated syntax.
|
|
106
|
+
|
|
107
|
+
### Relative Color Syntax
|
|
108
|
+
|
|
109
|
+
Use relative colors to derive variations (hover states, overlays, tints) from existing brand variables without defining new custom properties.
|
|
110
|
+
|
|
111
|
+
Syntax: `function(from [base-color] [components] / [alpha])`
|
|
112
|
+
|
|
113
|
+
```css
|
|
114
|
+
:root {
|
|
115
|
+
--color-brand: oklch(55% 0.2 250);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.button {
|
|
119
|
+
background-color: var(--color-brand);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.button:hover {
|
|
123
|
+
/* Lighten by adjusting the L channel */
|
|
124
|
+
background-color: oklch(from var(--color-brand) calc(l + 0.1) c h);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.overlay {
|
|
128
|
+
/* Apply 50% opacity to brand color */
|
|
129
|
+
background-color: oklch(from var(--color-brand) l c h / 0.5);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Responsive Patterns
|
|
136
|
+
|
|
137
|
+
### Shared First (Preferred over Mobile First)
|
|
138
|
+
|
|
139
|
+
Avoid traditional mobile-first CSS where styles "bleed up" through open-ended `min-width` queries, requiring constant overrides. Instead, use a **Shared First** approach:
|
|
140
|
+
|
|
141
|
+
1. Define only truly shared styles outside media queries.
|
|
142
|
+
2. Use bounded media queries to scope styles to specific viewport ranges.
|
|
143
|
+
3. Keep breakpoints to a minimum — add more only when there's a clear need.
|
|
144
|
+
|
|
145
|
+
Use modern range syntax for all media queries:
|
|
146
|
+
|
|
147
|
+
```css
|
|
148
|
+
@media (width < 48rem) {
|
|
149
|
+
/* below breakpoint */
|
|
150
|
+
}
|
|
151
|
+
@media (width >= 48rem) {
|
|
152
|
+
/* at or above breakpoint */
|
|
153
|
+
}
|
|
154
|
+
@media (48rem <= width < 64rem) {
|
|
155
|
+
/* between breakpoints */
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Why Shared First?**
|
|
160
|
+
|
|
161
|
+
- **Fewer side effects** — Changes to one viewport don't accidentally affect others.
|
|
162
|
+
- **Easier debugging** — DevTools shows fewer overridden (struck-through) properties.
|
|
163
|
+
- **Clearer intent** — Each viewport's styles are self-contained.
|
|
164
|
+
|
|
165
|
+
```css
|
|
166
|
+
/* Mobile First — avoid */
|
|
167
|
+
body {
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
gap: 1rem;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@media (min-width: 48rem) {
|
|
174
|
+
body {
|
|
175
|
+
flex-direction: row;
|
|
176
|
+
gap: 2rem;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
```css
|
|
182
|
+
/* Shared First — preferred */
|
|
183
|
+
body {
|
|
184
|
+
display: flex;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@media (width < 48rem) {
|
|
188
|
+
body {
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
gap: 1rem;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media (width >= 48rem) {
|
|
195
|
+
body {
|
|
196
|
+
flex-direction: row;
|
|
197
|
+
gap: 2rem;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The Shared First approach may use more lines, but results in more maintainable, predictable CSS with fewer debugging headaches.
|
|
203
|
+
|
|
204
|
+
#### Using Custom Properties with Shared First
|
|
205
|
+
|
|
206
|
+
Custom properties can reduce repetition by keeping the property declaration shared while scoping only the value to each viewport. Use sparingly — overuse can make code harder to follow.
|
|
207
|
+
|
|
208
|
+
```css
|
|
209
|
+
.Dialog-container {
|
|
210
|
+
padding-block: var(--Dialog-block-padding);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@media (width < 48rem) {
|
|
214
|
+
.Dialog-container {
|
|
215
|
+
--Dialog-block-padding: var(--size-16);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@media (width >= 48rem) {
|
|
220
|
+
.Dialog-container {
|
|
221
|
+
--Dialog-block-padding: var(--size-32);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# CSS Design Tokens
|
|
2
|
+
|
|
3
|
+
## Quick Start
|
|
4
|
+
|
|
5
|
+
1. Install the skill in your project (see [main repo README](https://github.com/schalkneethling/claude-toolkit))
|
|
6
|
+
2. Import `tokens.css` in your main stylesheet or HTML
|
|
7
|
+
3. Start using tokens: `var(--color-primary)`, `var(--size-16)`, etc.
|
|
8
|
+
|
|
9
|
+
For the philosophy and detailed usage, read on below.
|
|
10
|
+
|
|
11
|
+
## Philosophy
|
|
12
|
+
|
|
13
|
+
This token system embodies several key principles:
|
|
14
|
+
|
|
15
|
+
### 1. Perceptual Uniformity
|
|
16
|
+
|
|
17
|
+
Colors use the `oklch()` color space rather than `hsl()` or `rgb()`. This ensures:
|
|
18
|
+
|
|
19
|
+
- Consistent perceived brightness across hues
|
|
20
|
+
- More predictable color manipulation
|
|
21
|
+
- Better accessibility through perceptual lightness control
|
|
22
|
+
|
|
23
|
+
### 2. Semantic Naming
|
|
24
|
+
|
|
25
|
+
Tokens are named by their purpose or scale value, not their appearance:
|
|
26
|
+
|
|
27
|
+
- `--color-primary` not `--color-teal`
|
|
28
|
+
- `--size-16` (16px value) not `--spacing-small`
|
|
29
|
+
- `--text-xl` (size indicator) not `--heading-size`
|
|
30
|
+
|
|
31
|
+
### 3. System Thinking
|
|
32
|
+
|
|
33
|
+
The design system is interconnected:
|
|
34
|
+
|
|
35
|
+
- Border radius values reference the spacing scale
|
|
36
|
+
- Typography sizes follow a modular scale
|
|
37
|
+
- Z-index uses named layers, not arbitrary numbers
|
|
38
|
+
|
|
39
|
+
### 4. Dark Mode First-Class
|
|
40
|
+
|
|
41
|
+
Dark mode isn't an afterthought:
|
|
42
|
+
|
|
43
|
+
- Colors are redefined in `prefers-color-scheme: dark`
|
|
44
|
+
- Values are adjusted for optimal contrast in both modes
|
|
45
|
+
- The system maintains visual hierarchy in light and dark
|
|
46
|
+
|
|
47
|
+
### 5. Scale Consistency
|
|
48
|
+
|
|
49
|
+
Both spacing and typography use consistent scales:
|
|
50
|
+
|
|
51
|
+
- Spacing: 4px base unit (0.25rem)
|
|
52
|
+
- Typography: Modular scale with clear relationships
|
|
53
|
+
|
|
54
|
+
## Token Categories
|
|
55
|
+
|
|
56
|
+
### Typography
|
|
57
|
+
|
|
58
|
+
- **Font Families**: System fonts with web-safe fallbacks
|
|
59
|
+
- **Weights**: Named weights from regular to bold
|
|
60
|
+
- **Sizes**: Modular scale from xs (12px) to 4xl (36px)
|
|
61
|
+
|
|
62
|
+
### Spacing
|
|
63
|
+
|
|
64
|
+
- **Size Scale**: 4px increments from 4px to 96px
|
|
65
|
+
- Named by pixel value for clarity (`--size-16` = 1rem = 16px)
|
|
66
|
+
|
|
67
|
+
### Colors
|
|
68
|
+
|
|
69
|
+
- **Surfaces**: Background colors for different elevation levels
|
|
70
|
+
- **Text**: Primary, muted, and inverted text colors
|
|
71
|
+
- **Brand**: Logo-specific colors
|
|
72
|
+
- **Interactive**: Primary and accent colors with hover states
|
|
73
|
+
- **Semantic**: Success, error, warning, info states
|
|
74
|
+
- **Borders**: Subtle and strong border options
|
|
75
|
+
|
|
76
|
+
### Layout
|
|
77
|
+
|
|
78
|
+
- **Border Radius**: Five levels from small to full circle
|
|
79
|
+
- **Z-index**: Named layers for predictable stacking
|
|
80
|
+
- **Transitions**: Three timing options (fast, base, slow)
|
|
81
|
+
|
|
82
|
+
## Usage Examples
|
|
83
|
+
|
|
84
|
+
```css
|
|
85
|
+
/* Typography */
|
|
86
|
+
.heading {
|
|
87
|
+
font-family: var(--font-family-base);
|
|
88
|
+
font-size: var(--text-2xl);
|
|
89
|
+
font-weight: var(--font-weight-bold);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Spacing */
|
|
93
|
+
.card {
|
|
94
|
+
padding: var(--size-24);
|
|
95
|
+
margin-block-end: var(--size-32);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Colors */
|
|
99
|
+
.button {
|
|
100
|
+
background-color: var(--color-primary);
|
|
101
|
+
color: var(--color-text-inverted);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.button:hover {
|
|
105
|
+
background-color: var(--color-primary-hover);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Layout */
|
|
109
|
+
.modal {
|
|
110
|
+
border-radius: var(--radius-lg);
|
|
111
|
+
z-index: var(--layer-modal);
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Customization Guide
|
|
116
|
+
|
|
117
|
+
### When to Keep as-is
|
|
118
|
+
|
|
119
|
+
- Working on a prototype or MVP
|
|
120
|
+
- Building internal tools where brand consistency isn't critical
|
|
121
|
+
- Learning design systems
|
|
122
|
+
- Quick experiments or proof-of-concepts
|
|
123
|
+
|
|
124
|
+
### When to Customize
|
|
125
|
+
|
|
126
|
+
- Matching specific brand guidelines
|
|
127
|
+
- Projects with unique visual requirements
|
|
128
|
+
- Integrating with existing design systems
|
|
129
|
+
- Production applications with defined visual identity
|
|
130
|
+
|
|
131
|
+
**Remember**: The token _structure_ (semantic naming, scale consistency, system thinking) is more valuable than the specific values. Customize the values to fit your needs, but maintain the systematic approach.
|
|
132
|
+
|
|
133
|
+
## Extending the System
|
|
134
|
+
|
|
135
|
+
These tokens provide a foundation. Projects can:
|
|
136
|
+
|
|
137
|
+
- Add component-specific tokens that reference these base tokens
|
|
138
|
+
- Create semantic aliases (e.g., `--button-bg: var(--color-primary)`)
|
|
139
|
+
- Extend the color palette while maintaining the `oklch()` approach
|
|
140
|
+
- Add new token categories (shadows, animations, grid systems, etc.)
|
|
141
|
+
|
|
142
|
+
The key is maintaining the system's consistency and semantic approach.
|
|
143
|
+
|
|
144
|
+
## Browser Support
|
|
145
|
+
|
|
146
|
+
The `oklch()` color space is supported in:
|
|
147
|
+
|
|
148
|
+
- Chrome/Edge 111+
|
|
149
|
+
- Safari 15.4+
|
|
150
|
+
- Firefox 113+
|
|
151
|
+
|
|
152
|
+
For older browsers, consider using a PostCSS plugin to generate fallback colors, or use this as a progressive enhancement where supported browsers get optimal color fidelity.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: css-tokens
|
|
3
|
+
description: Provides foundational CSS design tokens (custom properties) for typography, spacing, colors, borders, z-index, and transitions. Use when setting up a base token system for a web project.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CSS Design Tokens Skill
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
This skill provides a comprehensive set of CSS design tokens (custom properties) to establish a consistent design foundation for web projects. Use this skill when the user requests a base token system or design tokens for their CSS.
|
|
11
|
+
|
|
12
|
+
## When to Use This Skill
|
|
13
|
+
|
|
14
|
+
Use this skill when the user asks for:
|
|
15
|
+
|
|
16
|
+
- "Add design tokens to my project"
|
|
17
|
+
- "Set up CSS tokens"
|
|
18
|
+
- "Create a tokens file"
|
|
19
|
+
- "Add base CSS variables"
|
|
20
|
+
- Similar requests for foundational CSS custom properties
|
|
21
|
+
|
|
22
|
+
## When NOT to Use This Skill
|
|
23
|
+
|
|
24
|
+
- User already has an existing design token system (suggest modifications instead)
|
|
25
|
+
- User specifically requests a framework-specific token system (e.g., Tailwind config, CSS-in-JS tokens)
|
|
26
|
+
- User only needs a subset of tokens (offer to extract specific categories)
|
|
27
|
+
|
|
28
|
+
## What This Skill Provides
|
|
29
|
+
|
|
30
|
+
A complete `tokens.css` file with a comprehensive design token system:
|
|
31
|
+
|
|
32
|
+
- **Typography**: Font families, weights, and a modular size scale (xs to 4xl)
|
|
33
|
+
- **Spacing**: Consistent size scale from 4px to 96px, named by pixel value
|
|
34
|
+
- **Colors**: Using `oklch()` color space for perceptually uniform colors with light/dark mode variants for surfaces, text, brand, interactive elements, and semantic states
|
|
35
|
+
- **Borders**: Radius values derived from the size scale (sm to full)
|
|
36
|
+
- **Z-index**: Named layers for stacking context (dropdown, modal, toast, etc.)
|
|
37
|
+
- **Transitions**: Standard timing values (fast, base, slow)
|
|
38
|
+
|
|
39
|
+
Users can reference individual tokens using CSS custom property syntax: `var(--token-name)`
|
|
40
|
+
|
|
41
|
+
## Token Content
|
|
42
|
+
|
|
43
|
+
The complete token definitions are located in `references/tokens.css` within this skill directory. This file contains all the CSS custom property declarations organized by category.
|
|
44
|
+
|
|
45
|
+
## How to Use This Skill
|
|
46
|
+
|
|
47
|
+
### 1. Detect CSS Directory
|
|
48
|
+
|
|
49
|
+
Search the project for common CSS directory names:
|
|
50
|
+
|
|
51
|
+
- `css/`
|
|
52
|
+
- `styles/`
|
|
53
|
+
- `assets/css/`
|
|
54
|
+
- `stylesheets/`
|
|
55
|
+
- `src/css/`
|
|
56
|
+
- `src/styles/`
|
|
57
|
+
|
|
58
|
+
Check directories at multiple levels (root, `src/`, `public/`, `assets/`).
|
|
59
|
+
|
|
60
|
+
### 2. Confirm Location with User
|
|
61
|
+
|
|
62
|
+
**If a CSS directory is found:**
|
|
63
|
+
|
|
64
|
+
Present the discovered location and ask for confirmation:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
I found a CSS directory at [path]. Should I add the design tokens to this directory in a file named `tokens.css`?
|
|
68
|
+
|
|
69
|
+
If you'd like a different location or filename, please specify both.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**If no CSS directory is found:**
|
|
73
|
+
|
|
74
|
+
Ask the user directly:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
I couldn't find an existing CSS directory in your project. Please specify:
|
|
78
|
+
1. The directory path where you'd like the tokens file (I can create it if needed)
|
|
79
|
+
2. The filename (e.g., `tokens.css`, `design-tokens.css`)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 3. Write the Tokens File
|
|
83
|
+
|
|
84
|
+
Once confirmed, write the complete tokens file to the specified location. Use the exact content from `references/tokens.css` in this skill directory.
|
|
85
|
+
|
|
86
|
+
### 4. Inform User About Import
|
|
87
|
+
|
|
88
|
+
After successfully writing the file, inform the user:
|
|
89
|
+
|
|
90
|
+
✓ Design tokens written to [full-path]
|
|
91
|
+
|
|
92
|
+
To use these tokens in your project, import this file in your main CSS file or HTML:
|
|
93
|
+
|
|
94
|
+
**In CSS:**
|
|
95
|
+
|
|
96
|
+
```css
|
|
97
|
+
@import url('path/to/tokens.css');
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**In HTML:**
|
|
101
|
+
|
|
102
|
+
```html
|
|
103
|
+
<link rel="stylesheet" href="path/to/tokens.css" />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The tokens are now available as CSS custom properties throughout your project (e.g., `var(--color-primary)`, `var(--size-16)`).
|
|
107
|
+
|
|
108
|
+
## Customization
|
|
109
|
+
|
|
110
|
+
These tokens provide a solid foundation but are meant to be customized for your project:
|
|
111
|
+
|
|
112
|
+
- Adjust color values to match your brand
|
|
113
|
+
- Modify the spacing scale to fit your design system
|
|
114
|
+
- Add project-specific tokens as needed
|
|
115
|
+
- Extend categories with additional tokens (animations, shadows, etc.)
|
|
116
|
+
|
|
117
|
+
This is a **scaffolding skill** - it sets up the initial structure but doesn't handle ongoing modifications.
|
|
118
|
+
|
|
119
|
+
## Important Notes
|
|
120
|
+
|
|
121
|
+
- **Do NOT make assumptions** about directory structure or filename if the user hasn't specified
|
|
122
|
+
- **Always confirm** the location before writing
|
|
123
|
+
- **Create directories** if needed and confirmed by user
|
|
124
|
+
- The tokens file includes both light and dark mode color schemes using `prefers-color-scheme`
|
|
125
|
+
- The `oklch()` color space provides perceptually uniform colors for better accessibility and consistency
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* ========================================
|
|
3
|
+
* Typography - Font Families
|
|
4
|
+
* ======================================== */
|
|
5
|
+
--font-family-base:
|
|
6
|
+
inter, "Source Sans 3", "IBM Plex Sans", -apple-system, blinkmacsystemfont,
|
|
7
|
+
"Segoe UI", roboto, helvetica, arial, sans-serif;
|
|
8
|
+
--font-family-mono:
|
|
9
|
+
ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono",
|
|
10
|
+
"Liberation Mono", menlo, monaco, consolas, monospace;
|
|
11
|
+
|
|
12
|
+
/* ========================================
|
|
13
|
+
* Typography - Font Weights
|
|
14
|
+
* ======================================== */
|
|
15
|
+
--font-weight-regular: 400;
|
|
16
|
+
--font-weight-medium: 500;
|
|
17
|
+
--font-weight-semibold: 600;
|
|
18
|
+
--font-weight-bold: 700;
|
|
19
|
+
|
|
20
|
+
/* ========================================
|
|
21
|
+
* Typography - Font Sizes
|
|
22
|
+
* Token name = approximate pixel value
|
|
23
|
+
* ======================================== */
|
|
24
|
+
--text-xs: 0.75rem; /* 12px */
|
|
25
|
+
--text-sm: 0.875rem; /* 14px */
|
|
26
|
+
--text-base: 1rem; /* 16px */
|
|
27
|
+
--text-lg: 1.125rem; /* 18px */
|
|
28
|
+
--text-xl: 1.25rem; /* 20px */
|
|
29
|
+
--text-2xl: 1.5rem; /* 24px */
|
|
30
|
+
--text-3xl: 1.875rem; /* 30px */
|
|
31
|
+
--text-4xl: 2.25rem; /* 36px */
|
|
32
|
+
|
|
33
|
+
/* ========================================
|
|
34
|
+
* Spacing / Size Scale
|
|
35
|
+
* Token name = pixel value (--size-16 = 16px = 1rem)
|
|
36
|
+
* ======================================== */
|
|
37
|
+
--size-4: 0.25rem; /* 4px */
|
|
38
|
+
--size-8: 0.5rem; /* 8px */
|
|
39
|
+
--size-12: 0.75rem; /* 12px */
|
|
40
|
+
--size-16: 1rem; /* 16px */
|
|
41
|
+
--size-20: 1.25rem; /* 20px */
|
|
42
|
+
--size-24: 1.5rem; /* 24px */
|
|
43
|
+
--size-32: 2rem; /* 32px */
|
|
44
|
+
--size-40: 2.5rem; /* 40px */
|
|
45
|
+
--size-48: 3rem; /* 48px */
|
|
46
|
+
--size-64: 4rem; /* 64px */
|
|
47
|
+
--size-80: 5rem; /* 80px */
|
|
48
|
+
--size-96: 6rem; /* 96px */
|
|
49
|
+
|
|
50
|
+
/* ========================================
|
|
51
|
+
* Border Radius (uses size tokens)
|
|
52
|
+
* ======================================== */
|
|
53
|
+
--radius-sm: var(--size-4);
|
|
54
|
+
--radius-md: var(--size-8);
|
|
55
|
+
--radius-lg: var(--size-12);
|
|
56
|
+
--radius-xl: var(--size-16);
|
|
57
|
+
--radius-full: 50%;
|
|
58
|
+
|
|
59
|
+
/* ========================================
|
|
60
|
+
* Z-Index Layers
|
|
61
|
+
* ======================================== */
|
|
62
|
+
--layer-send-to-back: -1;
|
|
63
|
+
--layer-dropdown: 100;
|
|
64
|
+
--layer-modal: 300;
|
|
65
|
+
--layer-toast: 400;
|
|
66
|
+
--layer-bring-to-front: 9999;
|
|
67
|
+
|
|
68
|
+
/* ========================================
|
|
69
|
+
* Transitions
|
|
70
|
+
* ======================================== */
|
|
71
|
+
--transition-fast: 150ms ease;
|
|
72
|
+
--transition-base: 250ms ease;
|
|
73
|
+
--transition-slow: 400ms ease;
|
|
74
|
+
|
|
75
|
+
/* ========================================
|
|
76
|
+
* Colors - Light Mode (Default)
|
|
77
|
+
* Using oklch() for perceptual uniformity
|
|
78
|
+
* ======================================== */
|
|
79
|
+
|
|
80
|
+
/* Surfaces */
|
|
81
|
+
--color-surface: oklch(98% 0.005 250deg); /* Near white */
|
|
82
|
+
--color-surface-raised: oklch(100% 0 0deg); /* Pure white */
|
|
83
|
+
--color-surface-sunken: oklch(95% 0.01 250deg); /* Slightly darker */
|
|
84
|
+
|
|
85
|
+
/* Text */
|
|
86
|
+
--color-text: oklch(25% 0.02 250deg); /* Dark slate */
|
|
87
|
+
--color-text-muted: oklch(50% 0.015 250deg); /* Medium gray */
|
|
88
|
+
--color-text-inverted: oklch(
|
|
89
|
+
98% 0.005 250deg
|
|
90
|
+
); /* Light for dark backgrounds */
|
|
91
|
+
|
|
92
|
+
/* Logo Colors - derived from brand */
|
|
93
|
+
--color-logo-maker: oklch(40% 0.025 220deg); /* Dark slate-blue */
|
|
94
|
+
--color-logo-bench: oklch(55% 0.15 185deg); /* Teal */
|
|
95
|
+
|
|
96
|
+
/* Primary - Teal (matches logo "Bench") */
|
|
97
|
+
--color-primary: oklch(50% 0.14 185deg);
|
|
98
|
+
--color-primary-hover: oklch(45% 0.14 185deg);
|
|
99
|
+
--color-primary-active: oklch(40% 0.14 185deg);
|
|
100
|
+
|
|
101
|
+
/* Accent - Coral/Orange for CTAs */
|
|
102
|
+
--color-accent: oklch(65% 0.18 35deg);
|
|
103
|
+
--color-accent-hover: oklch(60% 0.18 35deg);
|
|
104
|
+
|
|
105
|
+
/* Borders */
|
|
106
|
+
--color-border: oklch(88% 0.01 250deg);
|
|
107
|
+
--color-border-strong: oklch(75% 0.015 250deg);
|
|
108
|
+
|
|
109
|
+
/* States */
|
|
110
|
+
--color-success: oklch(55% 0.15 145deg);
|
|
111
|
+
--color-error: oklch(55% 0.2 25deg);
|
|
112
|
+
--color-warning: oklch(70% 0.15 80deg);
|
|
113
|
+
--color-info: oklch(55% 0.12 240deg);
|
|
114
|
+
|
|
115
|
+
/* Focus ring */
|
|
116
|
+
--color-focus-ring: oklch(55% 0.15 185deg / 50%);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ========================================
|
|
120
|
+
* Colors - Dark Mode
|
|
121
|
+
* ======================================== */
|
|
122
|
+
@media (prefers-color-scheme: dark) {
|
|
123
|
+
:root {
|
|
124
|
+
/* Surfaces */
|
|
125
|
+
--color-surface: oklch(18% 0.015 250deg); /* Deep charcoal */
|
|
126
|
+
--color-surface-raised: oklch(22% 0.015 250deg); /* Elevated dark */
|
|
127
|
+
--color-surface-sunken: oklch(14% 0.015 250deg); /* Deeper */
|
|
128
|
+
|
|
129
|
+
/* Text */
|
|
130
|
+
--color-text: oklch(92% 0.01 250deg); /* Light gray */
|
|
131
|
+
--color-text-muted: oklch(65% 0.01 250deg); /* Muted gray */
|
|
132
|
+
--color-text-inverted: oklch(
|
|
133
|
+
18% 0.015 250deg
|
|
134
|
+
); /* Dark for light backgrounds */
|
|
135
|
+
|
|
136
|
+
/* Logo Colors - brighter for dark mode */
|
|
137
|
+
--color-logo-maker: oklch(75% 0.02 220deg); /* Lighter slate */
|
|
138
|
+
--color-logo-bench: oklch(65% 0.15 185deg); /* Brighter teal */
|
|
139
|
+
|
|
140
|
+
/* Primary - Brighter teal for dark mode */
|
|
141
|
+
--color-primary: oklch(60% 0.14 185deg);
|
|
142
|
+
--color-primary-hover: oklch(65% 0.14 185deg);
|
|
143
|
+
--color-primary-active: oklch(55% 0.14 185deg);
|
|
144
|
+
|
|
145
|
+
/* Accent */
|
|
146
|
+
--color-accent: oklch(70% 0.16 35deg);
|
|
147
|
+
--color-accent-hover: oklch(75% 0.16 35deg);
|
|
148
|
+
|
|
149
|
+
/* Borders */
|
|
150
|
+
--color-border: oklch(30% 0.015 250deg);
|
|
151
|
+
--color-border-strong: oklch(40% 0.015 250deg);
|
|
152
|
+
|
|
153
|
+
/* States */
|
|
154
|
+
--color-success: oklch(60% 0.15 145deg);
|
|
155
|
+
--color-error: oklch(60% 0.18 25deg);
|
|
156
|
+
--color-warning: oklch(75% 0.15 80deg);
|
|
157
|
+
--color-info: oklch(60% 0.12 240deg);
|
|
158
|
+
|
|
159
|
+
/* Focus ring */
|
|
160
|
+
--color-focus-ring: oklch(60% 0.15 185deg / 50%);
|
|
161
|
+
}
|
|
162
|
+
}
|