Basics
Guides
API Reference
Basics
Guides
API Reference
CSSFX adds development-time stylesheet hot reload for JavaFX apps in Aussom
through the cssfx module. It watches the CSS files attached to your app and
reloads them when you save changes, which makes visual iteration much faster
than restarting the app after every tweak.
The wrapper is intentionally AJI-first. Aussom provides the common start and scoping helpers, while raw AJI remains available for advanced CSSFX features.
| Concept | Meaning |
|---|---|
cssfx.startMonitor() |
Starts global monitoring and returns a stop handle. |
cssfx.forStage(...) |
Limits monitoring to one stage. |
cssfx.forScene(...) |
Limits monitoring to one scene. |
cssfx.forNode(...) |
Limits monitoring to one node subtree. |
CssFxConfig |
Scoped configuration object used before calling startMonitor(). |
CssFxMonitor |
Stop handle returned by CSSFX start methods. |
addConverterCallback(...) |
Adds a custom URI-to-path converter for unusual stylesheet paths. |
Include the module alongside the JavaFX controls you are styling:
include fx;
include fx.Label;
include fx.VBox;
include cssfx;
Attach a real CSS file to your app first, then start CSSFX after the app is shown.
include fx;
include fx.Label;
include fx.VBox;
include cssfx;
app = fx.fxApp("CSSFX Demo", 420, 220);
label = new Label("Hot Reload");
label.setId("liveLabel");
root = new VBox();
root.add(label);
app.setLayout(root);
app.addStyleSheet("styles/app.css");
app.show(true);
monitor = cssfx.startMonitor();
fx.shutdown();
monitor.stop();
While the app is open, editing styles/app.css will trigger a stylesheet
reload.
This pattern is useful when CSSFX cannot map a stylesheet URI back to the file you want to watch.
include fx;
include fx.Label;
include fx.VBox;
include cssfx;
public convertCssUri(Uri) {
return cssfx.pathFromUri(Uri);
}
app = fx.fxApp("Scoped CSSFX", 420, 220);
label = new Label("Scoped");
label.setId("liveLabel");
root = new VBox();
root.add(label);
app.setLayout(root);
app.addStyleSheet("tests/cssfx-test.css");
app.show(true);
stage = app.getAjo();
scene = stage.invoke("getScene");
cfg = cssfx.forScene(scene);
cfg.noDefaultConverters();
cfg.addConverterCallback(::convertCssUri);
monitor = cfg.startMonitor();
fx.shutdown();
monitor.stop();
If only one scene subtree is actively being developed, you can scope monitoring to that node:
include fx;
include fx.Label;
include fx.VBox;
include cssfx;
app = fx.fxApp("Node CSSFX", 420, 220);
label = new Label("Node Scoped");
root = new VBox();
root.add(label);
app.setLayout(root);
app.addStyleSheet("styles/app.css");
app.show(true);
monitor = cssfx.forNode(label.obj).startMonitor();
fx.shutdown();
monitor.stop();
noDefaultConverters() plus addConverterCallback(...).CssFxMonitor if you want an explicit stop hook.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.