devglide 0.1.1
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/LICENSE +21 -0
- package/README.md +338 -0
- package/bin/claude-md-template.js +94 -0
- package/bin/devglide.js +387 -0
- package/package.json +85 -0
- package/pnpm-workspace.yaml +3 -0
- package/src/apps/coder/.turbo/turbo-lint.log +5 -0
- package/src/apps/coder/package.json +16 -0
- package/src/apps/coder/public/favicon.svg +7 -0
- package/src/apps/coder/public/page.css +275 -0
- package/src/apps/coder/public/page.js +528 -0
- package/src/apps/coder/server.js +3 -0
- package/src/apps/documentation/public/page.css +597 -0
- package/src/apps/documentation/public/page.js +609 -0
- package/src/apps/kanban/.turbo/turbo-lint.log +97 -0
- package/src/apps/kanban/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/kanban/package.json +32 -0
- package/src/apps/kanban/public/favicon.svg +7 -0
- package/src/apps/kanban/public/page.css +1010 -0
- package/src/apps/kanban/public/page.js +1730 -0
- package/src/apps/kanban/public/vendor/marked.min.js +6 -0
- package/src/apps/kanban/public/vendor/sortable.min.js +2 -0
- package/src/apps/kanban/src/db.ts +319 -0
- package/src/apps/kanban/src/index.ts +14 -0
- package/src/apps/kanban/src/mcp-helpers.test.ts +88 -0
- package/src/apps/kanban/src/mcp-helpers.ts +60 -0
- package/src/apps/kanban/src/mcp.ts +59 -0
- package/src/apps/kanban/src/routes/attachments.ts +161 -0
- package/src/apps/kanban/src/routes/features.ts +233 -0
- package/src/apps/kanban/src/routes/issues.ts +373 -0
- package/src/apps/kanban/src/tools/feature-tools.ts +164 -0
- package/src/apps/kanban/src/tools/item-tools.ts +307 -0
- package/src/apps/kanban/src/tools/versioned-entry-tools.ts +72 -0
- package/src/apps/kanban/tsconfig.check.json +9 -0
- package/src/apps/kanban/tsconfig.json +9 -0
- package/src/apps/keymap/.turbo/turbo-lint.log +5 -0
- package/src/apps/keymap/package.json +16 -0
- package/src/apps/keymap/public/page.css +275 -0
- package/src/apps/keymap/public/page.js +294 -0
- package/src/apps/keymap/server.js +25 -0
- package/src/apps/log/.turbo/turbo-build.log +5 -0
- package/src/apps/log/.turbo/turbo-lint.log +45 -0
- package/src/apps/log/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/log/node_modules/.bin/tsc +21 -0
- package/src/apps/log/node_modules/.bin/tsserver +21 -0
- package/src/apps/log/node_modules/.bin/tsx +21 -0
- package/src/apps/log/package.json +36 -0
- package/src/apps/log/public/console-sniffer.js +221 -0
- package/src/apps/log/public/favicon.svg +7 -0
- package/src/apps/log/public/page.css +322 -0
- package/src/apps/log/public/page.js +463 -0
- package/src/apps/log/src/index.ts +9 -0
- package/src/apps/log/src/mcp.ts +122 -0
- package/src/apps/log/src/routes/log.ts +333 -0
- package/src/apps/log/src/routes/status.ts +25 -0
- package/src/apps/log/src/server-sniffer.ts +118 -0
- package/src/apps/log/src/services/file-patterns.ts +39 -0
- package/src/apps/log/src/services/file-tailer.ts +228 -0
- package/src/apps/log/src/services/line-parser.ts +94 -0
- package/src/apps/log/src/services/log-writer.ts +39 -0
- package/src/apps/log/tsconfig.json +8 -0
- package/src/apps/prompts/.turbo/turbo-build.log +5 -0
- package/src/apps/prompts/.turbo/turbo-lint.log +24 -0
- package/src/apps/prompts/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/prompts/mcp.ts +175 -0
- package/src/apps/prompts/node_modules/.bin/tsc +21 -0
- package/src/apps/prompts/node_modules/.bin/tsserver +21 -0
- package/src/apps/prompts/node_modules/.bin/tsx +21 -0
- package/src/apps/prompts/package.json +25 -0
- package/src/apps/prompts/public/page.css +315 -0
- package/src/apps/prompts/public/page.js +541 -0
- package/src/apps/prompts/services/prompt-store.ts +212 -0
- package/src/apps/prompts/src/index.ts +9 -0
- package/src/apps/prompts/tsconfig.json +8 -0
- package/src/apps/prompts/types.ts +27 -0
- package/src/apps/shell/.turbo/turbo-build.log +5 -0
- package/src/apps/shell/.turbo/turbo-lint.log +34 -0
- package/src/apps/shell/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/shell/package.json +35 -0
- package/src/apps/shell/public/favicon.svg +7 -0
- package/src/apps/shell/public/page.css +407 -0
- package/src/apps/shell/public/page.js +1577 -0
- package/src/apps/shell/src/index.ts +150 -0
- package/src/apps/shell/src/mcp.ts +398 -0
- package/src/apps/shell/src/shell-types.ts +41 -0
- package/src/apps/shell/tsconfig.json +8 -0
- package/src/apps/test/.turbo/turbo-build.log +5 -0
- package/src/apps/test/.turbo/turbo-lint.log +27 -0
- package/src/apps/test/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/test/node_modules/.bin/tsc +21 -0
- package/src/apps/test/node_modules/.bin/tsserver +21 -0
- package/src/apps/test/node_modules/.bin/tsx +21 -0
- package/src/apps/test/node_modules/.bin/uuid +21 -0
- package/src/apps/test/package.json +35 -0
- package/src/apps/test/public/favicon.svg +7 -0
- package/src/apps/test/public/page.css +499 -0
- package/src/apps/test/public/page.js +417 -0
- package/src/apps/test/public/scenario-runner.js +450 -0
- package/src/apps/test/src/index.ts +9 -0
- package/src/apps/test/src/mcp.ts +192 -0
- package/src/apps/test/src/routes/trigger.ts +285 -0
- package/src/apps/test/src/services/scenario-broadcaster.ts +60 -0
- package/src/apps/test/src/services/scenario-manager.ts +361 -0
- package/src/apps/test/src/services/scenario-store.ts +145 -0
- package/src/apps/test/tsconfig.json +8 -0
- package/src/apps/vocabulary/.turbo/turbo-build.log +5 -0
- package/src/apps/vocabulary/.turbo/turbo-lint.log +25 -0
- package/src/apps/vocabulary/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/vocabulary/mcp.ts +173 -0
- package/src/apps/vocabulary/node_modules/.bin/tsc +21 -0
- package/src/apps/vocabulary/node_modules/.bin/tsserver +21 -0
- package/src/apps/vocabulary/node_modules/.bin/tsx +21 -0
- package/src/apps/vocabulary/package.json +25 -0
- package/src/apps/vocabulary/public/page.css +247 -0
- package/src/apps/vocabulary/public/page.js +444 -0
- package/src/apps/vocabulary/services/vocabulary-store.ts +179 -0
- package/src/apps/vocabulary/src/index.ts +10 -0
- package/src/apps/vocabulary/tsconfig.json +8 -0
- package/src/apps/vocabulary/types.ts +22 -0
- package/src/apps/voice/.turbo/turbo-build.log +5 -0
- package/src/apps/voice/.turbo/turbo-lint.log +43 -0
- package/src/apps/voice/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/voice/node_modules/.bin/openai +21 -0
- package/src/apps/voice/node_modules/.bin/tsc +21 -0
- package/src/apps/voice/node_modules/.bin/tsserver +21 -0
- package/src/apps/voice/node_modules/.bin/tsx +21 -0
- package/src/apps/voice/package.json +35 -0
- package/src/apps/voice/public/favicon.svg +7 -0
- package/src/apps/voice/public/page.css +388 -0
- package/src/apps/voice/public/page.js +718 -0
- package/src/apps/voice/src/index.ts +10 -0
- package/src/apps/voice/src/mcp.ts +70 -0
- package/src/apps/voice/src/providers/index.ts +85 -0
- package/src/apps/voice/src/providers/openai-compatible.ts +94 -0
- package/src/apps/voice/src/providers/types.ts +27 -0
- package/src/apps/voice/src/routes/config.ts +118 -0
- package/src/apps/voice/src/routes/transcribe.ts +90 -0
- package/src/apps/voice/src/services/config-store.ts +129 -0
- package/src/apps/voice/src/services/stats.ts +108 -0
- package/src/apps/voice/src/transcribe.ts +11 -0
- package/src/apps/voice/src/utils/mime.ts +16 -0
- package/src/apps/voice/tsconfig.json +8 -0
- package/src/apps/workflow/.turbo/turbo-build.log +5 -0
- package/src/apps/workflow/.turbo/turbo-lint.log +96 -0
- package/src/apps/workflow/.turbo/turbo-typecheck.log +5 -0
- package/src/apps/workflow/engine/executors/decision-executor.ts +87 -0
- package/src/apps/workflow/engine/executors/file-executor.ts +90 -0
- package/src/apps/workflow/engine/executors/git-executor.ts +137 -0
- package/src/apps/workflow/engine/executors/http-executor.ts +65 -0
- package/src/apps/workflow/engine/executors/index.ts +28 -0
- package/src/apps/workflow/engine/executors/kanban-executor.ts +154 -0
- package/src/apps/workflow/engine/executors/llm-executor.ts +46 -0
- package/src/apps/workflow/engine/executors/log-executor.ts +62 -0
- package/src/apps/workflow/engine/executors/loop-executor.ts +14 -0
- package/src/apps/workflow/engine/executors/shell-executor.ts +107 -0
- package/src/apps/workflow/engine/executors/sub-workflow-executor.ts +61 -0
- package/src/apps/workflow/engine/executors/test-executor.ts +73 -0
- package/src/apps/workflow/engine/executors/trigger-executor.ts +39 -0
- package/src/apps/workflow/engine/expression-evaluator.ts +117 -0
- package/src/apps/workflow/engine/graph-runner.ts +438 -0
- package/src/apps/workflow/engine/node-executor.ts +104 -0
- package/src/apps/workflow/engine/node-registry.ts +15 -0
- package/src/apps/workflow/engine/variable-resolver.ts +109 -0
- package/src/apps/workflow/mcp.ts +223 -0
- package/src/apps/workflow/node_modules/.bin/tsc +21 -0
- package/src/apps/workflow/node_modules/.bin/tsserver +21 -0
- package/src/apps/workflow/node_modules/.bin/tsx +21 -0
- package/src/apps/workflow/package.json +25 -0
- package/src/apps/workflow/public/editor/canvas.js +366 -0
- package/src/apps/workflow/public/editor/drag-manager.js +326 -0
- package/src/apps/workflow/public/editor/edge-renderer.js +235 -0
- package/src/apps/workflow/public/editor/history-manager.js +147 -0
- package/src/apps/workflow/public/editor/layout-engine.js +159 -0
- package/src/apps/workflow/public/editor/node-renderer.js +199 -0
- package/src/apps/workflow/public/editor/selection-manager.js +193 -0
- package/src/apps/workflow/public/favicon.svg +7 -0
- package/src/apps/workflow/public/models/node-types.js +300 -0
- package/src/apps/workflow/public/models/workflow-model.js +257 -0
- package/src/apps/workflow/public/page.css +406 -0
- package/src/apps/workflow/public/page.js +658 -0
- package/src/apps/workflow/public/panels/inspector.js +360 -0
- package/src/apps/workflow/public/panels/palette.js +106 -0
- package/src/apps/workflow/public/panels/run-view.js +275 -0
- package/src/apps/workflow/public/panels/toolbar.js +232 -0
- package/src/apps/workflow/public/panels/workflow-list.js +237 -0
- package/src/apps/workflow/public/state/store.js +47 -0
- package/src/apps/workflow/services/custom-node-loader.ts +48 -0
- package/src/apps/workflow/services/legacy-converter.ts +72 -0
- package/src/apps/workflow/services/run-manager.ts +190 -0
- package/src/apps/workflow/services/workflow-store.ts +424 -0
- package/src/apps/workflow/services/workflow-validator.test.ts +103 -0
- package/src/apps/workflow/services/workflow-validator.ts +98 -0
- package/src/apps/workflow/src/index.ts +10 -0
- package/src/apps/workflow/templates/ci-pipeline.json +18 -0
- package/src/apps/workflow/templates/code-review.json +22 -0
- package/src/apps/workflow/templates/kanban-testing.json +24 -0
- package/src/apps/workflow/tsconfig.json +8 -0
- package/src/apps/workflow/types.ts +268 -0
- package/src/packages/auth-middleware.ts +14 -0
- package/src/packages/design-tokens/.turbo/turbo-build.log +10 -0
- package/src/packages/design-tokens/STYLEGUIDE.md +414 -0
- package/src/packages/design-tokens/build.js +413 -0
- package/src/packages/design-tokens/demo/index.html +1367 -0
- package/src/packages/design-tokens/demo/proposition-a.html +717 -0
- package/src/packages/design-tokens/demo/proposition-b.html +1239 -0
- package/src/packages/design-tokens/demo/proposition-c.html +1049 -0
- package/src/packages/design-tokens/dist/tailwind-preset.js +115 -0
- package/src/packages/design-tokens/dist/tokens.css +345 -0
- package/src/packages/design-tokens/dist/tokens.d.ts +229 -0
- package/src/packages/design-tokens/dist/tokens.js +386 -0
- package/src/packages/design-tokens/package.json +25 -0
- package/src/packages/design-tokens/tokens.json +228 -0
- package/src/packages/devtools-middleware.ts +22 -0
- package/src/packages/eslint-config/index.js +63 -0
- package/src/packages/eslint-config/node_modules/.bin/eslint +21 -0
- package/src/packages/eslint-config/package.json +18 -0
- package/src/packages/json-file-store.ts +232 -0
- package/src/packages/mcp-utils/.turbo/turbo-build.log +5 -0
- package/src/packages/mcp-utils/dist/index.d.ts +33 -0
- package/src/packages/mcp-utils/dist/index.d.ts.map +1 -0
- package/src/packages/mcp-utils/dist/index.js +126 -0
- package/src/packages/mcp-utils/dist/index.js.map +1 -0
- package/src/packages/mcp-utils/node_modules/.bin/tsc +21 -0
- package/src/packages/mcp-utils/node_modules/.bin/tsserver +21 -0
- package/src/packages/mcp-utils/package.json +32 -0
- package/src/packages/mcp-utils/src/index.ts +171 -0
- package/src/packages/mcp-utils/tsconfig.json +9 -0
- package/src/packages/paths.ts +18 -0
- package/src/packages/project-context/index.js +55 -0
- package/src/packages/project-context/package.json +13 -0
- package/src/packages/project-store.ts +127 -0
- package/src/packages/server-sniffer.ts +132 -0
- package/src/packages/shared-assets/favicon.svg +7 -0
- package/src/packages/shared-assets/keymap-registry.js +512 -0
- package/src/packages/shared-assets/logo.svg +6 -0
- package/src/packages/shared-assets/package.json +11 -0
- package/src/packages/shared-assets/ui-utils.js +48 -0
- package/src/packages/shared-assets/voice-widget.d.ts +37 -0
- package/src/packages/shared-assets/voice-widget.js +695 -0
- package/src/packages/shared-types/.turbo/turbo-build.log +5 -0
- package/src/packages/shared-types/dist/index.d.ts +39 -0
- package/src/packages/shared-types/dist/index.d.ts.map +1 -0
- package/src/packages/shared-types/node_modules/.bin/tsc +21 -0
- package/src/packages/shared-types/node_modules/.bin/tsserver +21 -0
- package/src/packages/shared-types/package.json +25 -0
- package/src/packages/shared-types/src/index.ts +41 -0
- package/src/packages/shared-types/tsconfig.json +11 -0
- package/src/packages/tsconfig/base.json +15 -0
- package/src/packages/tsconfig/next.json +14 -0
- package/src/packages/tsconfig/node.json +11 -0
- package/src/packages/tsconfig/package.json +10 -0
- package/turbo.json +25 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
# Devglide Design System v2.0
|
|
2
|
+
|
|
3
|
+
> Status: **Active** · Branch: `feature/styleguide` · 143 tokens · 5 color scales · 4 CSS layers
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Design Philosophy
|
|
8
|
+
|
|
9
|
+
The Devglide design system is built on four principles:
|
|
10
|
+
|
|
11
|
+
1. **Dark-first, OKLCH-aware** — All colors are designed for dark mode. The primitive palette is structured for future OKLCH migration, enabling algorithmic theme generation by adjusting hue alone.
|
|
12
|
+
2. **Layered architecture** — CSS `@layer` organizes token priorities cleanly. App styles always win over token layers without needing `!important`.
|
|
13
|
+
3. **Spring-physics motion** — Native CSS spring easing via `linear()` for natural, physics-based transitions. All animations respect `prefers-reduced-motion`.
|
|
14
|
+
4. **Accessible by default** — WCAG 2.2 AA focus rings, screen reader utilities, and semantic color contrast baked into the token system.
|
|
15
|
+
|
|
16
|
+
### Visual Identity
|
|
17
|
+
|
|
18
|
+
| Motif | Description |
|
|
19
|
+
|-------|-------------|
|
|
20
|
+
| **Angular panels** | `clip-path` bevelled corners — the signature shape |
|
|
21
|
+
| **Cool dark background** | Blue-gray dark mode (`#1c2128`, GitHub Dark Dimmed) |
|
|
22
|
+
| **Green accent** | `#7ee787` accent throughout all UI states |
|
|
23
|
+
| **State-driven glows** | `box-shadow` and `drop-shadow` keyed to system state |
|
|
24
|
+
| **Monospace uppercase** | `Courier New` with wide letter-spacing (`0.12–0.2em`) |
|
|
25
|
+
| **CRT scanline sweep** | Horizontal light band sweeping panels |
|
|
26
|
+
| **Corner brackets** | `::before`/`::after` accent decorations |
|
|
27
|
+
| **Spring transitions** | `linear()` easing for natural hover/focus physics |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 2. Token Architecture
|
|
32
|
+
|
|
33
|
+
### Primitive → Semantic Model
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
┌─────────────────────────────────────────────────────────┐
|
|
37
|
+
│ Primitive Palette (39 tokens) │
|
|
38
|
+
│ neutral-0..12 · green-1..9 · red-1..6 · amber · blue │
|
|
39
|
+
└──────────────────────┬──────────────────────────────────┘
|
|
40
|
+
▼
|
|
41
|
+
┌─────────────────────────────────────────────────────────┐
|
|
42
|
+
│ Semantic Tokens (104 tokens) │
|
|
43
|
+
│ color.bg · color.text · color.accent · color.state │
|
|
44
|
+
│ font · fontSize · space · radius · clip · shadow │
|
|
45
|
+
│ glow · opacity · duration · easing · focus · zIndex │
|
|
46
|
+
└─────────────────────────────────────────────────────────┘
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Apps reference **semantic tokens only** — never primitives directly. This enables theme switching by remapping semantic tokens to different primitives.
|
|
50
|
+
|
|
51
|
+
### Package Structure
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
packages/design-tokens/
|
|
55
|
+
tokens.json ← source of truth (edit this)
|
|
56
|
+
build.js ← generates dist/ (zero dependencies)
|
|
57
|
+
dist/
|
|
58
|
+
tokens.css ← CSS custom properties with @layer
|
|
59
|
+
tailwind-preset.js ← Tailwind v3 preset for Kanban
|
|
60
|
+
tokens.js ← ESM constants for JS/SSR
|
|
61
|
+
tokens.d.ts ← TypeScript declarations
|
|
62
|
+
demo/
|
|
63
|
+
index.html ← interactive style guide
|
|
64
|
+
STYLEGUIDE.md ← this document
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Naming Convention
|
|
68
|
+
|
|
69
|
+
All tokens use `--df-{category}-{name}`:
|
|
70
|
+
|
|
71
|
+
| Category | Examples |
|
|
72
|
+
|----------|---------|
|
|
73
|
+
| `primitive-{hue}-{step}` | `--df-primitive-neutral-4`, `--df-primitive-green-7` |
|
|
74
|
+
| `color-bg` | `--df-color-bg-base`, `--df-color-bg-surface`, `--df-color-bg-sunken` |
|
|
75
|
+
| `color-border` | `--df-color-border-default`, `--df-color-border-strong` |
|
|
76
|
+
| `color-text` | `--df-color-text-primary`, `--df-color-text-link` |
|
|
77
|
+
| `color-accent` | `--df-color-accent-default`, `--df-color-accent-subtle` |
|
|
78
|
+
| `color-state` | `--df-color-state-idle`, `--df-color-state-info` |
|
|
79
|
+
| `font` | `--df-font-mono`, `--df-font-ui`, `--df-font-display` |
|
|
80
|
+
| `fontSize` | `--df-fontSize-xs` … `--df-fontSize-3xl` |
|
|
81
|
+
| `space` | `--df-space-1` … `--df-space-24` |
|
|
82
|
+
| `radius` | `--df-radius-xs` … `--df-radius-full` |
|
|
83
|
+
| `clip` | `--df-clip-sm`, `--df-clip-md`, `--df-clip-lg`, `--df-clip-xl` |
|
|
84
|
+
| `shadow` / `glow` | `--df-shadow-lg`, `--df-glow-accent-strong` |
|
|
85
|
+
| `opacity` | `--df-opacity-5` … `--df-opacity-80` |
|
|
86
|
+
| `duration` / `easing` | `--df-duration-fast`, `--df-easing-spring` |
|
|
87
|
+
| `focus` | `--df-focus-ring-width`, `--df-focus-ring-color` |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 3. CSS Architecture: `@layer`
|
|
92
|
+
|
|
93
|
+
The generated `tokens.css` uses CSS cascade layers for clean specificity management:
|
|
94
|
+
|
|
95
|
+
```css
|
|
96
|
+
@layer df-tokens, df-keyframes, df-components, df-utilities;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
| Layer | Contents | Priority |
|
|
100
|
+
|-------|----------|----------|
|
|
101
|
+
| `df-tokens` | Custom properties in `:root`, `@property` declarations | Lowest |
|
|
102
|
+
| `df-keyframes` | `@keyframes` (crt-sweep, glow-pulse, alert, spin, etc.) | |
|
|
103
|
+
| `df-components` | `.df-crt`, `.df-brackets`, `.df-panel`, `.df-spinner`, `.df-focus-ring` | |
|
|
104
|
+
| `df-utilities` | `.df-sr-only`, `prefers-reduced-motion` | Highest |
|
|
105
|
+
|
|
106
|
+
App styles written outside these layers automatically cascade **above** all token layers. No `!important` needed.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 4. Modern CSS Features
|
|
111
|
+
|
|
112
|
+
### `color-mix()` for Theme-Aware Transparency
|
|
113
|
+
|
|
114
|
+
Instead of hardcoding `rgba()` values, use `color-mix()` with token references:
|
|
115
|
+
|
|
116
|
+
```css
|
|
117
|
+
/* Old approach — hardcoded, breaks if accent color changes */
|
|
118
|
+
background: rgba(126, 231, 135, 0.1);
|
|
119
|
+
|
|
120
|
+
/* New approach — derives from the token, adapts to any accent */
|
|
121
|
+
background: color-mix(in srgb, var(--df-color-accent-default) 10%, transparent);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `@property` for Animatable Tokens
|
|
125
|
+
|
|
126
|
+
Three registered custom properties enable smooth CSS-only animations:
|
|
127
|
+
|
|
128
|
+
```css
|
|
129
|
+
@property --df-hue { syntax: '<number>'; initial-value: 150; inherits: true; }
|
|
130
|
+
@property --df-glow-opacity { syntax: '<number>'; initial-value: 0.4; inherits: true; }
|
|
131
|
+
@property --df-scale { syntax: '<number>'; initial-value: 1; inherits: true; }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`--df-hue` is the foundation for OKLCH-based theme rotation. Adjusting it re-themes the entire accent color while maintaining perceptual brightness.
|
|
135
|
+
|
|
136
|
+
### Spring Physics via `linear()`
|
|
137
|
+
|
|
138
|
+
Two spring easing tokens for natural motion:
|
|
139
|
+
|
|
140
|
+
```css
|
|
141
|
+
/* Standard spring — smooth deceleration with slight overshoot */
|
|
142
|
+
transition: transform 300ms var(--df-easing-spring);
|
|
143
|
+
|
|
144
|
+
/* Bouncy spring — visible overshoot and settle */
|
|
145
|
+
transition: transform 500ms var(--df-easing-spring-bouncy);
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### OKLCH Color Space (Future-Ready)
|
|
149
|
+
|
|
150
|
+
The primitive palette is designed for OKLCH migration. The demo page includes an interactive hue slider showing how `oklch(L C H)` enables:
|
|
151
|
+
|
|
152
|
+
- **Single-hue theming** — change one number to re-theme everything
|
|
153
|
+
- **Perceptual uniformity** — equal lightness steps look equally bright across hues
|
|
154
|
+
- **Algorithmic dark/light** — invert lightness values for automatic light mode
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 5. Color Palette
|
|
159
|
+
|
|
160
|
+
### Primitive Scales
|
|
161
|
+
|
|
162
|
+
| Scale | Steps | Range | Use |
|
|
163
|
+
|-------|-------|-------|-----|
|
|
164
|
+
| Neutral | 13 (0–12) | `#0d1117` → `#cdd9e5` | Backgrounds, borders, text |
|
|
165
|
+
| Green | 9 (1–9) | `#0d1f12` → `#b7f5bd` | Accent, success, idle states |
|
|
166
|
+
| Red | 6 (1–6) | `#3d0d0d` → `#ff6b6b` | Error, recording, danger |
|
|
167
|
+
| Amber | 6 (1–6) | `#3d2600` → `#f0c84d` | Warning, processing |
|
|
168
|
+
| Blue | 5 (1–5) | `#0d2240` → `#79c0ff` | Info, links |
|
|
169
|
+
|
|
170
|
+
### Semantic Colors
|
|
171
|
+
|
|
172
|
+
| Token | Value | Use |
|
|
173
|
+
|-------|-------|-----|
|
|
174
|
+
| `--df-color-bg-sunken` | `#161b22` | Recessed areas, code blocks |
|
|
175
|
+
| `--df-color-bg-base` | `#1c2128` | Page background |
|
|
176
|
+
| `--df-color-bg-surface` | `#22272e` | Cards, panels |
|
|
177
|
+
| `--df-color-bg-raised` | `#2d333b` | Elevated elements, dropdowns |
|
|
178
|
+
| `--df-color-bg-overlay` | `#353b44` | Modals, overlays |
|
|
179
|
+
| `--df-color-accent-default` | `#7ee787` | Primary accent |
|
|
180
|
+
| `--df-color-state-info` | `#58a6ff` | Informational messages |
|
|
181
|
+
| `--df-color-text-link` | `#58a6ff` | Hyperlinks |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 6. Motion & Animation
|
|
186
|
+
|
|
187
|
+
### Duration Scale
|
|
188
|
+
|
|
189
|
+
| Token | Value | Use |
|
|
190
|
+
|-------|-------|-----|
|
|
191
|
+
| `--df-duration-fast` | `150ms` | Hover, focus transitions |
|
|
192
|
+
| `--df-duration-base` | `250ms` | Standard transitions |
|
|
193
|
+
| `--df-duration-slow` | `400ms` | Entrance animations |
|
|
194
|
+
| `--df-duration-slower` | `600ms` | Complex multi-step animations |
|
|
195
|
+
|
|
196
|
+
### Easing
|
|
197
|
+
|
|
198
|
+
| Token | Value | Use |
|
|
199
|
+
|-------|-------|-----|
|
|
200
|
+
| `--df-easing-default` | `ease` | General purpose |
|
|
201
|
+
| `--df-easing-spring` | `linear(...)` | Natural deceleration with slight overshoot |
|
|
202
|
+
| `--df-easing-spring-bouncy` | `linear(...)` | Playful bounce for interactive elements |
|
|
203
|
+
|
|
204
|
+
### Built-in Keyframes
|
|
205
|
+
|
|
206
|
+
| Animation | Duration | Use |
|
|
207
|
+
|-----------|----------|-----|
|
|
208
|
+
| `df-crt-sweep` | 4s linear infinite | CRT scanline overlay |
|
|
209
|
+
| `df-glow-pulse` | 2s ease infinite | Accent glow breathing |
|
|
210
|
+
| `df-alert-pulse` | 1.2s ease infinite | Error/recording pulse |
|
|
211
|
+
| `df-processing-pulse` | 2s ease infinite | Amber processing pulse |
|
|
212
|
+
| `df-blink` | 1s step-start infinite | Cursor blink |
|
|
213
|
+
| `df-fade-in` | entry | Fade entrance |
|
|
214
|
+
| `df-slide-up` | entry | Slide-up entrance |
|
|
215
|
+
| `df-spin` | 0.6s linear infinite | Loading spinner |
|
|
216
|
+
|
|
217
|
+
### Reduced Motion
|
|
218
|
+
|
|
219
|
+
All decorative animations are disabled when the user prefers reduced motion:
|
|
220
|
+
|
|
221
|
+
```css
|
|
222
|
+
@media (prefers-reduced-motion: reduce) {
|
|
223
|
+
.df-crt::after, .df-grid {
|
|
224
|
+
animation: none;
|
|
225
|
+
background-image: none;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 7. Accessibility
|
|
233
|
+
|
|
234
|
+
### Focus Indicators (WCAG 2.2)
|
|
235
|
+
|
|
236
|
+
Focus tokens meet WCAG 2.2 criteria 2.4.11 (Focus Not Obscured) and 2.4.13 (Focus Appearance):
|
|
237
|
+
|
|
238
|
+
```css
|
|
239
|
+
:focus-visible {
|
|
240
|
+
outline: var(--df-focus-ring-width) solid var(--df-focus-ring-color); /* 2px #7ee787 */
|
|
241
|
+
outline-offset: var(--df-focus-ring-offset); /* 2px gap */
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
- **2px width** meets minimum size requirement
|
|
246
|
+
- **Green on dark** provides >3:1 contrast against all background tokens
|
|
247
|
+
- **`:focus-visible`** only — no focus ring on mouse clicks
|
|
248
|
+
|
|
249
|
+
### Screen Reader Utility
|
|
250
|
+
|
|
251
|
+
```css
|
|
252
|
+
.df-sr-only {
|
|
253
|
+
position: absolute; width: 1px; height: 1px;
|
|
254
|
+
clip: rect(0, 0, 0, 0); overflow: hidden;
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Color Contrast
|
|
259
|
+
|
|
260
|
+
All text/background combinations in the semantic token set meet WCAG AA:
|
|
261
|
+
|
|
262
|
+
| Combination | Ratio | Requirement |
|
|
263
|
+
|-------------|-------|-------------|
|
|
264
|
+
| `text-primary` on `bg-base` | ~7.8:1 | 4.5:1 (AA normal) |
|
|
265
|
+
| `text-secondary` on `bg-base` | ~4.6:1 | 4.5:1 (AA normal) |
|
|
266
|
+
| `text-muted` on `bg-base` | ~4.6:1 | 4.5:1 (AA normal) — updated from neutral-7 (#545d68, ~3.5:1 fail) to neutral-8 (#636e7b) for WCAG AA compliance |
|
|
267
|
+
| `accent-default` on `bg-base` | ~8.5:1 | 4.5:1 (AA normal) |
|
|
268
|
+
| `text-primary` on `bg-surface` | ~6.5:1 | 4.5:1 (AA normal) |
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## 8. Usage
|
|
273
|
+
|
|
274
|
+
### Vanilla Apps (HTML/CSS)
|
|
275
|
+
|
|
276
|
+
```html
|
|
277
|
+
<link rel="stylesheet" href="/path/to/@devglide/design-tokens/dist/tokens.css" />
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
```css
|
|
281
|
+
.my-panel {
|
|
282
|
+
background: var(--df-color-bg-surface);
|
|
283
|
+
border: 1px solid var(--df-color-border-default);
|
|
284
|
+
clip-path: var(--df-clip-md);
|
|
285
|
+
font-family: var(--df-font-mono);
|
|
286
|
+
transition: all var(--df-duration-base) var(--df-easing-spring);
|
|
287
|
+
}
|
|
288
|
+
.my-panel:hover {
|
|
289
|
+
box-shadow: var(--df-glow-accent);
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Kanban (Tailwind)
|
|
294
|
+
|
|
295
|
+
```ts
|
|
296
|
+
import dfPreset from '@devglide/design-tokens/tailwind';
|
|
297
|
+
|
|
298
|
+
export default {
|
|
299
|
+
presets: [dfPreset],
|
|
300
|
+
};
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
<div className="bg-df-surface border border-df-border text-df-text font-df-mono
|
|
305
|
+
transition-all duration-df-base ease-df-spring">
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### JavaScript / TypeScript
|
|
309
|
+
|
|
310
|
+
```ts
|
|
311
|
+
import { colors, primitives, easings } from '@devglide/design-tokens';
|
|
312
|
+
|
|
313
|
+
// Semantic tokens
|
|
314
|
+
ctx.fillStyle = colors.accent.default; // '#7ee787'
|
|
315
|
+
|
|
316
|
+
// Primitive palette
|
|
317
|
+
ctx.strokeStyle = primitives.green[4]; // '#2ea043'
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 9. Component Patterns
|
|
323
|
+
|
|
324
|
+
### Angular Panel
|
|
325
|
+
|
|
326
|
+
```css
|
|
327
|
+
.panel {
|
|
328
|
+
background: var(--df-color-bg-surface);
|
|
329
|
+
border: 1px solid var(--df-color-border-default);
|
|
330
|
+
clip-path: var(--df-clip-md);
|
|
331
|
+
padding: var(--df-space-4) var(--df-space-6);
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Status Badge with `color-mix()`
|
|
336
|
+
|
|
337
|
+
```css
|
|
338
|
+
.badge-success {
|
|
339
|
+
color: var(--df-color-state-success);
|
|
340
|
+
border: 1px solid var(--df-color-state-success);
|
|
341
|
+
background: color-mix(in srgb, var(--df-color-state-success) 10%, transparent);
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Alert with Tinted Background
|
|
346
|
+
|
|
347
|
+
```css
|
|
348
|
+
.alert-error {
|
|
349
|
+
border-left: 3px solid var(--df-color-state-error);
|
|
350
|
+
background: color-mix(in srgb, var(--df-color-state-error) 6%, var(--df-color-bg-surface));
|
|
351
|
+
color: var(--df-color-state-error);
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Focus Ring
|
|
356
|
+
|
|
357
|
+
```css
|
|
358
|
+
.interactive:focus-visible {
|
|
359
|
+
outline: var(--df-focus-ring-width) solid var(--df-focus-ring-color);
|
|
360
|
+
outline-offset: var(--df-focus-ring-offset);
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## 10. What's New in v2.0
|
|
367
|
+
|
|
368
|
+
| Feature | v1.0 | v2.0 |
|
|
369
|
+
|---------|------|------|
|
|
370
|
+
| Tokens | 82 semantic | 143 (39 primitive + 104 semantic) |
|
|
371
|
+
| Color scales | 1 (green) | 5 (neutral, green, red, amber, blue) |
|
|
372
|
+
| CSS layers | None | 4 `@layer` cascade layers |
|
|
373
|
+
| Easing | 4 basic | 6 including 2 spring physics |
|
|
374
|
+
| Radius | 3 (none, sm, md) | 7 (none, xs, sm, md, lg, xl, full) |
|
|
375
|
+
| Focus tokens | None | 3 (width, offset, color) |
|
|
376
|
+
| Opacity scale | None | 6 steps (5-80%) |
|
|
377
|
+
| Animations | 3 (CRT, grid, brackets) | 8 (+ fade, slide, spin, processing pulse) |
|
|
378
|
+
| `@property` | None | 3 animatable custom properties |
|
|
379
|
+
| `color-mix()` | Used in demo | Used in components + documented as standard |
|
|
380
|
+
| Accessibility | Basic | WCAG 2.2 focus, sr-only, reduced motion |
|
|
381
|
+
| Demo page | 10 sections | 17 sections with OKLCH explorer + search |
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## 11. Migration from v1.0
|
|
386
|
+
|
|
387
|
+
All existing `--df-*` tokens are preserved with identical values. Migration is additive:
|
|
388
|
+
|
|
389
|
+
### Breaking Changes
|
|
390
|
+
|
|
391
|
+
- **`--df-radius-sm`** changed from `2px` to `4px` (was `sm`, now maps to `xs`=2px, `sm`=4px)
|
|
392
|
+
|
|
393
|
+
### New Tokens (safe to adopt incrementally)
|
|
394
|
+
|
|
395
|
+
- `--df-color-bg-sunken` — recessed areas
|
|
396
|
+
- `--df-color-accent-subtle` — darkest accent tint
|
|
397
|
+
- `--df-color-text-link` — hyperlink color
|
|
398
|
+
- `--df-color-state-info` — informational state
|
|
399
|
+
- `--df-font-display` — display/heading font stack
|
|
400
|
+
- `--df-radius-lg`, `--df-radius-xl`, `--df-radius-full` — expanded radius
|
|
401
|
+
- `--df-shadow-xl` — extra-large shadow
|
|
402
|
+
- `--df-glow-processing` — amber processing glow
|
|
403
|
+
- `--df-opacity-*` — opacity scale
|
|
404
|
+
- `--df-easing-spring`, `--df-easing-spring-bouncy` — spring physics
|
|
405
|
+
- `--df-focus-ring-*` — focus indicator tokens
|
|
406
|
+
- `--df-primitive-*` — full primitive palette
|
|
407
|
+
|
|
408
|
+
### Recommended Migration Steps
|
|
409
|
+
|
|
410
|
+
1. Update `tokens.css` import (same path, just newer file)
|
|
411
|
+
2. Replace hardcoded `rgba()` with `color-mix()` patterns
|
|
412
|
+
3. Add `:focus-visible` with `--df-focus-ring-*` tokens
|
|
413
|
+
4. Adopt spring easing on interactive transitions
|
|
414
|
+
5. (Optional) Use primitive tokens for custom component palettes
|