palexdev / MaterialFX

A library of material components for JavaFX
GNU Lesser General Public License v3.0
1.21k stars 122 forks source link

css fill-text not applied on MfxButton #55

Closed warmuuh closed 3 years ago

warmuuh commented 3 years ago

apparently, -fx-text-fill is not applied on a button-text: image

i used this code

public class Test extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {

        var root = vbox(); //simple VBox
        Scene mainScene = new Scene(root);

        mainScene.getStylesheets().clear();
        mainScene.getStylesheets().add("/mfx/light.css");

        root.add(new MFXButton("mfxButton"));
        root.add(new JFXButton("jfxButton"));
        root.add(new Button("plainButton"));

        primaryStage.setScene(mainScene);
        primaryStage.show();
    }
}

with this styling:

.button {
    -fx-text-fill: red;
    -fx-background-color: yellow;
}

manually setting via Button::setTextFill works though

palexdev commented 3 years ago

I think I know what is causing the issue Next week I will have way more free time, so I'm going to get back to work on MaterialFX

palexdev commented 3 years ago

New version released