@codepom/tokens 0.1.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/css/reset.css +15 -0
- package/css/tokens.css +95 -0
- package/js/index.js +64 -0
- package/package.json +41 -0
- package/tailwind/preset.js +48 -0
package/css/reset.css
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* CodePom minimal reset — safe to import alongside any framework */
|
|
2
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
3
|
+
|
|
4
|
+
:focus-visible {
|
|
5
|
+
outline: 2px solid var(--cp-amber-400);
|
|
6
|
+
outline-offset: 2px;
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
}
|
|
9
|
+
:focus:not(:focus-visible) { outline: none; }
|
|
10
|
+
|
|
11
|
+
.cp-sr-only {
|
|
12
|
+
position: absolute; width: 1px; height: 1px;
|
|
13
|
+
padding: 0; margin: -1px; overflow: hidden;
|
|
14
|
+
clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
|
|
15
|
+
}
|
package/css/tokens.css
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* ── Brand palette ──────────────────────────────────────────────── */
|
|
3
|
+
--cp-navy-950: #08192E;
|
|
4
|
+
--cp-navy-900: #0B132B;
|
|
5
|
+
--cp-navy-800: #1C2541;
|
|
6
|
+
--cp-navy-700: #3A506B; /* borders & decorative only */
|
|
7
|
+
|
|
8
|
+
--cp-amber-400: #FBB040;
|
|
9
|
+
--cp-amber-500: #F59E0B;
|
|
10
|
+
--cp-amber-600: #EA580C;
|
|
11
|
+
|
|
12
|
+
--cp-cyan-400: #00DFFF;
|
|
13
|
+
--cp-cyan-500: #38BDF8;
|
|
14
|
+
|
|
15
|
+
--cp-ivory-50: #FDFCF0;
|
|
16
|
+
--cp-ivory-100: #F8FAFC;
|
|
17
|
+
|
|
18
|
+
/* ── Semantic colors ────────────────────────────────────────────── */
|
|
19
|
+
--cp-background: #0B132B;
|
|
20
|
+
--cp-foreground: #F8FAFC;
|
|
21
|
+
--cp-card: #08192E;
|
|
22
|
+
--cp-primary: #FBB040;
|
|
23
|
+
--cp-secondary: #1C2541;
|
|
24
|
+
--cp-accent: #00DFFF;
|
|
25
|
+
--cp-border: #1C2541;
|
|
26
|
+
|
|
27
|
+
/* ── Feedback ───────────────────────────────────────────────────── */
|
|
28
|
+
--cp-success: #4ADE80;
|
|
29
|
+
--cp-warning: #FB923C;
|
|
30
|
+
--cp-error: #F87171;
|
|
31
|
+
|
|
32
|
+
/* ── Accessible text scale (WCAG AA on --cp-navy-900) ──────────── */
|
|
33
|
+
--cp-text-primary: #F8FAFC; /* 17.6:1 — body, headings */
|
|
34
|
+
--cp-text-secondary: #94A3B8; /* 7.2:1 — labels, captions */
|
|
35
|
+
--cp-text-tertiary: #64748B; /* 3.9:1 — large text / decorative */
|
|
36
|
+
--cp-text-on-primary: #0B132B; /* text on amber/cyan surfaces */
|
|
37
|
+
|
|
38
|
+
/* ── Typography ─────────────────────────────────────────────────── */
|
|
39
|
+
--cp-font-sans: "Space Grotesk", system-ui, sans-serif;
|
|
40
|
+
--cp-font-mono: "Space Mono", "Courier New", monospace;
|
|
41
|
+
|
|
42
|
+
/* ── Border radius ───────────────────────────────────────────────── */
|
|
43
|
+
--cp-radius-sm: 6px;
|
|
44
|
+
--cp-radius-md: 8px;
|
|
45
|
+
--cp-radius-lg: 12px;
|
|
46
|
+
--cp-radius-xl: 14px;
|
|
47
|
+
--cp-radius-full: 9999px;
|
|
48
|
+
|
|
49
|
+
/* ── Spacing — 8pt grid ──────────────────────────────────────────── */
|
|
50
|
+
--cp-space-0: 0px;
|
|
51
|
+
--cp-space-1: 4px;
|
|
52
|
+
--cp-space-2: 8px;
|
|
53
|
+
--cp-space-3: 12px;
|
|
54
|
+
--cp-space-4: 16px;
|
|
55
|
+
--cp-space-5: 20px;
|
|
56
|
+
--cp-space-6: 24px;
|
|
57
|
+
--cp-space-8: 32px;
|
|
58
|
+
--cp-space-10: 40px;
|
|
59
|
+
--cp-space-12: 48px;
|
|
60
|
+
--cp-space-16: 64px;
|
|
61
|
+
--cp-space-20: 80px;
|
|
62
|
+
--cp-space-24: 96px;
|
|
63
|
+
|
|
64
|
+
/* ── Elevation — navy-tinted shadows ────────────────────────────── */
|
|
65
|
+
--cp-shadow-0: none;
|
|
66
|
+
--cp-shadow-1: 0 1px 2px 0 rgba(5,10,24,0.4);
|
|
67
|
+
--cp-shadow-2: 0 2px 8px 0 rgba(5,10,24,0.5), 0 1px 2px 0 rgba(5,10,24,0.3);
|
|
68
|
+
--cp-shadow-3: 0 4px 16px 0 rgba(5,10,24,0.6), 0 2px 4px 0 rgba(5,10,24,0.3);
|
|
69
|
+
--cp-shadow-4: 0 8px 32px 0 rgba(5,10,24,0.7), 0 4px 8px 0 rgba(5,10,24,0.4);
|
|
70
|
+
--cp-shadow-5: 0 16px 48px 0 rgba(5,10,24,0.8), 0 8px 16px 0 rgba(5,10,24,0.5);
|
|
71
|
+
|
|
72
|
+
/* ── Motion ─────────────────────────────────────────────────────── */
|
|
73
|
+
--cp-duration-instant: 0ms;
|
|
74
|
+
--cp-duration-fast: 100ms;
|
|
75
|
+
--cp-duration-normal: 200ms;
|
|
76
|
+
--cp-duration-slow: 350ms;
|
|
77
|
+
--cp-duration-enter: 250ms;
|
|
78
|
+
--cp-duration-exit: 150ms;
|
|
79
|
+
|
|
80
|
+
--cp-ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
|
|
81
|
+
--cp-ease-in: cubic-bezier(0.4, 0.0, 1.0, 1);
|
|
82
|
+
--cp-ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
83
|
+
--cp-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
84
|
+
|
|
85
|
+
/* ── Focus ───────────────────────────────────────────────────────── */
|
|
86
|
+
--cp-focus-ring: 0 0 0 2px var(--cp-amber-400);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@media (prefers-reduced-motion: reduce) {
|
|
90
|
+
*, *::before, *::after {
|
|
91
|
+
animation-duration: 0.01ms !important;
|
|
92
|
+
animation-iteration-count: 1 !important;
|
|
93
|
+
transition-duration: 0.01ms !important;
|
|
94
|
+
}
|
|
95
|
+
}
|
package/js/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** CodePom design tokens as JS constants. Import for runtime theming or Style Dictionary pipelines. */
|
|
2
|
+
|
|
3
|
+
export const colors = {
|
|
4
|
+
navy: { 950: '#08192E', 900: '#0B132B', 800: '#1C2541', 700: '#3A506B' },
|
|
5
|
+
amber: { 400: '#FBB040', 500: '#F59E0B', 600: '#EA580C' },
|
|
6
|
+
cyan: { 400: '#00DFFF', 500: '#38BDF8' },
|
|
7
|
+
ivory: { 50: '#FDFCF0', 100: '#F8FAFC' },
|
|
8
|
+
success: '#4ADE80',
|
|
9
|
+
warning: '#FB923C',
|
|
10
|
+
error: '#F87171',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const semantic = {
|
|
14
|
+
background: '#0B132B',
|
|
15
|
+
foreground: '#F8FAFC',
|
|
16
|
+
card: '#08192E',
|
|
17
|
+
primary: '#FBB040',
|
|
18
|
+
secondary: '#1C2541',
|
|
19
|
+
accent: '#00DFFF',
|
|
20
|
+
border: '#1C2541',
|
|
21
|
+
textPrimary: '#F8FAFC',
|
|
22
|
+
textSecondary: '#94A3B8',
|
|
23
|
+
textTertiary: '#64748B',
|
|
24
|
+
textOnPrimary: '#0B132B',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const spacing = {
|
|
28
|
+
0: '0px', 1: '4px', 2: '8px', 3: '12px', 4: '16px',
|
|
29
|
+
5: '20px', 6: '24px', 8: '32px', 10: '40px',
|
|
30
|
+
12: '48px', 16: '64px', 20: '80px', 24: '96px',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const radius = {
|
|
34
|
+
sm: '6px', md: '8px', lg: '12px', xl: '14px', full: '9999px',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const shadow = {
|
|
38
|
+
0: 'none',
|
|
39
|
+
1: '0 1px 2px 0 rgba(5,10,24,0.4)',
|
|
40
|
+
2: '0 2px 8px 0 rgba(5,10,24,0.5), 0 1px 2px 0 rgba(5,10,24,0.3)',
|
|
41
|
+
3: '0 4px 16px 0 rgba(5,10,24,0.6), 0 2px 4px 0 rgba(5,10,24,0.3)',
|
|
42
|
+
4: '0 8px 32px 0 rgba(5,10,24,0.7), 0 4px 8px 0 rgba(5,10,24,0.4)',
|
|
43
|
+
5: '0 16px 48px 0 rgba(5,10,24,0.8), 0 8px 16px 0 rgba(5,10,24,0.5)',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const duration = {
|
|
47
|
+
instant: '0ms', fast: '100ms', normal: '200ms',
|
|
48
|
+
slow: '350ms', enter: '250ms', exit: '150ms',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const easing = {
|
|
52
|
+
out: 'cubic-bezier(0.0,0.0,0.2,1)',
|
|
53
|
+
in: 'cubic-bezier(0.4,0.0,1.0,1)',
|
|
54
|
+
inOut: 'cubic-bezier(0.4,0.0,0.2,1)',
|
|
55
|
+
spring: 'cubic-bezier(0.34,1.56,0.64,1)',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const font = {
|
|
59
|
+
sans: '"Space Grotesk", system-ui, sans-serif',
|
|
60
|
+
mono: '"Space Mono", "Courier New", monospace',
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const tokens = { colors, semantic, spacing, radius, shadow, duration, easing, font };
|
|
64
|
+
export default tokens;
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codepom/tokens",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CodePom design tokens — CSS custom properties, JS constants, Tailwind preset",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./css": "./css/tokens.css",
|
|
8
|
+
"./reset": "./css/reset.css",
|
|
9
|
+
"./js": "./js/index.js",
|
|
10
|
+
"./tailwind": "./tailwind/preset.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"css",
|
|
14
|
+
"js",
|
|
15
|
+
"tailwind"
|
|
16
|
+
],
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"*.css"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"design-tokens",
|
|
22
|
+
"codepom",
|
|
23
|
+
"css-variables",
|
|
24
|
+
"tailwind",
|
|
25
|
+
"design-system"
|
|
26
|
+
],
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"registry": "https://registry.npmjs.org/"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/codepom/design-system.git",
|
|
35
|
+
"directory": "packages/tokens"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/codepom/design-system#readme",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/codepom/design-system/issues"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
const preset = {
|
|
3
|
+
theme: {
|
|
4
|
+
extend: {
|
|
5
|
+
colors: {
|
|
6
|
+
navy: { 950: '#08192E', 900: '#0B132B', 800: '#1C2541', 700: '#3A506B' },
|
|
7
|
+
amber: { 400: '#FBB040', 500: '#F59E0B', 600: '#EA580C' },
|
|
8
|
+
cyan: { 400: '#00DFFF', 500: '#38BDF8' },
|
|
9
|
+
ivory: { 50: '#FDFCF0', 100: '#F8FAFC' },
|
|
10
|
+
success: '#4ADE80',
|
|
11
|
+
warning: '#FB923C',
|
|
12
|
+
error: '#F87171',
|
|
13
|
+
foreground: '#F8FAFC',
|
|
14
|
+
background: '#0B132B',
|
|
15
|
+
muted: '#94A3B8',
|
|
16
|
+
border: '#1C2541',
|
|
17
|
+
card: '#08192E',
|
|
18
|
+
primary: '#FBB040',
|
|
19
|
+
accent: '#00DFFF',
|
|
20
|
+
},
|
|
21
|
+
fontFamily: {
|
|
22
|
+
sans: ['"Space Grotesk"', 'system-ui', 'sans-serif'],
|
|
23
|
+
mono: ['"Space Mono"', '"Courier New"', 'monospace'],
|
|
24
|
+
},
|
|
25
|
+
borderRadius: {
|
|
26
|
+
sm: '6px', md: '8px', lg: '12px', xl: '14px',
|
|
27
|
+
},
|
|
28
|
+
boxShadow: {
|
|
29
|
+
'cp-1': '0 1px 2px 0 rgba(5,10,24,0.4)',
|
|
30
|
+
'cp-2': '0 2px 8px 0 rgba(5,10,24,0.5), 0 1px 2px 0 rgba(5,10,24,0.3)',
|
|
31
|
+
'cp-3': '0 4px 16px 0 rgba(5,10,24,0.6), 0 2px 4px 0 rgba(5,10,24,0.3)',
|
|
32
|
+
'cp-4': '0 8px 32px 0 rgba(5,10,24,0.7), 0 4px 8px 0 rgba(5,10,24,0.4)',
|
|
33
|
+
'cp-5': '0 16px 48px 0 rgba(5,10,24,0.8), 0 8px 16px 0 rgba(5,10,24,0.5)',
|
|
34
|
+
},
|
|
35
|
+
spacing: {
|
|
36
|
+
1: '4px', 2: '8px', 3: '12px', 4: '16px', 5: '20px',
|
|
37
|
+
6: '24px', 8: '32px', 10: '40px', 12: '48px',
|
|
38
|
+
16: '64px', 20: '80px', 24: '96px',
|
|
39
|
+
},
|
|
40
|
+
transitionDuration: {
|
|
41
|
+
instant: '0ms', fast: '100ms', normal: '200ms',
|
|
42
|
+
slow: '350ms', enter: '250ms', exit: '150ms',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
module.exports = preset;
|