Layout, and nothing else.
Container, grid, span, gap and offset. Five primitives, configured at compile time and generated for every breakpoint. No colors, no typography, no components to fight with.
Quick start
Working layout in three steps.
No build step required. Grab the compiled CSS, or use the SCSS source when you want to change the defaults.
Include the CSS
Download narleaf-full.css (every utility) or narleaf-core.css (the essentials).
Nest three layers
Container → grid → children. Every class belongs to exactly one of these layers.
Configure (optional)
Using Dart Sass? Change columns, breakpoints or namespace in one place.
How it thinks
Three layers. Three rules.
A class only works on the layer it belongs to. Put it anywhere else and it doesn't throw an error. It just does nothing.
1 · Padding goes on the container
pi-* sits on the same element as container or container-full.
2 · Gap goes on the grid
gap-*, gi-* and gb-* sit on the same element as grid.
3 · Columns go on direct children
span, offset and col-* only work one level below a grid.
Playground
Drag the width. Watch the classes.
The preview is a real viewport, so media queries fire exactly as they would in a browser. The code panel highlights which class wins at the current width.
1024 px lg
Examples
Real pages, built with the same classes.
Three full-page templates. Open them, resize the window, and press the Layout button to see which classes build each region.
Reference
One naming pattern for everything.
No breakpoint means “always”. With a breakpoint it means “from this width up”. Mobile first, every time.
| Class | Does | Goes on |
|---|---|---|
| container | Centers content, caps width at 1280px. | any wrapper |
| container-full | Same as container, no max width. | any wrapper |
| pi-{0·16·24·32·40} | Horizontal padding of the container. | container |
| pi-auto | Padding that scales per breakpoint: 16 → 24 → 32 → 40px. | container |
| grid | 12 equal columns. | any element |
| gap-{0·8·16·24·32·40·48} | Row and column gap together. | grid |
| gi-{…} · gb-{…} | Column gap only · row gap only. | grid |
| gap-auto | Gap that scales per breakpoint: 16 → 24px. | grid |
| span-{1–12} · span-auto | How many columns the element takes. | grid child |
| offset-{1–11} · offset-auto | Pushes the element N columns right. | grid child |
| col-start-{1–13} · col-end-{1–13} | Exact start / end column line. | grid child |
Add a breakpoint to any utility except container, grid, pi-auto and gap-auto:
Make it yours
Configured once. Checked at build time.
Every token is an SCSS variable. Change it in one place and all classes and responsive variants regenerate to match.
- Any column count, any breakpoint names
- Namespace applied to classes and CSS variables
- Turn off utility groups you don't use
- Optional
:where()selectors and@layer
Forget the tablet key in $gap-auto-values and the build stops instead of shipping broken CSS: