mkpaz / atlantafx

Modern JavaFX CSS theme collection with additional controls.
https://mkpaz.github.io/atlantafx
MIT License
791 stars 64 forks source link

Card elevated-n CSS bug? #95

Open credmond opened 4 months ago

credmond commented 4 months ago

There seems to be a bug with Card elevation CSS.

For example, the generated CSS (i.e., Card CSS in the JAR) is:

.card > .container.elevated-1 {
  -fx-effect: dropshadow(three-pass-box, -color-shadow-default, 2px, 0.5, 0, 2);
}

But setting an elevation style as documented, by doing something like:

 var card1 = new Card();
        card1.getStyleClass().add(Styles.ELEVATED_1);

... is obviously nothing going to work from that -- the "container" (a VBox inside the Card) does not have the "elevated-1" style applied, the Card itself does. So the CSS would need to be:

.card.elevated-1 > .container {
  -fx-effect: dropshadow(three-pass-box, -color-shadow-default, 2px, 0.5, 0, 2);
}

...for example. Am I missing something?

There is a global set of elevated-n styles, which are actually what get applied instead -- and probably why this has gone unnoticed, e.g.:

.elevated-2 {
  -fx-effect: dropshadow(three-pass-box, -color-shadow-default, 8px, 0.5, 0, 2);
}

Same issue applies for "interactive".