jx_engine 0.2.1
jx_engine: ^0.2.1 copied to clipboard
JX CSS compilation engine: turns utility classes into mobile-first sorted CSS, on the server or in the browser.
jx_engine #
The JX CSS compilation engine: it turns a string of utility classes into CSS, sorted mobile-first. It runs on the Dart VM and in the browser.
This package is part of JX CSS (ZASPR Kit), a utility-first CSS framework written in Dart. To style an application, install
jx_cliinstead.
Installation #
dart pub add jx_engine
Usage #
import 'package:jx_engine/jx_engine.dart';
void main() {
final result = JxEngine().compile('p:4 md:p:8 hover:bg:blue-700 c:red!');
print(result.css); // generated stylesheet
print(result.ruleCount); // number of rules
print(result.warnings); // rejected classes, with suggestions
}
Supported variants are exposed by JxVariantResolver: defaultBreakpoints, defaultPseudoClasses, defaultPseudoElements and defaultMediaVariants (dark, motion-safe, motion-reduce, print…), plus the relational group-* and peer-* variants.
The JX CSS family #
| Package | Role |
|---|---|
jx_cli |
Command line: jx init, jx build. Entry point for most projects. |
jx_engine |
Compilation engine, 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.