CSS Baseline
stableInjects a small global reset.
Basic usage
Injected CSS reset:
*,*::before,*::after { box-sizing: border-box }
html { line-height: 1.5; -webkit-text-size-adjust: 100% }
body { margin: 0 }
button,input,textarea,select { font: inherit }Examples
Injected styles
CssBaseline injects a minimal CSS reset as a <style> tag — mount it once at your app root.
CssBaseline is mounted. Injected rules:
*, *::before, *::after {
box-sizing: border-box;
}
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
button, input, textarea, select {
font: inherit;
}With color-scheme
Pass enableColorScheme to also inject color-scheme: light dark on html.
html {
color-scheme: light dark;
/* ... other reset rules */
}Color scheme baseline
enableColorScheme adds color-scheme metadata to the global reset.
Baseline with color-scheme enabled.
Features
- Box sizing reset.
- Form font inheritance.
Installation
bash
pnpm dlx structyl add css-baselineAPI Reference
CssBaseline
Small reset injector.
| Prop | Type | Default |
|---|---|---|
| enableColorScheme | booleanAdd color-scheme support to html. | false |