Configuration options
Every option in nibcss.config.ts — what it does, its default and an example.
Option | Default | Summary |
|---|---|---|
| start of every generated class name | |
| allow | |
| how | |
8 built-ins | responsive modifiers | |
| named values, referenced as | |
| recipes | |
| extra shorthand → property names | |
| drop invalid values and unknown modifiers | |
| base reset in | |
| report diagnostics | |
| language of diagnostics | |
| re-word diagnostics or add a language | |
runtime: | value validator | |
| diagnostic sink |
prefix#
prefix: "ui-", // → .ui-jbmcpldarkMode: "class", // .dark .nib-x { … } — toggle with runtime.toggleDarkMode()
darkMode: "media", // @media (prefers-color-scheme: dark) { … }
darkMode: false, // every dark: rule is droppedbreakpoints#
Merged over the built-ins (xs 480, sm 576, md 768, lg 992, xl 1024, 2xl 1200, 3xl 1440, 4xl 1536).
breakpoints: {
md: { min: 800 },
tablet: { min: 768, max: 1023 },
wide: { min: 1800 },
},tokens#
tokens: {
color: { brand: "#4F52D9", "brand-hover": "#3A3DBF" },
space: { sm: "8px", md: "16px" },
},components#
components: {
btn: "d=inline-flex; p=8px $space.md; bdrd=8px",
"btn-primary": "btn; bgc=$color.brand; cl=#fff",
},shortcuts#
shortcuts: {
size: "width height",
tap: "-webkit-tap-highlight-color",
},preflight: true, // the built-in reset (default)
preflight: false, // no reset
preflight: "*, *::before, *::after { box-sizing: border-box }", // your owndebug#
Turns on diagnostics: the terminal (with file and line at build time), nib:warning events in the browser and
the dev overlay. Toggling it takes effect without restarting.
language#
Built in: uz (default), en, ru, tr, es, de, zh.
messages#
Re-word a line or add a language; a missing key falls back to English:
language: "fr",
messages: {
fr: {
"invalid-value": "« {value} » n'est pas valide pour {property}",
"unknown-utility": "Utilitaire inconnu « {name} »",
},
},onWarn: (message, context, diagnostic) => {
telemetry.track("nib_warning", { id: diagnostic?.id, context });
},Plugin-only options#
These belong to the build plugin, not the config file: rewrite, include, exclude, devtools,
scaffold, config, override. See unplugin API.