jx_builder 0.0.1
jx_builder: ^0.0.1 copied to clipboard
build_runner integration for JX CSS: jaspr serve and jaspr build generate web/jx.css automatically, with no extra command.
jx_builder #
build_runner integration for JX CSS (ZASPR Kit), the utility-first CSS framework written in Dart and built for Jaspr.
With jx_builder in your dev dependencies, jaspr serve and jaspr build generate web/jx.css by themselves. There is no jx build step to run or to forget, and the stylesheet is rebuilt every time you save a file.
Installation #
dart pub add dev:jx_builder
Link the stylesheet in your Document:
Document(
head: [link(rel: 'stylesheet', href: '/jx.css')],
body: App(),
)
Then run Jaspr as usual:
jaspr serve
Configuration #
The builder reads jx.yaml like the CLI does: content, extensions, exclude, packages, minify, reset, dark_mode and theme. The output key is ignored: the stylesheet is always served at /jx.css.
# jx.yaml
content: [lib]
extensions: [dart]
dark_mode: media
theme:
extend:
colors:
brand: '#3B6CF0'
jx.yaml is read when the build starts. To have changes picked up while jaspr serve is running, add it to the build sources:
# build.yaml
targets:
$default:
sources:
include:
- $package$
- lib/**
- web/**
- jx.yaml
- pubspec.yaml
To minify only in release builds (jaspr build):
# build.yaml
targets:
$default:
builders:
jx_builder:jx_css:
release_options:
minify: true
Migrating from jx build #
The CSS is now a generated build asset, so delete the web/jx.css written by the CLI (build_runner refuses to overwrite a source file), and remove jx build from your scripts.
The JX CSS family #
| Package | Role |
|---|---|
jx_cli |
Command line: jx init, jx build, jx migrate. |
jx_builder |
build_runner integration: CSS generated by jaspr serve and jaspr build. |
jx_ui |
Ready-made Jaspr components styled with JX. |
jx_engine |
Compilation engine and Tailwind converter, usable as a library. |
jx_rules |
Utility catalog and rule registry. |
jx_theme |
Design tokens and default theme. |
jx_parser |
Class syntax parser. |
jx_generator |
CSS serialization and preflight. |
jx_core |
Shared models, contracts and exceptions. |
Documentation: https://nathanaelzie.github.io/zaspr-kit/
License #
MIT.