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

CSS style for -fx-text-fill not applied, but style for -fx-background-color works

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • 7u6
    • fx2.1
    • javafx
    • JavaFX 2.1b19

    Description

      I have this CSS style:

      .menu-scroll-box .button {
        -fx-content-display: top;
        -fx-text-fill: red;
        -fx-font-size: 24pt;
        -fx-background-color: transparent;
      }

      .menu-scroll-box .button .focused {
        -fx-background-color: radial-gradient(radius 150%, color-blue-20, color-blue-10, color-blue-20);
        -fx-text-fill: white;
      }

      Now, the button that has the focus has the "focused" style applied to it.

      However, only the radial-gradient is applied, the -fx-text-fill does not get applied and the text remains red, despite there being a more specific CSS that applies. The Button itself has no other styles applied to it other than the standard "button" and the "focused" style.

      The same CSS works as expected when using the :focused psuedo-class, but fails when using the .focused style.

      See issues RT-21075 and RT-5006 for why I might want to not use the psuedo-class.

      Attachments

        Activity

          People

            dgrieve David Grieve
            jhendrikx John Hendrikx
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: