Weight
Weight utilities set font-weight. Use them for emphasis and UI labels, not for
every paragraph.
Classes
Section titled “Classes”| Class | font-weight |
|---|---|
font-weight-lighter |
lighter |
font-weight-bolder |
bolder |
font-weight-100 … font-weight-900 |
100 … 900 |
Compact aliases: font-normal (400), font-medium (500), font-semibold (600),
font-bold (700).
<p class="font-weight-500">UI label</p><p class="font-weight-700">Emphasis</p>The weight family reads --font-weight:
<p class="font-weight-500" style="--font-weight: 650">Variable font weight</p>Responsive weight
Section titled “Responsive weight”Breakpoints go after the family name:
<h2 class="font-weight-500 font-weight-md-700">Quiet on small screens</h2>Responsive: font-weight-sm-600 … font-weight-2xl-900.
These classes are in the separate responsive module: import
nightcss/utilities/responsive after the base bundle, or use
nightcss/full.
Limits
Section titled “Limits”- A font only has the weights it ships. Requesting
700from a 400/500 family lets the browser synthesize a heavier face, which often looks muddy. - There is no
font-style: normalutility. To undofont-italic, write the property in your CSS; see Font Style. - Use
text-mutedfor quieter copy. Weight is not a substitute for colour contrast.
Use in CSS
Section titled “Use in CSS”The class is the markup shorthand. The same style in a component stylesheet:
.label { font-weight: var(--nc-weight-medium);}The Sass subpackage exposes the same value: nc.nc-weight("medium"). See Sass
subpackage.
A breakpoint is the same declaration inside a media query; you do not need a second class.