Skip to content

Migration

NightCSS is the CSS layer of NightVue and NightPack, rebuilt for modern CSS. The two projects are archived; this guide maps their API to the current one. For day-to-day work, start with the Utilities reference — this page is only for ports.

The old projects shared one SCSS core (src/styles/@core). NightCSS keeps the ideas — the 4px spacing scale, the generated utility families, the type and shadow scales — and modernizes the implementation: @layer instead of !important, --nc-* tokens instead of compile-time hex values, and color-mix() instead of a precomputed shade matrix.

The default bundle is now the lean one: core plus base utilities. Breakpoint variants live in a separate module, so p-md-*, d-lg-*, radius-md-large and the responsive row/column classes need one extra import:

@import "nightcss";
@import "nightcss/utilities/responsive";

The responsive import must come after the base one. Breakpoint rules do not raise specificity, so source order is what makes .p-md-4 win over .p-4. If you prefer a single file, import nightcss/full instead — it is the pre-2.0 bundle. To take only the families you use, start from nightcss/core and add nightcss/utilities/spacing, nightcss/utilities/typography, and so on.

The NightVue gh-pages demo is preserved as a historical artifact at nightrunner91.github.io/nightvue. NightPack never had a public demo. Both repositories are archived and read-only; NightCSS is where the CSS layer continues.

Most old class names still work. For the families with two spellings, the table shows both the long name and the compact alias; most projects can mix them.

Old Available as
clr-primary, bg-primary, fill-primary same palette classes, now token-backed
bg-primary-light-3, clr-primary-dark-2 same names, computed with color-mix()
m-*, p-* same names on the 4px --nc-space-* scale
.row, .col-*, .offset-*, .order-* same names, or native .grid, .grid-cols-*, .col-span-*
shadow-level-1 … shadow-level-5 same names, or shadow-xs … shadow-lg
radius-small/base/large/circle same names, or rounded-sm/md/lg/full
radius-t-*, radius-tl-*, … same names
gradient-* same names, now backed by --nc-gradient-* tokens
speed-*, timing-* same names, backed by --nc-speed-* / --nc-timing-*
opacity-0 … opacity-10 same names and values
rotate-plus-90, rotate-minus-90, … same names, using the rotate: property
z-minus-1, z-0, z-plus-12 same names
top-*, right-*, bottom-*, left-* same names
d-flex, justify-content-*, align-items-* same names, or flex, justify-*, items-*
text-uppercase, text-underline, white-space-* same names
responsive m-sm-4, d-lg-none, radius-md-large, … same suffix pattern on the new breakpoints

The old README was a 1,700-line manual: it had to explain every Sass map, every generated class, and every Vue integration because the library generated a large API from configuration. The Utilities section is now the class reference, grouped by job:

You want to… Read
Find a class by family Utilities overview
Set a type scale, weight, leading, or measure Type Scale, Weight, Line Height
Round a corner, add a border, or choose a shadow Border, Radius, Shadow
Tint a colour or build a gradient Color, Gradients
Add a hover transition or an entrance Motion
Build a 12-column page or a card grid Grid

What is still different:

  • -sat-* and -desat-* are not classes. The light/dark shade ladder is generated with color-mix(). For chroma changes, use relative colour syntax or the Sass nc-shade-level() helper; 1,600 precomputed classes would not earn their weight.
  • Breakpoints moved. The old 576/768/992/1200/1400 set becomes 640/768/1024/1280/1536, so -sm … -2xl suffixes shift their thresholds.
  • Side and offset spacing is base-only. The shorthand p-*, px-*, py-*, m-*, mx-*, my-*, and auto margins keep responsive suffixes; individual sides and top/right/bottom/left do not. A media query covers the rare case.
  • No !important. Utilities live in a layer. Responsive rules come later in the same layer, so they still win over base classes, but your unlayered component CSS wins over both by design.
  • The Vue layout system, <SvgIcon>, and the icon sprite loader. They were Vue-specific and are not part of a CSS foundation.
  • .container has a modern implementation. The row/col grid is available as .row, .col, and .col-*, but .container is the min()-based wrapper, not a per-breakpoint $containers map.

The old 576/768/992/1200/1400 breakpoints become the NightCSS set. Old media helper variables map to the Sass breakpoint mixins.

Old New
576px sm — 640px
768px md — 768px
992px lg — 1024px
1200px xl — 1280px
1400px 2xl — 1536px
Old SCSS New
$sm-up @include nc.nc-media-up("sm")
$sm-md @include nc.nc-media-between("sm", "md")

The SCSS core moved to the optional nightcss/scss subpackage, modernized to the module system.

Old New
@import "variables" @use "nightcss/scss" as nc
map-get($colors, "primary") map.get(nc.$nc-palette, "primary")
color("primary") nc.nc-palette("primary") (or nc.nc-color("accent") for semantics)
spacer(4) nc.nc-space(4)
radius("large") nc.nc-radius("large")
shadow("level-3") nc.nc-shadow("level-3")
gradient("primary_success") nc.nc-gradient("primary_success")
transition($prop, $speed) nc.nc-motion($prop, $speed, $timing)
opacity(5) nc.nc-opacity(5)
lighten($c, 10%) / mix(...) nc.nc-tint(...) / nc.nc-shade(...) / nc.nc-shade-level(...)
container(), row(), col(), offset(), order() use the .row / .col-* classes or native grid primitives
font-face(), icon-size(), text-truncate() kept, unchanged
!important everywhere none — @layer gives predictable specificity

The old normalize-based reset becomes a modern reset (Andy Bell school) with base element styles at zero specificity.

The old fixed light/dark compilation becomes runtime theming through light-dark() and --nc-* custom properties. Instead of compiling separate palettes, override a token:

:root {
--nc-accent: oklch(45% 0.2 280);
}
  1. Keep clr-*/bg-* classes if you like them, or switch to the semantic text-*/bg-surface utilities. Both are supported.
  2. Keep .row/.col-* for existing markup; prefer .grid, .grid-cols-*, and .col-span-* for new layouts.
  3. Recheck breakpoint thresholds: sm … 2xl are 640/768/1024/1280/1536.
  4. Port SCSS to nightcss/scss on @use/@forward.
  5. Drop !important; your unlayered CSS now wins by default.
  6. Read the Utilities reference for the current class map.