Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8112304

CSS inheritance problem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • fx2.0
    • fx2.0
    • javafx
    • java.vendor=Sun Microsystems Inc.
      java.version=1.6.0_24
      java.vm.vendor=Sun Microsystems Inc.
      java.vm.version=19.1-b02
      os.name=Windows 7
      os.arch=x86
      os.version=6.1

      JavaFX 2.0ea b18

      I've this style sheet:

      .scene {
        /* My own color names */
        textcolor: darkgreen;
      }
      .label {
          -fx-text-fill: textcolor;
      }
      .styled-button {
          -fx-text-fill: white !important;
          -fx-font-size: 23;
      }

      but my button color is green, not white.

      Source code:

      package org.sepix.javafx.csstheming;

      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Label;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class SmallCSS extends Stage {
        String style = "/org/sepix/javafx/csstheming/styles/small.css";
        /*
         .scene {
            textcolor: darkgreen;
          }

         .label {
            -fx-text-fill: textcolor;

          }
          .styled-button {
            -fx-text-fill: white !important;
            -fx-font-size: 23;
          }

         */

        public SmallCSS() {
          VBox vbox = new VBox();
          
          Scene scene = new Scene (vbox);
          scene.getStylesheets().add (style);
          
          Label label = new Label("A Label");
          
          Button button = new Button("Button");
          button.getStyleClass().add("styled-button");
          
          vbox.getChildren().addAll(label, button);
          
          setScene(scene);
        }
      }

            dgrieve David Grieve
            arittnerjfx Aljoscha Rittner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: