Skip to content

Theming

PrinceOfCookies edited this page Jun 5, 2026 · 1 revision

Default Theme

DervaFX currently ships with a single built-in stylesheet:

  • /com/princeofcookies/dervafx/dervafx-dark.css

Applying a Theme

Scene scene = new Scene(host, 900, 600);
DervaFX.applyTheme(scene);

Selecting a Theme

DervaFX.setTheme(DervaTheme.dark());

Custom Theme Resource

You can point a DervaTheme at a different stylesheet resource:

DervaTheme custom = DervaTheme.of("custom")
    .stylesheetResource("/com/example/my-theme.css");

DervaFX.setTheme(custom);

Important Behavior

  • Themes are scene-level stylesheet attachments.
  • DervaThemeManager tracks scenes and reapplies the current stylesheet when the theme changes.
  • If a stylesheet resource cannot be found, DervaFX throws an IllegalStateException.

Clone this wiki locally