Skip to content

Radius

Radius softens a surface. Two ladders share the same property: a semantic scale tuned for UI, and a named geometric scale with per-side variants.

Token Class Value Use for
--nc-radius-none rounded-none 0 Tables, full-bleed media
--nc-radius-sm rounded-sm 0.25rem Inputs, small chips, inline code
--nc-radius-md rounded-md 0.5rem Buttons, fields, menu items
--nc-radius-lg rounded-lg 1rem Cards, panels, dialogs
--nc-radius-xl rounded-xl 1.5rem Hero panels, large media
--nc-radius-full rounded-full 9999px Pills, avatars, circles
none
sm
md
lg
xl
full

The named ladder is geometric and includes side variants:

Size Class Value
zero radius-zero 0
small radius-small 4px
base radius-base 8px
large radius-large 20px
circle radius-circle 100%

Combine a size with a side: radius-t-*, radius-r-*, radius-b-*, radius-l-*, and the corners radius-tl-*, radius-tr-*, radius-bl-*, radius-br-*.

<div class="radius-large">All corners</div>
<div class="radius-t-large">Top corners only</div>
<div class="radius-br-circle">One round corner</div>

Responsive: radius-md-large, radius-tl-md-small, radius-b-lg-circle. The breakpoint goes after the side.

These classes are in the separate responsive module: import nightcss/utilities/responsive after the base bundle, or use nightcss/full.

The semantic rounded-* classes set all four corners and read the --radius knob. For one corner in your own CSS, use the logical properties:

.panel {
border-start-start-radius: 0;
border-start-end-radius: 0;
}

Nesting matters. A rounded card with an image inside needs overflow-hidden or the frame primitive, otherwise the image corners stay square:

<article class="border rounded-lg overflow-hidden">
<div class="frame" style="--frame-ratio: 16 / 9">
<img src="…" alt="…" />
</div>
<div class="p-4">…</div>
</article>

See Border for the edge and Shadow for elevation.

The class is the markup shorthand. The same style in a component stylesheet:

.card {
border-radius: var(--nc-radius-lg);
}
.pill {
border-radius: var(--nc-radius-full);
}

The Sass subpackage exposes the same values: nc.nc-radius("lg") and nc.nc-radius("full"). See Sass subpackage.

A breakpoint is the same declaration inside a media query; you do not need a second class.