@stnd/styles 0.5.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/CHANGELOG.md +25 -0
- package/README.md +116 -0
- package/TOKENS.md +415 -0
- package/_standard-00-reset.scss +74 -0
- package/_standard-00-variables.scss +54 -0
- package/_standard-01-token.scss +287 -0
- package/_standard-02-color.scss +683 -0
- package/_standard-03-typography.scss +411 -0
- package/_standard-04-grid.scss +314 -0
- package/_standard-05-rhythm.scss +57 -0
- package/_standard-06-prose.scss +289 -0
- package/_standard-07-base.scss +216 -0
- package/_standard-08-media.scss +216 -0
- package/_standard-09-lists.scss +103 -0
- package/_standard-10-tables.scss +49 -0
- package/_standard-11-forms.scss +343 -0
- package/_standard-12-code.scss +204 -0
- package/_standard-13-components.scss +1261 -0
- package/_standard-14-analog.scss +48 -0
- package/_standard-30-contrast.scss +42 -0
- package/_standard-31-print.scss +97 -0
- package/_standard-32-eink.scss +78 -0
- package/_standard-50-utilities.scss +1117 -0
- package/_standard-99-debug.scss +474 -0
- package/dist/obsidian.css +31 -0
- package/dist/obsidian.css.map +1 -0
- package/dist/standard.css +20 -0
- package/dist/standard.css.map +1 -0
- package/index.js +1 -0
- package/obsidian.scss +18 -0
- package/package.json +46 -0
- package/standard.scss +52 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
@use "standard-00-variables" as *;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @component Design Tokens
|
|
5
|
+
* @category Foundation
|
|
6
|
+
* @description Primitive design tokens forming the foundation of the design system.
|
|
7
|
+
* Includes mathematical ratios, modular scales, spacing system, and animation curves.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#{$stnd-scope} {
|
|
11
|
+
/* ===== COLOR SEEDS =====
|
|
12
|
+
The two primary seeds from which everything grows.
|
|
13
|
+
Set these and the color file (_standard-02-color.scss) does the rest:
|
|
14
|
+
• Extracts OKLCH DNA from each foreground seed
|
|
15
|
+
• Generates a full hue palette per scheme
|
|
16
|
+
• Derives dark seeds automatically (inheriting the light vibe)
|
|
17
|
+
|
|
18
|
+
Override --color-dark-background / --color-dark-foreground in a
|
|
19
|
+
theme to give dark mode its own distinct mood.
|
|
20
|
+
|
|
21
|
+
Analog-inspired reference palette (uncomment to pin specific hues):
|
|
22
|
+
--color-light-red: #b14c42; dusty red clay
|
|
23
|
+
--color-light-orange: #d78a5a; trail-worn orange
|
|
24
|
+
--color-light-yellow: #c8a840; parchment mustard
|
|
25
|
+
--color-light-green: #5e9d80; sage green
|
|
26
|
+
--color-light-cyan: #6ba4b6; glacier teal
|
|
27
|
+
--color-light-blue: #4f81a4; faded blueprint
|
|
28
|
+
--color-light-magenta: #7a6c91; dusk lavender
|
|
29
|
+
*/
|
|
30
|
+
--color-light-background: white;
|
|
31
|
+
--color-light-foreground: #262626;
|
|
32
|
+
/* Dark seeds are computed in _standard-02-color.scss from the light
|
|
33
|
+
foreground's OKLCH hue — warm ink begets warm dark mode. */
|
|
34
|
+
|
|
35
|
+
/* Tooltip defaults */
|
|
36
|
+
--tooltip-background: #1a1a1a;
|
|
37
|
+
--tooltip-text: #ffffff;
|
|
38
|
+
|
|
39
|
+
/* Base measurements & ratios */
|
|
40
|
+
--font-size: 1rem;
|
|
41
|
+
--optical-ratio: var(--font-ratio, var(--ratio-silver));
|
|
42
|
+
--line-height: var(--font-density, var(--optical-ratio));
|
|
43
|
+
|
|
44
|
+
/* Baseline: the official rhythm unit */
|
|
45
|
+
--baseline: 1rlh;
|
|
46
|
+
|
|
47
|
+
--trim: calc(var(--leading) / 2);
|
|
48
|
+
/* Leading: the space between cap-height and next baseline */
|
|
49
|
+
--leading: calc((var(--line-height) - 1) * var(--font-size));
|
|
50
|
+
--nl: calc(var(--leading) * var(--line-height));
|
|
51
|
+
|
|
52
|
+
/* Gap, space between blocks in rhythm, goes to --space in mobile */
|
|
53
|
+
--gap: var(--space);
|
|
54
|
+
--gap-body: var(--space-2);
|
|
55
|
+
--gap-header: var(--space-8);
|
|
56
|
+
--gap-footer: calc(var(--gap-body) * 1.5);
|
|
57
|
+
--gap-grid-img: var(--space-d4);
|
|
58
|
+
--gap-multiplicator: 2;
|
|
59
|
+
|
|
60
|
+
--breakpoint-mobile: #{$mobile};
|
|
61
|
+
--breakpoint-sm: #{$small};
|
|
62
|
+
--breakpoint-lg: #{$large};
|
|
63
|
+
--breakpoint-wide: #{$wide};
|
|
64
|
+
|
|
65
|
+
--content-width: min(var(--line-width), 100%);
|
|
66
|
+
--content-width-sm: max(calc(var(--space-2) - var(--space)), var(--space));
|
|
67
|
+
--content-width-editorial: minmax(0, var(--space-2));
|
|
68
|
+
--content-width-feature: minmax(0, var(--space-4));
|
|
69
|
+
--content-width-hero: minmax(0, 1fr);
|
|
70
|
+
|
|
71
|
+
/* Design system tokens */
|
|
72
|
+
--filter-blur: blur(8px);
|
|
73
|
+
--filter-glass: blur(20px);
|
|
74
|
+
--stroke-width: max(1px, 0.06rem);
|
|
75
|
+
--stroke-width-lg: calc(var(--stroke-width) * 2);
|
|
76
|
+
--radius: var(--corner, var(--leading));
|
|
77
|
+
--radius-sm: min(8px, var(--radius));
|
|
78
|
+
|
|
79
|
+
/* Golden Ratio & Mathematical Precision */
|
|
80
|
+
--ratio-golden: 1.618;
|
|
81
|
+
--ratio-silver: 1.414;
|
|
82
|
+
--ratio-halfstep: 1.272;
|
|
83
|
+
--ratio-quarterstep: 1.128;
|
|
84
|
+
--ratio-eighthstep: 1.062;
|
|
85
|
+
|
|
86
|
+
/* Content area tokens */
|
|
87
|
+
--line-width-xs: 24rem;
|
|
88
|
+
--line-width-sm: 32rem;
|
|
89
|
+
--line-width-md: 42rem;
|
|
90
|
+
--line-width-lg: 50rem;
|
|
91
|
+
--line-width-xl: 60rem;
|
|
92
|
+
--line-width-full: calc(100vw - (var(--space) * 2));
|
|
93
|
+
--line-width: var(--font-line-width, var(--measure, var(--line-width-md)));
|
|
94
|
+
|
|
95
|
+
--line-height-compact: calc(1 + (var(--line-height) - 1) / 2);
|
|
96
|
+
--line-height-relaxed: calc(1 + (var(--line-height) - 1) * 1.5);
|
|
97
|
+
|
|
98
|
+
--max-width: 900px;
|
|
99
|
+
|
|
100
|
+
/* Named width tokens */
|
|
101
|
+
--body-max-width: var(--max-width);
|
|
102
|
+
--prose-max-width: var(--max-width);
|
|
103
|
+
|
|
104
|
+
--tracking-tight: -0.01em;
|
|
105
|
+
--tracking-neutral: 0em;
|
|
106
|
+
--tracking-open: 0.01em;
|
|
107
|
+
|
|
108
|
+
/* Spacing scale (derived from baseline) */
|
|
109
|
+
--space: var(--baseline);
|
|
110
|
+
--space-half: calc(var(--baseline)/2);
|
|
111
|
+
|
|
112
|
+
@for $i from 1 through 12 {
|
|
113
|
+
--space-d#{$i}: calc(var(--space) / #{$i});
|
|
114
|
+
--space-#{$i}: calc(var(--space) * #{$i});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Optical harmony scale */
|
|
118
|
+
--scale-d5: max(calc(var(--font-size) / (var(--optical-ratio) * var(--optical-ratio))), 11px);
|
|
119
|
+
--scale-d4: max(
|
|
120
|
+
calc(var(--font-size) / (var(--optical-ratio) * 1.25)),
|
|
121
|
+
11px
|
|
122
|
+
);
|
|
123
|
+
--scale-d3: max(calc(var(--font-size) / var(--optical-ratio)), 11px);
|
|
124
|
+
--scale-d2: max(
|
|
125
|
+
calc(var(--font-size) / (1 + (var(--optical-ratio) - 1) * 0.5)),
|
|
126
|
+
11px
|
|
127
|
+
);
|
|
128
|
+
--scale: var(--font-size);
|
|
129
|
+
--scale-2: calc(var(--font-size) * var(--optical-ratio));
|
|
130
|
+
--scale-3: calc(var(--scale-2) * var(--optical-ratio));
|
|
131
|
+
--scale-4: calc(var(--scale-3) * var(--optical-ratio));
|
|
132
|
+
--scale-5: calc(var(--scale-4) * var(--optical-ratio));
|
|
133
|
+
--scale-6: calc(var(--scale-5) * var(--optical-ratio));
|
|
134
|
+
--scale-7: calc(var(--scale-6) * var(--optical-ratio));
|
|
135
|
+
--scale-8: calc(var(--scale-7) * var(--optical-ratio));
|
|
136
|
+
|
|
137
|
+
/* Industrial Size Scale (T-Shirt Aliases) */
|
|
138
|
+
--size-3xs: var(--scale-d5);
|
|
139
|
+
--size-2xs: var(--scale-d4);
|
|
140
|
+
--size-xs: var(--scale-d3);
|
|
141
|
+
--size-sm: var(--scale-d2);
|
|
142
|
+
--size-base: var(--scale);
|
|
143
|
+
--size-lg: var(--scale-2);
|
|
144
|
+
--size-xl: var(--scale-3);
|
|
145
|
+
--size-2xl: var(--scale-4);
|
|
146
|
+
--size-3xl: var(--scale-5);
|
|
147
|
+
--size-4xl: var(--scale-6);
|
|
148
|
+
--size-5xl: var(--scale-7);
|
|
149
|
+
--size-6xl: var(--scale-8);
|
|
150
|
+
|
|
151
|
+
/* Mobile settings */
|
|
152
|
+
--font-size-mobile: 1.125rem;
|
|
153
|
+
--gap-body-mobile: var(--space);
|
|
154
|
+
--gap-mobile: var(--space);
|
|
155
|
+
--gap-header-mobile: var(--space-4);
|
|
156
|
+
|
|
157
|
+
/* Z-index scale */
|
|
158
|
+
--z-base: 1;
|
|
159
|
+
--z-dropdown: 1100;
|
|
160
|
+
--z-modal: 1200;
|
|
161
|
+
--z-toast: 2000;
|
|
162
|
+
--z-header: 900;
|
|
163
|
+
--z-launher: 1000;
|
|
164
|
+
--z-image-zoom: 9999;
|
|
165
|
+
|
|
166
|
+
/* The *“Snappy”* - for small icons or toggles (Short duration) */
|
|
167
|
+
--ease-snappy: cubic-bezier(0.2, 0, 0, 1);
|
|
168
|
+
|
|
169
|
+
/* The *“Standard”* - for general UI transitions (Your 0.5s sweet spot) */
|
|
170
|
+
--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
171
|
+
|
|
172
|
+
/* The *“Soft”* - for large modals or overlays (The *“softest”* feel) */
|
|
173
|
+
--ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
|
|
174
|
+
|
|
175
|
+
/* The *“Emphasis”* - has a tiny bit of weight/anticipation */
|
|
176
|
+
--ease-emphasis: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
177
|
+
|
|
178
|
+
/* Special Effects */
|
|
179
|
+
--ease-aggressive: cubic-bezier(0.7, 0, 0.3, 1);
|
|
180
|
+
|
|
181
|
+
--ease-stnd: cubic-bezier(0, 0.3, 0, 1);
|
|
182
|
+
--ease-stnd-heavy: cubic-bezier(0.5, 0, 0, 1);
|
|
183
|
+
|
|
184
|
+
--ease-invisibolt: cubic-bezier(1, 0, 0, 1);
|
|
185
|
+
|
|
186
|
+
/* Analog : It starts with a burst of energy (the push) and spends 80% of its time slowly losing that energy. */
|
|
187
|
+
--ease-friction: cubic-bezier(0.22, 1, 0.36, 1);
|
|
188
|
+
|
|
189
|
+
/* Animation
|
|
190
|
+
a {
|
|
191
|
+
text-decoration-color: rgba(0,0,0,0);
|
|
192
|
+
transition: text-decoration-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
193
|
+
Soft Fade Out
|
|
194
|
+
}
|
|
195
|
+
a:hover {
|
|
196
|
+
text-decoration-color: rgba(0,0,0,1);
|
|
197
|
+
transition: text-decoration-color 0.15s ease-out;
|
|
198
|
+
Snappy Fade In
|
|
199
|
+
}
|
|
200
|
+
Intent Variable Name Value Recommended Duration
|
|
201
|
+
Reaction --ease-react cubic-bezier(0.2, 1, 0.4, 1) 0.15s
|
|
202
|
+
Exit --ease-out-soft cubic-bezier(0.4, 0, 1, 1) 0.3s
|
|
203
|
+
.stnd-button {
|
|
204
|
+
transition:
|
|
205
|
+
background-color 0.2s cubic-bezier(0.25, 1, 0.5, 1),
|
|
206
|
+
transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.stnd-button:active {
|
|
210
|
+
transform: scale(0.98); Tiny physical feedback
|
|
211
|
+
}
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
--duration-instant: 100ms;
|
|
215
|
+
--duration-fast: 350ms;
|
|
216
|
+
--duration-standard: 500ms;
|
|
217
|
+
--duration-slow: 1000ms;
|
|
218
|
+
|
|
219
|
+
--transition-fast: 0.5s var(--ease-friction);
|
|
220
|
+
--transition: 1s var(--ease-friction);
|
|
221
|
+
--transition-slow: 2s var(--ease-friction);
|
|
222
|
+
|
|
223
|
+
/* Shape Aliases */
|
|
224
|
+
--ease-shape-snappy: cubic-bezier(0.2, 0, 0, 1);
|
|
225
|
+
--ease-shape-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
226
|
+
--ease-shape-soft: cubic-bezier(0.16, 1, 0.3, 1);
|
|
227
|
+
|
|
228
|
+
/* Interaction (Buttons, Links, Toggles) */
|
|
229
|
+
--ease-interaction: var(--duration-fast) var(--ease-shape-snappy);
|
|
230
|
+
|
|
231
|
+
/* Feedback (Success/Error states, validation) */
|
|
232
|
+
--ease-feedback: var(--duration-standard) var(--ease-shape-bounce);
|
|
233
|
+
|
|
234
|
+
/* Layout (Sidebars, expanding cards, Digital Garden navigation) */
|
|
235
|
+
--ease-surface: var(--duration-slow) var(--ease-shape-soft);
|
|
236
|
+
|
|
237
|
+
/* Enter/Exit (Modals, tooltips) */
|
|
238
|
+
--ease-enter: var(--duration-fast) ease-out;
|
|
239
|
+
--ease-exit: var(--duration-standard) ease-in;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
#{$text-elements},
|
|
243
|
+
a {
|
|
244
|
+
text-box-trim: trim-both;
|
|
245
|
+
text-box-edge: cap alphabetic;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Responsive adjustments */
|
|
249
|
+
@media only screen and (max-width: #{$small}) {
|
|
250
|
+
#{$stnd-theme-scope} {
|
|
251
|
+
--gap-body: var(--gap-body-mobile) !important;
|
|
252
|
+
--gap-header: var(--gap-header-mobile) !important;
|
|
253
|
+
--gap: var(--gap-mobile) !important;
|
|
254
|
+
--font-size: var(--font-size-mobile) !important;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
#{$stnd-theme-scope} {
|
|
259
|
+
--ease-aggressive: cubic-bezier(0.7, 0, 0.3, 1);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
::view-transition-old(root),
|
|
263
|
+
::view-transition-new(root) {
|
|
264
|
+
animation-duration: 500ms;
|
|
265
|
+
animation-timing-function: var(--ease-friction);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* If you want to customize the actual movement */
|
|
269
|
+
::view-transition-old(root) {
|
|
270
|
+
animation-name: fade-out;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
::view-transition-new(root) {
|
|
274
|
+
animation-name: fade-in;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes fade-out {
|
|
278
|
+
to {
|
|
279
|
+
opacity: 0;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@keyframes fade-in {
|
|
284
|
+
from {
|
|
285
|
+
opacity: 0;
|
|
286
|
+
}
|
|
287
|
+
}
|