API Reference

Compiler API

Node-only compiler entry points for nitrocss and nitrowind.

Compiler API

Compiler APIs are Node-only. Do not import them from application runtime code.

Nitrowind compiler

import { compile, compileCss, scanCandidates } from '@nitrofoundation/nitrowind/compiler';
ExportDescription
scanCandidatesUses Tailwind oxide to scan content files for class candidates.
compileCssRuns Tailwind v4, appends generated utilities, and returns flattened CSS.
compileProduces the serialized artifact consumed by the runtime.

Nitrocss compiler

import { compileFromCss, flattenCss, serializeArtifact } from '@nitrofoundation/nitrocss/compiler';

The artifact contains:

  • classes: className to compiled buckets.
  • themes: theme variable maps.
  • themeNames: discovered theme names.
  • rem: root rem value.

On this page