Closed Bug 1908692 Opened 3 months ago Closed 1 month ago

moz-button hover/active states have no visual effect in chrome

Categories

(Toolkit :: UI Widgets, defect, P2)

defect

Tracking

()

VERIFIED FIXED
132 Branch
Tracking Status
firefox132 --- verified

People

(Reporter: jsudiaman, Assigned: mstriemer)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-sidebar])

Attachments

(1 file)

This is reproducible in the revamped sidebar on Nightly.

Steps to Reproduce

  1. Enable the sidebar.revamp pref and restart Firefox if necessary.
  2. Open any of the sidebar "tools," e.g., Tabs from other devices, History, Customize sidebar.
  3. Hover over the close button on the sidebar panel (which uses a <moz-button>).
  4. Click and hold the button.

Expected Result
Hover and active states are shown respectively.

Actual Result
No visual effect is shown. (Works fine in-content, though.)

This is due to bug 1835869. Fixing that should fix this, I've added some comments there for what I think the ideal solution is.

Since the sidebar is using platform colours, these tokens are currently expecting that they will defer to --button-bgcolor and friends which get set in browser-custom-colors.css (and somewhere else for Linux, browser.css?). A temporary fix could be to duplicate the brand value as a fallback for when that variable isn't defined

   "button": {
     "background": {
       "color": {
         "@base": {
           "comment": "TODO Bug 1821203 - Gray use needs to be consolidated",
           "value": {
             "forcedColors": "ButtonFace",
             "brand": {
               "default": "color-mix(in srgb, currentColor 7%, transparent)"
             },
             "platform": {
-              "default": "var(--button-bgcolor)"
+              "default": "var(--button-bgcolor, color-mix(in srgb, currentColor 7%, transparent))"
             }
           }
         },
Depends on: 1835869
Severity: -- → S3
Priority: -- → P2
Whiteboard: [fidefe-sidebar]

I'm only seeing this issue in Nightly for system theme (on mac), and applying a fallback in the design-tokens.json file doesn't fix this.

"hover": {
          "value": {
            "forcedColors": "SelectedItemText",
            "brand": {
              "default": "color-mix(in srgb, currentColor 14%, transparent)"
            },
            "platform": {
              "default": "var(--button-hover-bgcolor, color-mix(in srgb, currentColor 7%, transparent))"
            }
          }
        },
        "active": {
          "value": {
            "forcedColors": "SelectedItemText",
            "brand": {
              "default": "color-mix(in srgb, currentColor 21%, transparent)"
            },
            "platform": {
              "default": "var(--button-active-bgcolor, color-mix(in srgb, currentColor 7%, transparent))"
            }
          }

Am I missing something Mark?

Flags: needinfo?(mstriemer)

This should fix the close buttons in the sidebar panes when using the
system theme in light mode.

Ideally the theming code would update the design tokens when it makes
sense based on the theme, rather than having the tokens depend on the
these CSS vars. That is tracked in bug 1835869.

Assignee: nobody → mstriemer
Status: NEW → ASSIGNED
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e85f5925b4e3 Provide a chrome fallback when --button-*-bgcolor vars aren't set r=sidebar-reviewers,reusable-components-reviewers,desktop-theme-reviewers,dao,nsharpley,hjones
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

Thanks Mark!

Blocks: 1835869
No longer depends on: 1835869
Blocks: 1917588
Blocks: 1918317

That JSON update looks correct, you may have needed to run ./mach buildtokens to get it to update the .css files?

Flags: needinfo?(mstriemer)

I was able to reproduce the issue on an affected Nightly 131.0a1 build from 2024-08-20, using Windows 11 and System theme/Firefox Alpenglow theme set in about:addons, while following the steps from Comment 0.
Verified as fixed on Firefox 132.0b5, using macOS 14.7, Windows 11 and Ubuntu 22.04. The buttons have a hover/active visual effect.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: