Browse documentation

Reference / Core concepts

Preflight

Understand the base styles Mono writes before utility rules and how to fit them into an existing site.

Style semantic elements explicitly

Preflight removes default heading margins and sizes, resets list markers, and makes box sizes include borders and padding. Keep meaningful elements in your markup and use utilities to set their appearance.

HTML
<article class="p-6">
  <h2 class="text-2xl font-bold">Print checklist</h2>
  <ul class="mt-3 list-disc pl-5">
    <li>Check the margins.</li>
    <li>Review the proof.</li>
  </ul>
</article>

Use an existing reset

If your application manages base styles itself, switch off Preflight. Some utilities assume base styles. For example, pair border with border-solid to give an otherwise unstyled element a visible border.

mono.config.mjs
export default {
  preflight: false,
}

Inspect a utility in isolation

Use the same option with the JavaScript API to see only the rules required by your selected class. This example runs in an ES module after installing Mono locally.

inspect.mjs
import { compile } from 'mono-css'

console.log(compile(['p-4'], { preflight: false, minify: true }))
// .p-4{padding:1rem}