Getting started

Configuration

jx.yaml describes the sources to scan, the output and the theme extensions.

The jx.yaml file

The CLI looks for jx.yaml in the current folder. Without a file, the defaults apply. Pass a different path with --config.

jx.yaml
# jx.yaml
content: [lib, web]        # files or folders to scan
extensions: [dart, html]   # extensions to read
exclude: [generated]       # ignored folders, on top of the defaults
output: web/jx.css         # generated CSS file
minify: false              # minification
reset: true                # include the preflight
dark_mode: media           # or class: dark: applies under .dark

theme:
  extend:                  # merged with the default theme
    colors:
      brand: '#3B6CF0'
    breakpoints:
      3xl: 1920px
  override:                # replaces a whole category
    font-family:
      sans: 'Inter, system-ui, sans-serif'

Options

Key Type Default Role
content list [lib, web] Files or folders to scan.
extensions list [dart, html] Extensions to read, without the dot.
exclude list build, .dart_tool, .git, node_modules Ignored folder names, added to the defaults.
output path web/jx.css Generated CSS file.
minify boolean false Minifies the output.
reset boolean true Puts the preflight at the top of the stylesheet.
dark_mode media | class media dark: follows the system, or a dark class set on an ancestor.
theme map {} extend and override keys.

Extending the theme

theme.extend adds or replaces tokens without touching the others: the brand color above becomes available to c:, bg:, bc:… next to the default palette.

theme.override replaces a whole category: only the declared keys remain available. Categories are listed on the Theme page.

bg:blue-700
.bg\:blue-700 {
  background-color: #1d4ed8;
}
c:teal-300
.c\:teal-300 {
  color: #5eead4;
}

Validation

An unknown key stops the build with an explicit message naming the key. Under theme, only extend and override are accepted.