@ds-mo/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/LICENSE +21 -0
- package/README.md +145 -0
- package/dist/colors.css +745 -0
- package/dist/dimensions.css +165 -0
- package/dist/effects.css +241 -0
- package/dist/globals.css +112 -0
- package/dist/index.cjs +713 -0
- package/dist/index.css +15 -0
- package/dist/index.d.ts +713 -0
- package/dist/index.mjs +713 -0
- package/dist/json/colors.json +1758 -0
- package/dist/json/dimensions.json +514 -0
- package/dist/json/effects.json +474 -0
- package/dist/json/typography.json +114 -0
- package/dist/reset.css +51 -0
- package/dist/themes/dark.css +12 -0
- package/dist/themes/light.css +13 -0
- package/dist/tokens.json +2854 -0
- package/dist/typography.css +161 -0
- package/dist/utilities.css +187 -0
- package/package.json +75 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/* AUTO-GENERATED + HAND-AUTHORED. See scripts/generate-typography-tokens.mjs */
|
|
2
|
+
/* Generated section: from src/json/typography/typography.tokens.json */
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
/* Font weights */
|
|
6
|
+
--typography-weight-regular: 400;
|
|
7
|
+
--typography-weight-medium: 500;
|
|
8
|
+
--typography-weight-semibold: 600;
|
|
9
|
+
--typography-weight-bold: 700;
|
|
10
|
+
|
|
11
|
+
/* Font sizes */
|
|
12
|
+
--typography-fontsize-xs: 9px;
|
|
13
|
+
--typography-fontsize-sm: 12px;
|
|
14
|
+
--typography-fontsize-md: 14px;
|
|
15
|
+
--typography-fontsize-lg: 18px;
|
|
16
|
+
--typography-fontsize-xl: 24px;
|
|
17
|
+
--typography-fontsize-2xl: 32px;
|
|
18
|
+
--typography-fontsize-3xl: 44px;
|
|
19
|
+
|
|
20
|
+
/* Line heights */
|
|
21
|
+
--typography-lineheight-xs: 12px;
|
|
22
|
+
--typography-lineheight-sm: 16px;
|
|
23
|
+
--typography-lineheight-md: 20px;
|
|
24
|
+
--typography-lineheight-lg: 24px;
|
|
25
|
+
--typography-lineheight-xl: 32px;
|
|
26
|
+
--typography-lineheight-2xl: 48px;
|
|
27
|
+
--typography-lineheight-3xl: 64px;
|
|
28
|
+
|
|
29
|
+
/* Letter spacing */
|
|
30
|
+
--typography-letterspacing-none: 0px;
|
|
31
|
+
--typography-letterspacing-positive: 0.3px;
|
|
32
|
+
--typography-letterspacing-negative-half: -0.15px;
|
|
33
|
+
--typography-letterspacing-negative: -0.3px;
|
|
34
|
+
--typography-letterspacing-negative-double: -0.6px;
|
|
35
|
+
|
|
36
|
+
/* Paragraph spacing */
|
|
37
|
+
--typography-paragraphspacing-none: 0px;
|
|
38
|
+
--typography-paragraphspacing-sm: 4px;
|
|
39
|
+
--typography-paragraphspacing-md: 8px;
|
|
40
|
+
--typography-paragraphspacing-lg: 12px;
|
|
41
|
+
|
|
42
|
+
/* ─────────────────────────────────────────────────────────────────────────
|
|
43
|
+
HAND-AUTHORED — Font family.
|
|
44
|
+
Not exported as a Figma variable in this collection. Override here to
|
|
45
|
+
swap the entire typeface without touching individual text style classes.
|
|
46
|
+
───────────────────────────────────────────────────────────────────────── */
|
|
47
|
+
--typography-font-family: 'Inter', sans-serif;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* ─────────────────────────────────────────────────────────────────────────────
|
|
51
|
+
HAND-AUTHORED — Text style classes.
|
|
52
|
+
These compose multiple typography tokens into reusable CSS classes.
|
|
53
|
+
They cannot be expressed as Figma variables (they are text styles, not variables).
|
|
54
|
+
All property values reference CSS custom properties — no hard-coded values.
|
|
55
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
56
|
+
|
|
57
|
+
.text-display-medium {
|
|
58
|
+
font-family: var(--typography-font-family);
|
|
59
|
+
font-size: var(--typography-fontsize-3xl);
|
|
60
|
+
line-height: var(--typography-lineheight-3xl);
|
|
61
|
+
font-weight: var(--typography-weight-bold);
|
|
62
|
+
letter-spacing: var(--typography-letterspacing-negative-double);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.text-display-small {
|
|
66
|
+
font-family: var(--typography-font-family);
|
|
67
|
+
font-size: var(--typography-fontsize-2xl);
|
|
68
|
+
line-height: var(--typography-lineheight-2xl);
|
|
69
|
+
font-weight: var(--typography-weight-bold);
|
|
70
|
+
letter-spacing: var(--typography-letterspacing-negative-double);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.text-title-large {
|
|
74
|
+
font-family: var(--typography-font-family);
|
|
75
|
+
font-size: var(--typography-fontsize-xl);
|
|
76
|
+
line-height: var(--typography-lineheight-xl);
|
|
77
|
+
font-weight: var(--typography-weight-semibold);
|
|
78
|
+
letter-spacing: var(--typography-letterspacing-negative-double);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.text-title-medium {
|
|
82
|
+
font-family: var(--typography-font-family);
|
|
83
|
+
font-size: var(--typography-fontsize-lg);
|
|
84
|
+
line-height: var(--typography-lineheight-lg);
|
|
85
|
+
font-weight: var(--typography-weight-semibold);
|
|
86
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.text-title-small {
|
|
90
|
+
font-family: var(--typography-font-family);
|
|
91
|
+
font-size: var(--typography-fontsize-md);
|
|
92
|
+
line-height: var(--typography-lineheight-md);
|
|
93
|
+
font-weight: var(--typography-weight-semibold);
|
|
94
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.text-body-large {
|
|
98
|
+
font-family: var(--typography-font-family);
|
|
99
|
+
font-size: var(--typography-fontsize-lg);
|
|
100
|
+
line-height: var(--typography-lineheight-lg);
|
|
101
|
+
font-weight: var(--typography-weight-regular);
|
|
102
|
+
letter-spacing: var(--typography-letterspacing-negative-half);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.text-body-large-emphasis {
|
|
106
|
+
font-family: var(--typography-font-family);
|
|
107
|
+
font-size: var(--typography-fontsize-lg);
|
|
108
|
+
line-height: var(--typography-lineheight-lg);
|
|
109
|
+
font-weight: var(--typography-weight-medium);
|
|
110
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.text-body-medium {
|
|
114
|
+
font-family: var(--typography-font-family);
|
|
115
|
+
font-size: var(--typography-fontsize-md);
|
|
116
|
+
line-height: var(--typography-lineheight-md);
|
|
117
|
+
font-weight: var(--typography-weight-regular);
|
|
118
|
+
letter-spacing: var(--typography-letterspacing-negative-half);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.text-body-medium-emphasis {
|
|
122
|
+
font-family: var(--typography-font-family);
|
|
123
|
+
font-size: var(--typography-fontsize-md);
|
|
124
|
+
line-height: var(--typography-lineheight-md);
|
|
125
|
+
font-weight: var(--typography-weight-medium);
|
|
126
|
+
letter-spacing: var(--typography-letterspacing-negative);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.text-body-small {
|
|
130
|
+
font-family: var(--typography-font-family);
|
|
131
|
+
font-size: var(--typography-fontsize-sm);
|
|
132
|
+
line-height: var(--typography-lineheight-sm);
|
|
133
|
+
font-weight: var(--typography-weight-regular);
|
|
134
|
+
letter-spacing: var(--typography-letterspacing-none);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.text-body-small-emphasis {
|
|
138
|
+
font-family: var(--typography-font-family);
|
|
139
|
+
font-size: var(--typography-fontsize-sm);
|
|
140
|
+
line-height: var(--typography-lineheight-sm);
|
|
141
|
+
font-weight: var(--typography-weight-medium);
|
|
142
|
+
letter-spacing: var(--typography-letterspacing-negative-half);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.text-caption {
|
|
146
|
+
font-family: var(--typography-font-family);
|
|
147
|
+
font-size: var(--typography-fontsize-xs);
|
|
148
|
+
line-height: var(--typography-lineheight-xs);
|
|
149
|
+
font-weight: var(--typography-weight-medium);
|
|
150
|
+
text-transform: uppercase;
|
|
151
|
+
letter-spacing: var(--typography-letterspacing-positive);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.text-caption-emphasis {
|
|
155
|
+
font-family: var(--typography-font-family);
|
|
156
|
+
font-size: var(--typography-fontsize-xs);
|
|
157
|
+
line-height: var(--typography-lineheight-xs);
|
|
158
|
+
font-weight: var(--typography-weight-semibold);
|
|
159
|
+
text-transform: uppercase;
|
|
160
|
+
letter-spacing: var(--typography-letterspacing-positive);
|
|
161
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility CSS Classes
|
|
3
|
+
* Reusable utility classes for common patterns across components
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* ============================================
|
|
7
|
+
INTERACTION PATTERNS
|
|
8
|
+
Common hover/pressed overlay patterns for buttons
|
|
9
|
+
============================================ */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Button interaction base
|
|
13
|
+
* Apply to any interactive element that needs hover/pressed states
|
|
14
|
+
* Usage: class="buttonInteraction" on the button element
|
|
15
|
+
*/
|
|
16
|
+
.buttonInteraction {
|
|
17
|
+
position: relative;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.buttonInteraction::before {
|
|
22
|
+
content: '';
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
background-color: var(--color-background-shade);
|
|
26
|
+
opacity: 0;
|
|
27
|
+
transition: opacity var(--effect-motion-short-2);
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
border-radius: inherit;
|
|
30
|
+
z-index: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.buttonInteraction:hover::before {
|
|
34
|
+
opacity: 0.08;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.buttonInteraction:active::before {
|
|
38
|
+
opacity: 0.16;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.buttonInteraction:disabled::before {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* ============================================
|
|
46
|
+
BUTTON PRESS ANIMATION
|
|
47
|
+
Scale-down effect on press
|
|
48
|
+
============================================ */
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Button press scale effect
|
|
52
|
+
* Already exists in globals.css but documented here for reference
|
|
53
|
+
* Usage: class="buttonPress" on the button element
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/* ============================================
|
|
57
|
+
FOCUS STATES
|
|
58
|
+
Consistent focus ring styles
|
|
59
|
+
============================================ */
|
|
60
|
+
|
|
61
|
+
.focusRing {
|
|
62
|
+
outline: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.focusRing:focus-visible {
|
|
66
|
+
outline: var(--dimension-stroke-width-025) solid var(--color-foreground-medium-brand);
|
|
67
|
+
outline-offset: var(--dimension-offset-025);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ============================================
|
|
71
|
+
OVERLAY BACKGROUNDS
|
|
72
|
+
Consistent overlay backgrounds for hover/pressed states
|
|
73
|
+
============================================ */
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Hover overlay - use for subtle hover feedback
|
|
77
|
+
* Add as a pseudo-element or separate div
|
|
78
|
+
*/
|
|
79
|
+
.hoverOverlay {
|
|
80
|
+
background-color: var(--color-background-shade);
|
|
81
|
+
opacity: var(--opacity-interaction-hover, 0.08);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Pressed overlay - use for active/pressed feedback
|
|
86
|
+
*/
|
|
87
|
+
.pressedOverlay {
|
|
88
|
+
background-color: var(--color-background-shade);
|
|
89
|
+
opacity: var(--opacity-interaction-pressed, 0.16);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ============================================
|
|
93
|
+
SELECTION STATES
|
|
94
|
+
============================================ */
|
|
95
|
+
|
|
96
|
+
.selected {
|
|
97
|
+
background-color: var(--color-background-secondary);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.selectedBold {
|
|
101
|
+
background-color: var(--color-background-translucent);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ============================================
|
|
105
|
+
TEXT UTILITIES
|
|
106
|
+
============================================ */
|
|
107
|
+
|
|
108
|
+
.textTruncate {
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
text-overflow: ellipsis;
|
|
111
|
+
white-space: nowrap;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.textClamp2 {
|
|
115
|
+
display: -webkit-box;
|
|
116
|
+
-webkit-line-clamp: 2;
|
|
117
|
+
-webkit-box-orient: vertical;
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.textClamp3 {
|
|
122
|
+
display: -webkit-box;
|
|
123
|
+
-webkit-line-clamp: 3;
|
|
124
|
+
-webkit-box-orient: vertical;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* ============================================
|
|
129
|
+
LAYOUT UTILITIES
|
|
130
|
+
============================================ */
|
|
131
|
+
|
|
132
|
+
.flexCenter {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.flexBetween {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: space-between;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.flexStart {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: flex-start;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.flexEnd {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
justify-content: flex-end;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* ============================================
|
|
157
|
+
SCROLLBAR HIDING
|
|
158
|
+
============================================ */
|
|
159
|
+
|
|
160
|
+
.hideScrollbar {
|
|
161
|
+
scrollbar-width: none; /* Firefox */
|
|
162
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.hideScrollbar::-webkit-scrollbar {
|
|
166
|
+
display: none; /* Chrome, Safari, Opera */
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* ============================================
|
|
170
|
+
TRANSITION UTILITIES
|
|
171
|
+
============================================ */
|
|
172
|
+
|
|
173
|
+
.transitionColors {
|
|
174
|
+
transition: color var(--effect-motion-short-2),
|
|
175
|
+
background-color var(--effect-motion-short-2),
|
|
176
|
+
border-color var(--effect-motion-short-2),
|
|
177
|
+
fill var(--effect-motion-short-2),
|
|
178
|
+
stroke var(--effect-motion-short-2);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.transitionAll {
|
|
182
|
+
transition: all var(--effect-motion-medium-1);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.transitionTransform {
|
|
186
|
+
transition: transform var(--effect-motion-short-2);
|
|
187
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ds-mo/tokens",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TokoMo design tokens — colors, dimensions, typography, and effects as CSS custom properties, JSON, and TypeScript constants",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"design-tokens",
|
|
7
|
+
"css-variables",
|
|
8
|
+
"css-custom-properties",
|
|
9
|
+
"design-system",
|
|
10
|
+
"figma",
|
|
11
|
+
"tokens",
|
|
12
|
+
"colors",
|
|
13
|
+
"typography",
|
|
14
|
+
"spacing",
|
|
15
|
+
"theming",
|
|
16
|
+
"dark-mode"
|
|
17
|
+
],
|
|
18
|
+
"homepage": "https://github.com/zainadeel/TokoMo#readme",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/zainadeel/TokoMo/issues"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/zainadeel/TokoMo.git"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.css",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.css",
|
|
31
|
+
"./css": "./dist/index.css",
|
|
32
|
+
"./colors": "./dist/colors.css",
|
|
33
|
+
"./dimensions": "./dist/dimensions.css",
|
|
34
|
+
"./typography": "./dist/typography.css",
|
|
35
|
+
"./effects": "./dist/effects.css",
|
|
36
|
+
"./reset": "./dist/reset.css",
|
|
37
|
+
"./globals": "./dist/globals.css",
|
|
38
|
+
"./utilities": "./dist/utilities.css",
|
|
39
|
+
"./themes/light": "./dist/themes/light.css",
|
|
40
|
+
"./themes/dark": "./dist/themes/dark.css",
|
|
41
|
+
"./json": "./dist/tokens.json",
|
|
42
|
+
"./json/colors": "./dist/json/colors.json",
|
|
43
|
+
"./json/dimensions": "./dist/json/dimensions.json",
|
|
44
|
+
"./json/typography": "./dist/json/typography.json",
|
|
45
|
+
"./json/effects": "./dist/json/effects.json",
|
|
46
|
+
"./ts": {
|
|
47
|
+
"import": "./dist/index.mjs",
|
|
48
|
+
"require": "./dist/index.cjs",
|
|
49
|
+
"types": "./dist/index.d.ts"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist"
|
|
54
|
+
],
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "node scripts/build.mjs",
|
|
60
|
+
"build:colors": "node scripts/generate-color-tokens.mjs",
|
|
61
|
+
"build:json": "node scripts/generate-json-tokens.mjs",
|
|
62
|
+
"build:ts": "node scripts/generate-ts-constants.mjs",
|
|
63
|
+
"clean": "rm -rf dist",
|
|
64
|
+
"dev": "node scripts/build.mjs --watch"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=25.9.0"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"chokidar": "^5.0.0"
|
|
71
|
+
},
|
|
72
|
+
"sideEffects": [
|
|
73
|
+
"**/*.css"
|
|
74
|
+
]
|
|
75
|
+
}
|