moz-button hover/active states have no visual effect in chrome
Categories
(Toolkit :: UI Widgets, defect, P2)
Tracking
()
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
- Enable the
sidebar.revamp
pref and restart Firefox if necessary. - Open any of the sidebar "tools," e.g., Tabs from other devices, History, Customize sidebar.
- Hover over the close button on the sidebar panel (which uses a
<moz-button>
). - 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.)
Assignee | ||
Comment 1•3 months ago
|
||
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))"
}
}
},
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 2•1 month ago
•
|
||
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?
Assignee | ||
Comment 3•1 month ago
|
||
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.
Updated•1 month ago
|
Comment 5•1 month ago
|
||
bugherder |
Comment 6•1 month ago
|
||
Thanks Mark!
Updated•1 month ago
|
Assignee | ||
Comment 7•28 days ago
|
||
That JSON update looks correct, you may have needed to run ./mach buildtokens
to get it to update the .css files?
Updated•9 days ago
|
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.
Description
•