baseline-kit 3.0.2 → 5.0.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 +70 -48
- package/dist/README.md +70 -48
- package/dist/baseline-kit.css +3 -21
- package/dist/core/src/config/defaults.d.ts +2 -0
- package/dist/core/src/config/index.d.ts +3 -0
- package/dist/core/src/config/merge.d.ts +21 -0
- package/dist/core/src/config/schema.d.ts +33 -0
- package/dist/core/src/descriptors/baseline.d.ts +26 -0
- package/dist/core/src/descriptors/box.d.ts +20 -0
- package/dist/core/src/descriptors/guide.d.ts +44 -0
- package/dist/core/src/descriptors/index.d.ts +5 -0
- package/dist/core/src/descriptors/padder.d.ts +19 -0
- package/dist/core/src/descriptors/spacer.d.ts +24 -0
- package/dist/core/src/index.d.ts +10 -0
- package/dist/core/src/types.d.ts +62 -0
- package/dist/core/src/utils/convert.d.ts +10 -0
- package/dist/core/src/utils/grid.d.ts +18 -0
- package/dist/{utils → core/src/utils}/index.d.ts +2 -9
- package/dist/core/src/utils/math.d.ts +9 -0
- package/dist/core/src/utils/merge.d.ts +28 -0
- package/dist/core/src/utils/normalize.d.ts +13 -0
- package/dist/core/src/utils/padding.d.ts +2 -0
- package/dist/core/src/utils/parse.d.ts +5 -0
- package/dist/core/src/utils/snapping.d.ts +2 -0
- package/dist/core/src/validation/guide.d.ts +3 -0
- package/dist/core/src/validation/index.d.ts +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.d.ts +344 -0
- package/dist/core.mjs +2 -0
- package/dist/dom/src/index.d.ts +11 -0
- package/dist/dom/src/measure.d.ts +18 -0
- package/dist/dom/src/observers.d.ts +5 -0
- package/dist/{utils → dom/src}/ssr.d.ts +0 -6
- package/dist/dom/src/timing.d.ts +2 -0
- package/dist/dom/src/viewport.d.ts +7 -0
- package/dist/dom/src/virtual.d.ts +23 -0
- package/dist/guide.cjs +2 -0
- package/dist/guide.cjs.map +1 -0
- package/dist/guide.css +2 -0
- package/dist/guide.d.ts +146 -0
- package/dist/guide.mjs +589 -0
- package/dist/guide.mjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +197 -30
- package/dist/index.mjs +614 -1747
- package/dist/index.mjs.map +1 -1
- package/dist/react/src/components/Baseline/Baseline.d.ts +13 -0
- package/dist/react/src/components/Baseline/index.d.ts +1 -0
- package/dist/react/src/components/Box/Box.d.ts +26 -0
- package/dist/react/src/components/Box/index.d.ts +1 -0
- package/dist/react/src/components/Config/Config.d.ts +20 -0
- package/dist/react/src/components/Config/index.d.ts +2 -0
- package/dist/react/src/components/Guide/Guide.d.ts +16 -0
- package/dist/react/src/components/Guide/index.d.ts +1 -0
- package/dist/react/src/components/Padder/Padder.d.ts +20 -0
- package/dist/react/src/components/Padder/index.d.ts +1 -0
- package/dist/react/src/components/Spacer/Spacer.d.ts +14 -0
- package/dist/react/src/components/Spacer/index.d.ts +1 -0
- package/dist/{components → react/src/components}/index.d.ts +1 -5
- package/dist/react/src/components/types.d.ts +29 -0
- package/dist/react/src/guide.d.ts +10 -0
- package/dist/{hooks → react/src/hooks}/index.d.ts +2 -3
- package/dist/react/src/hooks/useBaseline.d.ts +26 -0
- package/dist/react/src/hooks/useConfig.d.ts +9 -0
- package/dist/react/src/hooks/useDebug.d.ts +6 -0
- package/dist/react/src/hooks/useGuide.d.ts +7 -0
- package/dist/{hooks → react/src/hooks}/useIsClient.d.ts +0 -2
- package/dist/react/src/hooks/useMeasure.d.ts +10 -0
- package/dist/react/src/hooks/useVirtual.d.ts +14 -0
- package/dist/react/src/index.d.ts +21 -0
- package/dist/react/src/utils/index.d.ts +9 -0
- package/dist/react/src/utils/merge.d.ts +10 -0
- package/dist/react/src/utils/ssr.d.ts +1 -0
- package/dist/reset.css +43 -0
- package/dist/src-CMjyHjX5.cjs +2 -0
- package/dist/src-CMjyHjX5.cjs.map +1 -0
- package/dist/src-QHaSfgVe.js +619 -0
- package/dist/src-QHaSfgVe.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/dark.css +0 -8
- package/dist/theme/default.css +0 -9
- package/dist/theme/tokens.css +1 -10
- package/dist/theme.css +0 -18
- package/package.json +82 -42
- package/dist/components/Baseline/Baseline.d.ts +0 -48
- package/dist/components/Baseline/index.d.ts +0 -6
- package/dist/components/Box/Box.d.ts +0 -73
- package/dist/components/Box/index.d.ts +0 -6
- package/dist/components/Config/Config.d.ts +0 -179
- package/dist/components/Config/defaults.d.ts +0 -25
- package/dist/components/Config/index.d.ts +0 -11
- package/dist/components/Guide/Guide.d.ts +0 -70
- package/dist/components/Guide/index.d.ts +0 -6
- package/dist/components/Guide/types.d.ts +0 -144
- package/dist/components/Guide/validation.d.ts +0 -82
- package/dist/components/Layout/Layout.d.ts +0 -73
- package/dist/components/Layout/index.d.ts +0 -10
- package/dist/components/Padder/Padder.d.ts +0 -67
- package/dist/components/Padder/index.d.ts +0 -10
- package/dist/components/Spacer/Spacer.d.ts +0 -48
- package/dist/components/Spacer/index.d.ts +0 -10
- package/dist/components/Stack/Stack.d.ts +0 -84
- package/dist/components/Stack/index.d.ts +0 -10
- package/dist/components/styles/index.d.ts +0 -11
- package/dist/components/types.d.ts +0 -102
- package/dist/hooks/useBaseline.d.ts +0 -55
- package/dist/hooks/useConfig.d.ts +0 -41
- package/dist/hooks/useDebug.d.ts +0 -49
- package/dist/hooks/useGuide.d.ts +0 -61
- package/dist/hooks/useMeasure.d.ts +0 -35
- package/dist/hooks/useVirtual.d.ts +0 -60
- package/dist/styles.d.ts +0 -6
- package/dist/theme.d.ts +0 -6
- package/dist/utils/convert.d.ts +0 -24
- package/dist/utils/grid.d.ts +0 -22
- package/dist/utils/math.d.ts +0 -48
- package/dist/utils/merge.d.ts +0 -117
- package/dist/utils/normalize.d.ts +0 -30
- package/dist/utils/padding.d.ts +0 -11
- package/dist/utils/parse.d.ts +0 -18
- package/dist/utils/snapping.d.ts +0 -28
- package/dist/utils/timing.d.ts +0 -45
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
Baseline Kit is a lightweight development tool for visualizing and debugging grid systems and spacing in React applications. It provides configurable overlays for both column-based and baseline grids,
|
|
7
|
+
Baseline Kit is a lightweight development tool for visualizing and debugging grid systems and spacing in React applications. It provides configurable overlays for both column-based and baseline grids, spacing primitives, and theme-aware configuration—all optimized for performance and built with TypeScript. The library is based on the "Padded Grid" concept, originally explored in [this article](http://medium.com/design-bootcamp/the-padded-grid-a-designers-hack-to-achieve-baseline-fit-fc40d022bc84) on achieving perfect baseline alignment in digital layouts.
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -44,8 +44,7 @@ Baseline Kit is a lightweight development tool for visualizing and debugging gri
|
|
|
44
44
|
- 📏 **Baseline Grid:** Core system for maintaining vertical rhythm and consistent spacing across your layouts
|
|
45
45
|
- 🎯 **Column Grid Guide:** Customizable overlay system for visualizing column-based layouts and alignment
|
|
46
46
|
- 📦 **Box Component:** Basic container with configurable spacing that snaps to the baseline grid
|
|
47
|
-
-
|
|
48
|
-
- 📐 **Stack Component:** Flex-based container that maintains consistent spacing and baseline alignment
|
|
47
|
+
- 🧱 **Padder & Spacer:** Spacing primitives with optional baseline snapping
|
|
49
48
|
- 🎨 **Theme System:** Customizable colors and debug visuals through a centralized configuration
|
|
50
49
|
|
|
51
50
|
## Requirements
|
|
@@ -66,35 +65,44 @@ yarn add baseline-kit
|
|
|
66
65
|
pnpm add baseline-kit
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
After installation, import
|
|
68
|
+
After installation, import the smallest entry point that matches your use case.
|
|
69
|
+
For a development grid overlay, use the guide-only React and CSS subpaths:
|
|
70
70
|
|
|
71
71
|
```tsx
|
|
72
|
-
|
|
73
|
-
import 'baseline-kit/
|
|
74
|
-
import 'baseline-kit/theme'; // Recommended theme (or use your own)
|
|
72
|
+
import 'baseline-kit/styles/guide'
|
|
73
|
+
import { Config, Guide } from 'baseline-kit/guide'
|
|
75
74
|
```
|
|
76
75
|
|
|
77
76
|
For frameworks like Remix that use URL imports in a links function:
|
|
78
77
|
|
|
79
78
|
```tsx
|
|
80
79
|
export const links = () => [
|
|
81
|
-
{ rel:
|
|
82
|
-
|
|
83
|
-
];
|
|
80
|
+
{ rel: 'stylesheet', href: 'baseline-kit/styles/guide' },
|
|
81
|
+
]
|
|
84
82
|
```
|
|
85
83
|
|
|
86
|
-
|
|
84
|
+
For the full component set, import the root package and root component styles:
|
|
87
85
|
|
|
88
86
|
```tsx
|
|
89
|
-
|
|
90
|
-
import 'baseline-kit/
|
|
87
|
+
import 'baseline-kit/styles'
|
|
88
|
+
import 'baseline-kit/theme'
|
|
89
|
+
import { Config, Guide, Baseline, Box } from 'baseline-kit'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If you prefer a single CSS file for every component plus the theme:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import 'baseline-kit/styles/full'
|
|
91
96
|
|
|
92
97
|
// For Remix:
|
|
93
98
|
export const links = () => [
|
|
94
|
-
{ rel:
|
|
95
|
-
]
|
|
99
|
+
{ rel: 'stylesheet', href: 'baseline-kit/styles/full' },
|
|
100
|
+
]
|
|
96
101
|
```
|
|
97
102
|
|
|
103
|
+
The browser reset is not included by default. Import `baseline-kit/reset` or
|
|
104
|
+
`baseline-kit/styles/reset` only when you want Baseline Kit to provide one.
|
|
105
|
+
|
|
98
106
|
Baseline Kit is written in TypeScript and includes built-in type definitions—no additional packages required.
|
|
99
107
|
|
|
100
108
|
## Quick Start
|
|
@@ -153,12 +161,12 @@ unit:
|
|
|
153
161
|
|
|
154
162
|
```tsx
|
|
155
163
|
<Config base={8}> // Sets 8px as the base unit
|
|
156
|
-
<
|
|
164
|
+
<Padder
|
|
157
165
|
block={17} // Will be rounded to 16px (2 * base)
|
|
158
166
|
inline={22} // Will be rounded to 24px (3 * base)
|
|
159
167
|
>
|
|
160
168
|
{/* Content automatically aligned to the 8px grid */}
|
|
161
|
-
</
|
|
169
|
+
</Padder>
|
|
162
170
|
</Config>
|
|
163
171
|
```
|
|
164
172
|
|
|
@@ -182,8 +190,7 @@ block={{ start: 2, end: 3 }} // Same as above
|
|
|
182
190
|
Components automatically adjust their spacing to maintain baseline grid alignment:
|
|
183
191
|
|
|
184
192
|
- **Box**: Adjusts bottom padding to ensure total height aligns with base unit
|
|
185
|
-
- **
|
|
186
|
-
- **Layout**: Ensures grid cells align with baseline
|
|
193
|
+
- **Padder**: Snaps padded content to baseline-aligned multiples of the base unit
|
|
187
194
|
|
|
188
195
|
### Debugging Modes
|
|
189
196
|
|
|
@@ -199,21 +206,20 @@ debugging = "none" // Removes debug elements entirely
|
|
|
199
206
|
|
|
200
207
|
### Component Hierarchy
|
|
201
208
|
|
|
202
|
-
#### 1.
|
|
209
|
+
#### 1. Spacing primitives
|
|
203
210
|
|
|
204
|
-
- **`Box`** Basic container
|
|
205
|
-
- **`
|
|
206
|
-
- **`
|
|
211
|
+
- **`Box`** Basic container that snaps its height to the baseline grid
|
|
212
|
+
- **`Padder`** Padding wrapper that snaps padded content to baseline multiples
|
|
213
|
+
- **`Spacer`** Fixed-size spacer with optional measurement indicator overlay
|
|
207
214
|
|
|
208
|
-
#### 2.
|
|
215
|
+
#### 2. Debug overlays
|
|
209
216
|
|
|
210
|
-
- **`Baseline`** Horizontal grid overlay
|
|
211
|
-
- **`Guide`**
|
|
212
|
-
- **`Spacer`** Precise spacing measurement
|
|
217
|
+
- **`Baseline`** Horizontal baseline-grid overlay
|
|
218
|
+
- **`Guide`** Column-grid overlay (line / pattern / fixed / auto variants)
|
|
213
219
|
|
|
214
220
|
#### 3. Configuration
|
|
215
221
|
|
|
216
|
-
- **`Config`** Theme and settings provider
|
|
222
|
+
- **`Config`** Theme and settings provider (base unit, colors, debug modes)
|
|
217
223
|
|
|
218
224
|
### Key Components
|
|
219
225
|
|
|
@@ -255,7 +261,7 @@ debugging = "none" // Removes debug elements entirely
|
|
|
255
261
|
```tsx
|
|
256
262
|
<Box
|
|
257
263
|
block={[2, 5]} // Vertical padding in base units
|
|
258
|
-
span={2} // Grid column span when
|
|
264
|
+
span={2} // Grid column span when placed in a CSS grid parent
|
|
259
265
|
snapping="height" // "none", "height", or "clamp"
|
|
260
266
|
>
|
|
261
267
|
<p>Content aligned to baseline grid</p>
|
|
@@ -266,21 +272,29 @@ debugging = "none" // Removes debug elements entirely
|
|
|
266
272
|
|
|
267
273
|
Baseline Kit comes with a flexible CSS structure and theming system:
|
|
268
274
|
|
|
269
|
-
1. `
|
|
270
|
-
2. `
|
|
271
|
-
3. `
|
|
275
|
+
1. `guide.css` - Guide-only overlay styles (imported via `baseline-kit/styles/guide`)
|
|
276
|
+
2. `styles.css` - Root component styles and base variables (imported via `baseline-kit/styles`)
|
|
277
|
+
3. `theme.css` - Color variables and theming with automatic dark mode support (imported via `baseline-kit/theme`)
|
|
278
|
+
4. `reset.css` - Optional browser reset (imported via `baseline-kit/reset` or `baseline-kit/styles/reset`)
|
|
279
|
+
5. `baseline-kit.css` - Combined root component styles and theme (imported via `baseline-kit/styles/full`)
|
|
272
280
|
|
|
273
281
|
### CSS Import Options
|
|
274
282
|
|
|
275
283
|
Baseline Kit gives you flexibility in how you include the styles:
|
|
276
284
|
|
|
277
285
|
```tsx
|
|
278
|
-
//
|
|
279
|
-
import 'baseline-kit/styles'
|
|
280
|
-
|
|
286
|
+
// Guide-only overlay styles
|
|
287
|
+
import 'baseline-kit/styles/guide'
|
|
288
|
+
|
|
289
|
+
// Root component styles and theme separately
|
|
290
|
+
import 'baseline-kit/styles'
|
|
291
|
+
import 'baseline-kit/theme'
|
|
292
|
+
|
|
293
|
+
// Root component styles and theme in one file
|
|
294
|
+
import 'baseline-kit/styles/full'
|
|
281
295
|
|
|
282
|
-
//
|
|
283
|
-
import 'baseline-kit/
|
|
296
|
+
// Optional reset
|
|
297
|
+
import 'baseline-kit/reset'
|
|
284
298
|
```
|
|
285
299
|
|
|
286
300
|
### Theme Options
|
|
@@ -290,21 +304,21 @@ You now have four options for using the theme system:
|
|
|
290
304
|
#### 1. Use the Built-in Theme (with automatic dark mode)
|
|
291
305
|
|
|
292
306
|
```tsx
|
|
293
|
-
import 'baseline-kit/theme'
|
|
307
|
+
import 'baseline-kit/theme' // Default theme with light/dark mode support
|
|
294
308
|
```
|
|
295
309
|
|
|
296
310
|
#### 2. Use Specific Theme Variants
|
|
297
311
|
|
|
298
312
|
```tsx
|
|
299
313
|
// Use only the light theme (no dark mode)
|
|
300
|
-
import 'baseline-kit/theme/default'
|
|
314
|
+
import 'baseline-kit/theme/default'
|
|
301
315
|
|
|
302
316
|
// Use only the dark theme
|
|
303
|
-
import 'baseline-kit/theme/dark'
|
|
317
|
+
import 'baseline-kit/theme/dark'
|
|
304
318
|
|
|
305
319
|
// Example: Apply dark theme regardless of system preference
|
|
306
|
-
import 'baseline-kit/styles'
|
|
307
|
-
import 'baseline-kit/theme/dark'
|
|
320
|
+
import 'baseline-kit/styles'
|
|
321
|
+
import 'baseline-kit/theme/dark'
|
|
308
322
|
```
|
|
309
323
|
|
|
310
324
|
#### 3. Create a Custom Theme
|
|
@@ -313,7 +327,7 @@ You can use the tokens template as a starting point:
|
|
|
313
327
|
|
|
314
328
|
```tsx
|
|
315
329
|
// First check the token template to see available variables
|
|
316
|
-
import 'baseline-kit/theme/tokens'
|
|
330
|
+
import 'baseline-kit/theme/tokens' // Just for reference (contains no values)
|
|
317
331
|
```
|
|
318
332
|
|
|
319
333
|
Then create your own custom theme file:
|
|
@@ -338,8 +352,8 @@ Then create your own custom theme file:
|
|
|
338
352
|
Then import your custom theme:
|
|
339
353
|
|
|
340
354
|
```tsx
|
|
341
|
-
import 'baseline-kit/styles'
|
|
342
|
-
import './path/to/yourCustomTheme.css'
|
|
355
|
+
import 'baseline-kit/styles' // Required component styles
|
|
356
|
+
import './path/to/yourCustomTheme.css' // Your custom theme
|
|
343
357
|
```
|
|
344
358
|
|
|
345
359
|
#### 4. Override via Config
|
|
@@ -366,9 +380,8 @@ For minor adjustments, use the Config component:
|
|
|
366
380
|
| Baseline | `--bk-baseline-color-[line/flat]-theme` | Colors for lines and backgrounds |
|
|
367
381
|
| Guide | `--bk-guide-color-[line/pattern/auto/fixed]-theme` | Colors for different guide variants |
|
|
368
382
|
| Box | `--bk-box-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
369
|
-
| Stack | `--bk-stack-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
370
|
-
| Layout | `--bk-layout-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
371
383
|
| Spacer | `--bk-spacer-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
384
|
+
| Padder | `--bk-padder-color-theme` | Padder edge color |
|
|
372
385
|
|
|
373
386
|
See the [tokens file](https://github.com/dnvt/baseline-kit/blob/main/dist/theme/tokens.css) for a complete list of available variables.
|
|
374
387
|
|
|
@@ -412,12 +425,16 @@ Components accept an `ssrMode` prop to explicitly optimize for server rendering:
|
|
|
412
425
|
```
|
|
413
426
|
|
|
414
427
|
With `ssrMode` enabled, components use simplified rendering during SSR and initial hydration, then enhance with full features after client-side hydration completes.
|
|
428
|
+
For debug overlays such as `Guide` and `Baseline`, `ssrMode` keeps the simplified fallback markup to avoid client measurement and row/column rendering in SSR-sensitive paths.
|
|
415
429
|
|
|
416
430
|
## Development
|
|
417
431
|
|
|
418
432
|
```shell
|
|
419
433
|
# Clone the repository
|
|
420
|
-
git clone https://github.com/dnvt/baseline-kit.git
|
|
434
|
+
git clone --recurse-submodules https://github.com/dnvt/baseline-kit.git
|
|
435
|
+
|
|
436
|
+
# If you already cloned without submodules
|
|
437
|
+
git submodule update --init --recursive
|
|
421
438
|
|
|
422
439
|
# Install dependencies
|
|
423
440
|
bun install
|
|
@@ -429,6 +446,11 @@ bun run dev
|
|
|
429
446
|
bun run test
|
|
430
447
|
```
|
|
431
448
|
|
|
449
|
+
The `.maestro/source` directory is a workflow submodule. Generated local
|
|
450
|
+
workflow surfaces such as `.claude/`, `maestro/`, `progress/`, and `plans/` are
|
|
451
|
+
ignored. Do not run the Maestro layout migration until the submodule source is
|
|
452
|
+
mounted at `.maestro/source` and the migration plan has been reviewed.
|
|
453
|
+
|
|
432
454
|
## Performance Features
|
|
433
455
|
|
|
434
456
|
- Virtualizes large grid overlays
|
package/dist/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
Baseline Kit is a lightweight development tool for visualizing and debugging grid systems and spacing in React applications. It provides configurable overlays for both column-based and baseline grids,
|
|
7
|
+
Baseline Kit is a lightweight development tool for visualizing and debugging grid systems and spacing in React applications. It provides configurable overlays for both column-based and baseline grids, spacing primitives, and theme-aware configuration—all optimized for performance and built with TypeScript. The library is based on the "Padded Grid" concept, originally explored in [this article](http://medium.com/design-bootcamp/the-padded-grid-a-designers-hack-to-achieve-baseline-fit-fc40d022bc84) on achieving perfect baseline alignment in digital layouts.
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -44,8 +44,7 @@ Baseline Kit is a lightweight development tool for visualizing and debugging gri
|
|
|
44
44
|
- 📏 **Baseline Grid:** Core system for maintaining vertical rhythm and consistent spacing across your layouts
|
|
45
45
|
- 🎯 **Column Grid Guide:** Customizable overlay system for visualizing column-based layouts and alignment
|
|
46
46
|
- 📦 **Box Component:** Basic container with configurable spacing that snaps to the baseline grid
|
|
47
|
-
-
|
|
48
|
-
- 📐 **Stack Component:** Flex-based container that maintains consistent spacing and baseline alignment
|
|
47
|
+
- 🧱 **Padder & Spacer:** Spacing primitives with optional baseline snapping
|
|
49
48
|
- 🎨 **Theme System:** Customizable colors and debug visuals through a centralized configuration
|
|
50
49
|
|
|
51
50
|
## Requirements
|
|
@@ -66,35 +65,44 @@ yarn add baseline-kit
|
|
|
66
65
|
pnpm add baseline-kit
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
After installation, import
|
|
68
|
+
After installation, import the smallest entry point that matches your use case.
|
|
69
|
+
For a development grid overlay, use the guide-only React and CSS subpaths:
|
|
70
70
|
|
|
71
71
|
```tsx
|
|
72
|
-
|
|
73
|
-
import 'baseline-kit/
|
|
74
|
-
import 'baseline-kit/theme'; // Recommended theme (or use your own)
|
|
72
|
+
import 'baseline-kit/styles/guide'
|
|
73
|
+
import { Config, Guide } from 'baseline-kit/guide'
|
|
75
74
|
```
|
|
76
75
|
|
|
77
76
|
For frameworks like Remix that use URL imports in a links function:
|
|
78
77
|
|
|
79
78
|
```tsx
|
|
80
79
|
export const links = () => [
|
|
81
|
-
{ rel:
|
|
82
|
-
|
|
83
|
-
];
|
|
80
|
+
{ rel: 'stylesheet', href: 'baseline-kit/styles/guide' },
|
|
81
|
+
]
|
|
84
82
|
```
|
|
85
83
|
|
|
86
|
-
|
|
84
|
+
For the full component set, import the root package and root component styles:
|
|
87
85
|
|
|
88
86
|
```tsx
|
|
89
|
-
|
|
90
|
-
import 'baseline-kit/
|
|
87
|
+
import 'baseline-kit/styles'
|
|
88
|
+
import 'baseline-kit/theme'
|
|
89
|
+
import { Config, Guide, Baseline, Box } from 'baseline-kit'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If you prefer a single CSS file for every component plus the theme:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import 'baseline-kit/styles/full'
|
|
91
96
|
|
|
92
97
|
// For Remix:
|
|
93
98
|
export const links = () => [
|
|
94
|
-
{ rel:
|
|
95
|
-
]
|
|
99
|
+
{ rel: 'stylesheet', href: 'baseline-kit/styles/full' },
|
|
100
|
+
]
|
|
96
101
|
```
|
|
97
102
|
|
|
103
|
+
The browser reset is not included by default. Import `baseline-kit/reset` or
|
|
104
|
+
`baseline-kit/styles/reset` only when you want Baseline Kit to provide one.
|
|
105
|
+
|
|
98
106
|
Baseline Kit is written in TypeScript and includes built-in type definitions—no additional packages required.
|
|
99
107
|
|
|
100
108
|
## Quick Start
|
|
@@ -153,12 +161,12 @@ unit:
|
|
|
153
161
|
|
|
154
162
|
```tsx
|
|
155
163
|
<Config base={8}> // Sets 8px as the base unit
|
|
156
|
-
<
|
|
164
|
+
<Padder
|
|
157
165
|
block={17} // Will be rounded to 16px (2 * base)
|
|
158
166
|
inline={22} // Will be rounded to 24px (3 * base)
|
|
159
167
|
>
|
|
160
168
|
{/* Content automatically aligned to the 8px grid */}
|
|
161
|
-
</
|
|
169
|
+
</Padder>
|
|
162
170
|
</Config>
|
|
163
171
|
```
|
|
164
172
|
|
|
@@ -182,8 +190,7 @@ block={{ start: 2, end: 3 }} // Same as above
|
|
|
182
190
|
Components automatically adjust their spacing to maintain baseline grid alignment:
|
|
183
191
|
|
|
184
192
|
- **Box**: Adjusts bottom padding to ensure total height aligns with base unit
|
|
185
|
-
- **
|
|
186
|
-
- **Layout**: Ensures grid cells align with baseline
|
|
193
|
+
- **Padder**: Snaps padded content to baseline-aligned multiples of the base unit
|
|
187
194
|
|
|
188
195
|
### Debugging Modes
|
|
189
196
|
|
|
@@ -199,21 +206,20 @@ debugging = "none" // Removes debug elements entirely
|
|
|
199
206
|
|
|
200
207
|
### Component Hierarchy
|
|
201
208
|
|
|
202
|
-
#### 1.
|
|
209
|
+
#### 1. Spacing primitives
|
|
203
210
|
|
|
204
|
-
- **`Box`** Basic container
|
|
205
|
-
- **`
|
|
206
|
-
- **`
|
|
211
|
+
- **`Box`** Basic container that snaps its height to the baseline grid
|
|
212
|
+
- **`Padder`** Padding wrapper that snaps padded content to baseline multiples
|
|
213
|
+
- **`Spacer`** Fixed-size spacer with optional measurement indicator overlay
|
|
207
214
|
|
|
208
|
-
#### 2.
|
|
215
|
+
#### 2. Debug overlays
|
|
209
216
|
|
|
210
|
-
- **`Baseline`** Horizontal grid overlay
|
|
211
|
-
- **`Guide`**
|
|
212
|
-
- **`Spacer`** Precise spacing measurement
|
|
217
|
+
- **`Baseline`** Horizontal baseline-grid overlay
|
|
218
|
+
- **`Guide`** Column-grid overlay (line / pattern / fixed / auto variants)
|
|
213
219
|
|
|
214
220
|
#### 3. Configuration
|
|
215
221
|
|
|
216
|
-
- **`Config`** Theme and settings provider
|
|
222
|
+
- **`Config`** Theme and settings provider (base unit, colors, debug modes)
|
|
217
223
|
|
|
218
224
|
### Key Components
|
|
219
225
|
|
|
@@ -255,7 +261,7 @@ debugging = "none" // Removes debug elements entirely
|
|
|
255
261
|
```tsx
|
|
256
262
|
<Box
|
|
257
263
|
block={[2, 5]} // Vertical padding in base units
|
|
258
|
-
span={2} // Grid column span when
|
|
264
|
+
span={2} // Grid column span when placed in a CSS grid parent
|
|
259
265
|
snapping="height" // "none", "height", or "clamp"
|
|
260
266
|
>
|
|
261
267
|
<p>Content aligned to baseline grid</p>
|
|
@@ -266,21 +272,29 @@ debugging = "none" // Removes debug elements entirely
|
|
|
266
272
|
|
|
267
273
|
Baseline Kit comes with a flexible CSS structure and theming system:
|
|
268
274
|
|
|
269
|
-
1. `
|
|
270
|
-
2. `
|
|
271
|
-
3. `
|
|
275
|
+
1. `guide.css` - Guide-only overlay styles (imported via `baseline-kit/styles/guide`)
|
|
276
|
+
2. `styles.css` - Root component styles and base variables (imported via `baseline-kit/styles`)
|
|
277
|
+
3. `theme.css` - Color variables and theming with automatic dark mode support (imported via `baseline-kit/theme`)
|
|
278
|
+
4. `reset.css` - Optional browser reset (imported via `baseline-kit/reset` or `baseline-kit/styles/reset`)
|
|
279
|
+
5. `baseline-kit.css` - Combined root component styles and theme (imported via `baseline-kit/styles/full`)
|
|
272
280
|
|
|
273
281
|
### CSS Import Options
|
|
274
282
|
|
|
275
283
|
Baseline Kit gives you flexibility in how you include the styles:
|
|
276
284
|
|
|
277
285
|
```tsx
|
|
278
|
-
//
|
|
279
|
-
import 'baseline-kit/styles'
|
|
280
|
-
|
|
286
|
+
// Guide-only overlay styles
|
|
287
|
+
import 'baseline-kit/styles/guide'
|
|
288
|
+
|
|
289
|
+
// Root component styles and theme separately
|
|
290
|
+
import 'baseline-kit/styles'
|
|
291
|
+
import 'baseline-kit/theme'
|
|
292
|
+
|
|
293
|
+
// Root component styles and theme in one file
|
|
294
|
+
import 'baseline-kit/styles/full'
|
|
281
295
|
|
|
282
|
-
//
|
|
283
|
-
import 'baseline-kit/
|
|
296
|
+
// Optional reset
|
|
297
|
+
import 'baseline-kit/reset'
|
|
284
298
|
```
|
|
285
299
|
|
|
286
300
|
### Theme Options
|
|
@@ -290,21 +304,21 @@ You now have four options for using the theme system:
|
|
|
290
304
|
#### 1. Use the Built-in Theme (with automatic dark mode)
|
|
291
305
|
|
|
292
306
|
```tsx
|
|
293
|
-
import 'baseline-kit/theme'
|
|
307
|
+
import 'baseline-kit/theme' // Default theme with light/dark mode support
|
|
294
308
|
```
|
|
295
309
|
|
|
296
310
|
#### 2. Use Specific Theme Variants
|
|
297
311
|
|
|
298
312
|
```tsx
|
|
299
313
|
// Use only the light theme (no dark mode)
|
|
300
|
-
import 'baseline-kit/theme/default'
|
|
314
|
+
import 'baseline-kit/theme/default'
|
|
301
315
|
|
|
302
316
|
// Use only the dark theme
|
|
303
|
-
import 'baseline-kit/theme/dark'
|
|
317
|
+
import 'baseline-kit/theme/dark'
|
|
304
318
|
|
|
305
319
|
// Example: Apply dark theme regardless of system preference
|
|
306
|
-
import 'baseline-kit/styles'
|
|
307
|
-
import 'baseline-kit/theme/dark'
|
|
320
|
+
import 'baseline-kit/styles'
|
|
321
|
+
import 'baseline-kit/theme/dark'
|
|
308
322
|
```
|
|
309
323
|
|
|
310
324
|
#### 3. Create a Custom Theme
|
|
@@ -313,7 +327,7 @@ You can use the tokens template as a starting point:
|
|
|
313
327
|
|
|
314
328
|
```tsx
|
|
315
329
|
// First check the token template to see available variables
|
|
316
|
-
import 'baseline-kit/theme/tokens'
|
|
330
|
+
import 'baseline-kit/theme/tokens' // Just for reference (contains no values)
|
|
317
331
|
```
|
|
318
332
|
|
|
319
333
|
Then create your own custom theme file:
|
|
@@ -338,8 +352,8 @@ Then create your own custom theme file:
|
|
|
338
352
|
Then import your custom theme:
|
|
339
353
|
|
|
340
354
|
```tsx
|
|
341
|
-
import 'baseline-kit/styles'
|
|
342
|
-
import './path/to/yourCustomTheme.css'
|
|
355
|
+
import 'baseline-kit/styles' // Required component styles
|
|
356
|
+
import './path/to/yourCustomTheme.css' // Your custom theme
|
|
343
357
|
```
|
|
344
358
|
|
|
345
359
|
#### 4. Override via Config
|
|
@@ -366,9 +380,8 @@ For minor adjustments, use the Config component:
|
|
|
366
380
|
| Baseline | `--bk-baseline-color-[line/flat]-theme` | Colors for lines and backgrounds |
|
|
367
381
|
| Guide | `--bk-guide-color-[line/pattern/auto/fixed]-theme` | Colors for different guide variants |
|
|
368
382
|
| Box | `--bk-box-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
369
|
-
| Stack | `--bk-stack-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
370
|
-
| Layout | `--bk-layout-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
371
383
|
| Spacer | `--bk-spacer-color-[line/flat/text]-theme` | Colors for borders, backgrounds and text |
|
|
384
|
+
| Padder | `--bk-padder-color-theme` | Padder edge color |
|
|
372
385
|
|
|
373
386
|
See the [tokens file](https://github.com/dnvt/baseline-kit/blob/main/dist/theme/tokens.css) for a complete list of available variables.
|
|
374
387
|
|
|
@@ -412,12 +425,16 @@ Components accept an `ssrMode` prop to explicitly optimize for server rendering:
|
|
|
412
425
|
```
|
|
413
426
|
|
|
414
427
|
With `ssrMode` enabled, components use simplified rendering during SSR and initial hydration, then enhance with full features after client-side hydration completes.
|
|
428
|
+
For debug overlays such as `Guide` and `Baseline`, `ssrMode` keeps the simplified fallback markup to avoid client measurement and row/column rendering in SSR-sensitive paths.
|
|
415
429
|
|
|
416
430
|
## Development
|
|
417
431
|
|
|
418
432
|
```shell
|
|
419
433
|
# Clone the repository
|
|
420
|
-
git clone https://github.com/dnvt/baseline-kit.git
|
|
434
|
+
git clone --recurse-submodules https://github.com/dnvt/baseline-kit.git
|
|
435
|
+
|
|
436
|
+
# If you already cloned without submodules
|
|
437
|
+
git submodule update --init --recursive
|
|
421
438
|
|
|
422
439
|
# Install dependencies
|
|
423
440
|
bun install
|
|
@@ -429,6 +446,11 @@ bun run dev
|
|
|
429
446
|
bun run test
|
|
430
447
|
```
|
|
431
448
|
|
|
449
|
+
The `.maestro/source` directory is a workflow submodule. Generated local
|
|
450
|
+
workflow surfaces such as `.claude/`, `maestro/`, `progress/`, and `plans/` are
|
|
451
|
+
ignored. Do not run the Maestro layout migration until the submodule source is
|
|
452
|
+
mounted at `.maestro/source` and the migration plan has been reviewed.
|
|
453
|
+
|
|
432
454
|
## Performance Features
|
|
433
455
|
|
|
434
456
|
- Virtualizes large grid overlays
|
package/dist/baseline-kit.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* Baseline Kit - Combined CSS */
|
|
2
|
-
/* This file contains
|
|
2
|
+
/* This file contains component styles and theme variables */
|
|
3
3
|
|
|
4
|
-
/*
|
|
5
|
-
*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}ul[role=list],ol[role=list]{list-style:none}body{min-height:100vh;text-rendering:optimizeSpeed;line-height:1.5}img,picture{max-width:100%;display:block}@media (prefers-reduced-motion: reduce){html:focus-within{scroll-behavior:auto}*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}:root{--bkb: 8px;--bkzi: 1;--bkzio: 2;--bk-transition-base: .18s ease;--bk-width-default: fit-content;--bk-height-default: fit-content;--bkwf: 100%;--bkhf: 100%;--bkxb: var(--bkb);--bkxw: var(--bk-width-default);--bkxh: var(--bk-height-default);--bkxcl: var(--bk-box-color-line-theme, hsla(300, 60%, 40%, .6));--bkxcf: var(--bk-box-color-flat-theme, hsla(260, 100%, 70%, .2));--bkxci: var(--bk-box-color-text-theme, hsla(300, 60%, 40%, .9));--bkkw: var(--bkwf);--bkkh: var(--bk-height-default);--bkkcl: var(--bk-stack-color-line-theme, hsla(330, 60%, 40%, .6));--bkkcf: var(--bk-stack-color-flat-theme, hsla(0, 100%, 70%, .2));--bkkci: var(--bk-stack-color-text-theme, hsla(330, 60%, 40%, .9));--bkbw: 100%;--bkbh: 100%;--bkrt: 0;--bkrh: 1px;--bkbcl: var(--bk-baseline-color-line-theme, hsla(240, 60%, 40%, .15));--bkbcf: var(--bk-baseline-color-flat-theme, hsla(230, 100%, 70%, .2));--bkgw: 100vw;--bkgh: 100vh;--bkgg: var(--bkb);--bkgj: center;--bkgt: auto;--bkgpb: 0;--bkgpi: 0;--bkgcl: var(--bk-guide-color-line-theme, hsla(240, 60%, 40%, .15));--bkgcp: var(--bk-guide-color-pattern-theme, hsla(230, 100%, 70%, .2));--bkgca: var(--bk-guide-color-auto-theme, hsla(200, 100%, 70%, .15));--bkgcf: var(--bk-guide-color-fixed-theme, hsla(200, 100%, 70%, .15));--bklw: var(--bk-width-default);--bklh: var(--bk-height-default);--bklcl: var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6));--bklcf: var(--bk-layout-color-flat-theme, hsla(0, 100%, 70%, .2));--bklci: var(--bk-layout-color-text-theme, hsla(330, 60%, 40%, .9));--bklgtc: repeat(auto-fill, minmax(100px, 1fr));--bklgtr: auto;--bklg: 0;--bklcg: 0;--bklrg: 0;--bklji: stretch;--bklai: stretch;--bkljc: start;--bklac: start;--bkpw: var(--bk-width-default);--bkph: var(--bk-height-default);--bkpc: var(--bk-padder-color-theme, hsla(270, 60%, 40%, .6));--bksw: var(--bkwf);--bksh: var(--bkhf);--bkscl: var(--bk-spacer-color-line-theme, hsla(270, 60%, 40%, .6));--bkscf: var(--bk-spacer-color-flat-theme, hsla(230, 100%, 70%, .2));--bksct: var(--bk-spacer-color-text-theme, hsla(270, 60%, 40%, 1))}.guide{--bkgcl: var(--bk-guide-color-line-theme, hsla(240, 60%, 40%, .15));--bkgcp: var(--bk-guide-color-pattern-theme, hsla(230, 100%, 70%, .2));--bkgca: var(--bk-guide-color-auto-theme, hsla(200, 100%, 70%, .15));--bkgcf: var(--bk-guide-color-fixed-theme, hsla(200, 100%, 70%, .15))}.baseline{--bkbcl: var(--bk-baseline-color-line-theme, hsla(240, 60%, 40%, .15));--bkbcf: var(--bk-baseline-color-flat-theme, hsla(230, 100%, 70%, .2))}.box{--bkxcl: var(--bk-box-color-line-theme, hsla(300, 60%, 40%, .6));--bkxcf: var(--bk-box-color-flat-theme, hsla(260, 100%, 70%, .2));--bkxci: var(--bk-box-color-text-theme, hsla(300, 60%, 40%, .9))}.stack{--bkkcl: var(--bk-stack-color-line-theme, hsla(330, 60%, 40%, .6));--bkkcf: var(--bk-stack-color-flat-theme, hsla(0, 100%, 70%, .2));--bkkci: var(--bk-stack-color-text-theme, hsla(330, 60%, 40%, .9))}.layout{--bklcl: var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6));--bklcf: var(--bk-layout-color-flat-theme, hsla(0, 100%, 70%, .2));--bklci: var(--bk-layout-color-text-theme, hsla(330, 60%, 40%, .9))}.box{position:relative;width:var(--bkxw);height:var(--bkxh)}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkxcl);pointer-events:none;z-index:var(--bkzi)}.gde{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;padding:var(--bkgpb) var(--bkgpi)}.line{left:-.5px}.cols{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;column-gap:var(--bkgg);grid-template-rows:1fr;grid-template-columns:var(--bkgt);justify-content:var(--bkgj);width:var(--bkwf);height:var(--bkhf);overflow:hidden}.col{min-width:0;width:var(--bkwf);height:var(--bkhf)}.col[data-variant=line]{width:1px;background-color:var(--bkgcl)}.col[data-variant=pattern]{background-color:var(--bkgcp)}.col[data-variant=auto]{background-color:var(--bkgca);overflow:hidden}.col[data-variant=fixed]{background-color:var(--bkgcf)}.ssr{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none;min-height:100px}.pad{position:relative;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr auto;width:var(--bkpw, auto);height:var(--bkph, auto)}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkpc, var(--bk-padder-color-theme));pointer-events:none;z-index:var(--bkzi)}.spr{position:relative;box-sizing:border-box;width:var(--bksw, 100%);height:var(--bksh, auto);flex-shrink:0;display:block;margin:0;padding:0}.line:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkscl, hsla(270, 60%, 40%, .6));z-index:calc(var(--bkzi, 1))}.flat{background-color:var(--bkscf, hsla(230, 100%, 70%, .2))}.stk{display:flex;position:relative;width:var(--bkkw);height:var(--bkkh)}.stk .line:after{border:none}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkkcl, hsla(330, 60%, 40%, .6));pointer-events:none;z-index:var(--bkzio, 2)}.flat{background-color:var(--bkkcf, hsla(0, 100%, 70%, .2))}.lay{display:grid;position:relative;box-sizing:border-box;width:var(--bklw, var(--bk-width-default, auto));height:var(--bklh, var(--bk-height-default, auto));grid-template-columns:var( --bklgtc, repeat(auto-fill, minmax(100px, 1fr)) );grid-template-rows:var(--bklgtr, auto);gap:var(--bklg, 0);column-gap:var(--bklcg, 0);row-gap:var(--bklrg, 0);justify-items:var(--bklji, stretch);align-items:var(--bklai, stretch);justify-content:var(--bkljc, start);align-content:var(--bklac, start)}.lay .line:after,.stk .line:after{border:none}.v:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bklcl, var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6)));pointer-events:none;z-index:var(--bkzio, 2)}.bas{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;width:var(--bkbw);height:var(--bkbh);overflow:hidden}.row{left:0;right:0;position:absolute;top:var(--bkrt);height:var(--bkrh);background-color:var(--bkbc)}.ssr{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none}.v{opacity:1;visibility:visible;transition:opacity var(--bk-transition-base),visibility 0ms linear}.h{opacity:0;visibility:hidden;transition:opacity var(--bk-transition-base),visibility 0ms linear .18s}:root{--bk-color-black-primary: 0, 0%, 10%;--bk-color-black-secondary: 0, 10%, 30%;--bk-color-white-primary: 0, 100%, 90%;--bk-color-white-secondary: 0, 0%, 90%;--bk-color-pink-primary: 300, 60%, 40%;--bk-color-pink-secondary: 260, 100%, 70%;--bk-color-purple-primary: 270, 60%, 40%;--bk-color-purple-secondary: 230, 100%, 70%;--bk-color-blue-primary: 240, 60%, 40%;--bk-color-blue-secondary: 200, 100%, 70%;--bk-color-cyan-primary: 200, 60%, 40%;--bk-color-cyan-secondary: 160, 100%, 70%;--bk-color-green-primary: 160, 60%, 40%;--bk-color-green-secondary: 110, 100%, 70%;--bk-color-yellow-primary: 30, 60%, 40%;--bk-color-yellow-secondary: 70, 100%, 70%;--bk-color-orange-primary: 10, 60%, 40%;--bk-color-orange-secondary: 30, 100%, 70%;--bk-color-red-primary: 330, 60%, 40%;--bk-color-red-secondary: 0, 100%, 70%;--bk-guide-color-line-theme: hsla(var(--bk-color-blue-primary), .15);--bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), .2);--bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), .15);--bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), .15);--bk-baseline-color-line-theme: hsla(var(--bk-color-blue-primary), .15);--bk-baseline-color-flat-theme: hsla(var(--bk-color-purple-secondary), .2);--bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), .6);--bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), .2);--bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1);--bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), .6);--bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), .2);--bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), .9);--bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), .2);--bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), .2);--bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-padder-color-theme: hsla(var(--bk-color-purple-primary), .6)}@media (prefers-color-scheme: dark){:root{--bk-color-black-primary: 0, 10%, 30%;--bk-color-black-secondary: 0, 0%, 10%;--bk-color-white-primary: 0, 0%, 90%;--bk-color-white-secondary: 0, 100%, 90%;--bk-color-pink-primary: 260, 100%, 70%;--bk-color-pink-secondary: 300, 60%, 40%;--bk-color-purple-primary: 230, 100%, 70%;--bk-color-purple-secondary: 270, 60%, 40%;--bk-color-blue-primary: 200, 100%, 70%;--bk-color-blue-secondary: 240, 60%, 40%;--bk-color-cyan-primary: 160, 100%, 70%;--bk-color-cyan-secondary: 200, 60%, 40%;--bk-color-green-primary: 110, 100%, 70%;--bk-color-green-secondary: 160, 60%, 40%;--bk-color-yellow-primary: 70, 100%, 70%;--bk-color-yellow-secondary: 30, 60%, 40%;--bk-color-orange-primary: 30, 100%, 70%;--bk-color-orange-secondary: 10, 60%, 40%;--bk-color-red-primary: 0, 100%, 70%;--bk-color-red-secondary: 330, 60%, 40%;--bk-baseline-color-line-theme: hsla(var(--bk-color-white-primary), .1);--bk-baseline-color-flat-theme: hsla(var(--bk-color-white-secondary), .2);--bk-box-color-line-theme: hsla(var(--bk-color-pink-primary), .6);--bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), .3);--bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), .9);--bk-guide-color-line-theme: hsla(var(--bk-color-white-primary), .1);--bk-guide-color-pattern-theme: hsla(var(--bk-color-purple-secondary), .25);--bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), .2);--bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), .2);--bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), .3);--bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), .6);--bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), .3);--bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), .9);--bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), .7);--bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), .3);--bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1)}}.spr_zbcF6{position:relative;box-sizing:border-box;width:var(--bksw, 100%);height:var(--bksh, auto);flex-shrink:0;display:block;margin:0;padding:0}.line_qHW69:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkscl, hsla(270, 60%, 40%, .6));z-index:calc(var(--bkzi, 1))}.flat_gqixr{background-color:var(--bkscf, hsla(230, 100%, 70%, .2))}.pad_w2-sL{position:relative;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr auto;width:var(--bkpw, auto);height:var(--bkph, auto)}.lay_Ew8za .line_ESlzk:after,.stk_7SJoE .line_ESlzk:after{border:none}.v_lhGBy:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkpc, var(--bk-padder-color-theme));pointer-events:none;z-index:var(--bkzi)}.lay_5cMu5{display:grid;position:relative;box-sizing:border-box;width:var(--bklw, var(--bk-width-default, auto));height:var(--bklh, var(--bk-height-default, auto));grid-template-columns:var( --bklgtc, repeat(auto-fill, minmax(100px, 1fr)) );grid-template-rows:var(--bklgtr, auto);gap:var(--bklg, 0);column-gap:var(--bklcg, 0);row-gap:var(--bklrg, 0);justify-items:var(--bklji, stretch);align-items:var(--bklai, stretch);justify-content:var(--bkljc, start);align-content:var(--bklac, start)}.lay_5cMu5 .line_j2f8-:after,.stk_3Spwo .line_j2f8-:after{border:none}.v_dprVE:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bklcl, var(--bk-layout-color-line-theme, hsla(330, 60%, 40%, .6)));pointer-events:none;z-index:var(--bkzio, 2)}.box_rDCRX{position:relative;width:var(--bkxw);height:var(--bkxh)}.v_0MMHD:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkxcl);pointer-events:none;z-index:var(--bkzi)}.stk_l-58l{display:flex;position:relative;width:var(--bkkw);height:var(--bkkh)}.stk_l-58l .line_THMgb:after{border:none}.v_-k3qw:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid var(--bkkcl, hsla(330, 60%, 40%, .6));pointer-events:none;z-index:var(--bkzio, 2)}.flat_j15hF{background-color:var(--bkkcf, hsla(0, 100%, 70%, .2))}.gde_-Naxo{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;padding:var(--bkgpb) var(--bkgpi)}.line_-VS-e{left:-.5px}.cols_8lD6D{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;column-gap:var(--bkgg);grid-template-rows:1fr;grid-template-columns:var(--bkgt);justify-content:var(--bkgj);width:var(--bkwf);height:var(--bkhf);overflow:hidden}.col_rlbsL{min-width:0;width:var(--bkwf);height:var(--bkhf)}.col_rlbsL[data-variant=line]{width:1px;background-color:var(--bkgcl)}.col_rlbsL[data-variant=pattern]{background-color:var(--bkgcp)}.col_rlbsL[data-variant=auto]{background-color:var(--bkgca);overflow:hidden}.col_rlbsL[data-variant=fixed]{background-color:var(--bkgcf)}.ssr_VGvpO{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none;min-height:100px}.bas_e-SXr{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;width:var(--bkbw);height:var(--bkbh);overflow:hidden}.row_q-FZb{left:0;right:0;position:absolute;top:var(--bkrt);height:var(--bkrh);background-color:var(--bkbc)}.ssr_W1N5g{box-sizing:border-box;display:grid;position:relative;z-index:1;pointer-events:none}
|
|
4
|
+
/* Component Styles */
|
|
5
|
+
:root{--bk-base:8px;--bk-zi:1;--bk-zio:2;--bk-transition-base:.18s ease;--bk-width-default:fit-content;--bk-height-default:fit-content;--bk-wf:100%;--bk-hf:100%;--bkbx-b:var(--bk-base);--bkbx-w:var(--bk-width-default);--bkbx-h:var(--bk-height-default);--bkbx-cl:var(--bk-box-color-line-theme,#a329a399);--bkbx-cf:var(--bk-box-color-flat-theme,#96f3);--bkbx-ct:var(--bk-box-color-text-theme,#a329a3e6);--bkbl-w:100%;--bkbl-h:100%;--bkbl-rt:0;--bkbl-rh:1px;--bkbl-cl:var(--bk-baseline-color-line-theme,#2929a326);--bkbl-cf:var(--bk-baseline-color-flat-theme,#667fff33);--bkgd-w:100vw;--bkgd-h:100vh;--bkgd-g:var(--bk-base);--bkgd-j:center;--bkgd-t:auto;--bkgd-pb:0;--bkgd-pi:0;--bkgd-cl:var(--bk-guide-color-line-theme,#2929a326);--bkgd-cp:var(--bk-guide-color-pattern-theme,#667fff33);--bkgd-ca:var(--bk-guide-color-auto-theme,#66ccff26);--bkgd-cf:var(--bk-guide-color-fixed-theme,#66ccff26);--bkpd-w:var(--bk-width-default);--bkpd-h:var(--bk-height-default);--bkpd-c:var(--bk-padder-color-theme,#6629a399);--bksp-w:var(--bk-wf);--bksp-h:var(--bk-hf);--bksp-cl:var(--bk-spacer-color-line-theme,#6629a399);--bksp-cf:var(--bk-spacer-color-flat-theme,#667fff33);--bksp-ct:var(--bk-spacer-color-text-theme,#6629a3)}.bas_4Emvv{pointer-events:none;width:var(--bkbl-w);height:var(--bkbl-h);contain:layout style paint;position:absolute;inset:0;overflow:hidden}.v_lNfeX{opacity:1;visibility:visible;transition:opacity var(--bk-transition-base), visibility 0s linear}.h_PbNDU{opacity:0;visibility:hidden;transition:opacity var(--bk-transition-base), visibility 0s linear .18s}.row_J1Wva{left:0;right:0;top:var(--bkbl-rt);height:var(--bkbl-rh);background-color:var(--bkbl-c);position:absolute}.ssr_PQAP-{box-sizing:border-box;z-index:1;pointer-events:none;display:grid;position:relative}.gde_4PKz3{box-sizing:border-box;width:var(--bkgd-w,100%);height:var(--bkgd-h,100%);max-width:var(--bkgd-mw,none);pointer-events:none;padding:var(--bkgd-pb,0) var(--bkgd-pi,0);margin-inline:auto;position:absolute;inset:0}.v_yAvN0{opacity:1;visibility:visible;transition:opacity var(--bk-transition-base), visibility 0s linear}.h_XcWcy{opacity:0;visibility:hidden;transition:opacity var(--bk-transition-base), visibility 0s linear .18s}.line_UaLjW{left:-.5px}.cols_ibtT4{column-gap:var(--bkgd-g);grid-template-rows:1fr;grid-template-columns:var(--bkgd-t);justify-content:var(--bkgd-j);width:var(--bk-wf);height:var(--bk-hf);contain:layout style paint;display:grid;position:absolute;inset:0;overflow:hidden}.col_QPSDI{min-width:0;width:var(--bk-wf);height:var(--bk-hf)}.col_QPSDI[data-variant=line]{background-color:var(--bkgd-cl);width:1px}.cols_ibtT4[data-variant=line]{background-image:repeating-linear-gradient(to right, var(--bkgd-line-color,var(--bkgd-cl)) 0 1px, transparent 1px var(--bkgd-line-period,1px));display:block}.col_QPSDI[data-variant=pattern]{background-color:var(--bkgd-cp)}.col_QPSDI[data-variant=auto]{background-color:var(--bkgd-ca);overflow:hidden}.col_QPSDI[data-variant=fixed]{background-color:var(--bkgd-cf)}.ssr_4UN4k{box-sizing:border-box;z-index:1;pointer-events:none;min-height:100px;display:grid;position:relative}.spr_syfhf{box-sizing:border-box;width:var(--bksp-w,100%);height:var(--bksp-h,auto);flex-shrink:0;margin:0;padding:0;display:block;position:relative}.line_nzGsp:after{content:"";border:1px solid var(--bksp-cl,#6629a399);z-index:calc(var(--bk-zi,1));position:absolute;inset:0}.flat_XJWHt{background-color:var(--bksp-cf,#667fff33)}.pad_NizuS{width:var(--bkpd-w,auto);height:var(--bkpd-h,auto);grid-template-rows:auto 1fr auto;grid-template-columns:auto 1fr auto;display:grid;position:relative}.lay_ZdQLz .line_7S7iI:after,.stk_X79YA .line_7S7iI:after{border:none}.v_dowAz:after{content:"";border:1px solid var(--bkpd-c,var(--bk-padder-color-theme));pointer-events:none;z-index:var(--bk-zi);position:absolute;inset:0}.box_sPqFs{width:var(--bkbx-w);height:var(--bkbx-h);position:relative}.v_ZrZ5j:after{content:"";border:1px solid var(--bkbx-cl);pointer-events:none;z-index:var(--bk-zi);position:absolute;inset:0}
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
/* Theme */
|
|
@@ -74,16 +74,6 @@
|
|
|
74
74
|
--bk-box-color-flat-theme: hsla(var(--bk-color-pink-secondary), 0.2);
|
|
75
75
|
--bk-box-color-text-theme: hsla(var(--bk-color-pink-primary), 0.9);
|
|
76
76
|
|
|
77
|
-
/* Stack Component Theme */
|
|
78
|
-
--bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
|
|
79
|
-
--bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.2);
|
|
80
|
-
--bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
|
|
81
|
-
|
|
82
|
-
/* Layout Component Theme */
|
|
83
|
-
--bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
|
|
84
|
-
--bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.2);
|
|
85
|
-
--bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
|
|
86
|
-
|
|
87
77
|
/* Padder Component Theme */
|
|
88
78
|
--bk-padder-color-theme: hsla(var(--bk-color-purple-primary), 0.6);
|
|
89
79
|
}
|
|
@@ -135,14 +125,6 @@
|
|
|
135
125
|
--bk-guide-color-auto-theme: hsla(var(--bk-color-blue-secondary), 0.2);
|
|
136
126
|
--bk-guide-color-fixed-theme: hsla(var(--bk-color-blue-secondary), 0.2);
|
|
137
127
|
|
|
138
|
-
--bk-stack-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
|
|
139
|
-
--bk-stack-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.3);
|
|
140
|
-
--bk-stack-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
|
|
141
|
-
|
|
142
|
-
--bk-layout-color-line-theme: hsla(var(--bk-color-red-primary), 0.6);
|
|
143
|
-
--bk-layout-color-flat-theme: hsla(var(--bk-color-red-secondary), 0.3);
|
|
144
|
-
--bk-layout-color-text-theme: hsla(var(--bk-color-red-primary), 0.9);
|
|
145
|
-
|
|
146
128
|
--bk-spacer-color-line-theme: hsla(var(--bk-color-purple-primary), 0.7);
|
|
147
129
|
--bk-spacer-color-flat-theme: hsla(var(--bk-color-purple-secondary), 0.3);
|
|
148
130
|
--bk-spacer-color-text-theme: hsla(var(--bk-color-purple-primary), 1);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ConfigSchema } from './schema';
|
|
2
|
+
type MergeConfigParams = {
|
|
3
|
+
parentConfig: ConfigSchema;
|
|
4
|
+
base?: number;
|
|
5
|
+
baseline?: Partial<ConfigSchema['baseline']>;
|
|
6
|
+
guide?: Partial<ConfigSchema['guide']>;
|
|
7
|
+
spacer?: Partial<ConfigSchema['spacer']>;
|
|
8
|
+
box?: Partial<ConfigSchema['box']>;
|
|
9
|
+
padder?: Partial<ConfigSchema['padder']>;
|
|
10
|
+
};
|
|
11
|
+
export declare const mergeConfig: (params: MergeConfigParams) => ConfigSchema;
|
|
12
|
+
type CSSVariablesParams = {
|
|
13
|
+
base: number;
|
|
14
|
+
baseline: ConfigSchema['baseline'];
|
|
15
|
+
guide: ConfigSchema['guide'];
|
|
16
|
+
spacer: ConfigSchema['spacer'];
|
|
17
|
+
box: ConfigSchema['box'];
|
|
18
|
+
padder: ConfigSchema['padder'];
|
|
19
|
+
};
|
|
20
|
+
export declare const createCSSVariables: (params: CSSVariablesParams) => Record<string, string>;
|
|
21
|
+
export {};
|