Skip to content

CSS compatibility issues with AtlantaFX - docking indicators invisible due to ClassCastException: String cannot be cast to Paint #6

Description

When using SnapFX 0.8.0 in a JavaFX 25 application that applies the AtlantaFX theme (Application.setUserAgentStylesheet(...)), the docking drag‑and‑drop visual indicators (ghost overlays, drop zone highlights) do not appear. The console shows repeated CSS warnings:

Jul 14, 2026 12:42:42 PM javafx.scene.CssStyleHelper calculateValue WARNING: Caught 'java.lang.ClassCastException: class java.lang.String cannot be cast to class javafx.scene.paint.Paint (java.lang.String is in module java.base of loader 'bootstrap'; javafx.scene.paint.Paint is in module javafx.graphics@25 of loader 'app')' while converting value for '-fx-background-color' from rule '*.dock-split-pane' in stylesheet jar:file:///C:/Users/Hp/.m2/repository/org/snapfx/snapfx-core/0.8.0/snapfx-core-0.8.0.jar!/snapfx.css

These originate from snapfx.css and occur when JavaFX attempts to resolve Modena‑specific CSS variables (e.g., -fx-text-base-color, -fx-background, -fx-base) that are not defined in AtlantaFX.

The issue does not occur when using the default Modena stylesheet; in that case the warnings vanish and docking indicators function as expected.

Steps to Reproduce

  1. Create a new JavaFX 25 project.
  2. Add the AtlantaFX dependency (e.g., io.github.typhon0:AtlantaFX:...).
  3. Apply the AtlantaFX theme at application startup:
  4. Application.setUserAgentStylesheet("path/theme.css");
  5. Initialize SnapFX, register some DockNodes, and build a layout.
  6. Attempt to drag a dockable panel.
  7. Observe that no drop zone preview (blue overlay, ghost, or target highlighting) appears, and the CSS warning is printed to the console.

Environment

SnapFX version: 0.8.0
Java version: 26
JavaFX version: 25
OS: Windows 10
Theme: AtlantaFX (2.0.1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions