Closed
Bug 2047863
Opened 2 months ago
Closed 2 months ago
Don't show contrast information for base color in alpha()
Categories
(DevTools :: Inspector: Rules, defect, P2)
DevTools
Inspector: Rules
Tracking
(firefox154 fixed)
RESOLVED
FIXED
154 Branch
| Tracking | Status | |
|---|---|---|
| firefox154 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
Details
Attachments
(2 files)
Steps to reproduce
- With
layout.css.alpha-color-function.enabledset to true (should already be the case on Nightly) - Open the attached test case
- Inspect the
<h1>element - In the
colordeclaration of theh1rule, click on the color swatch after thefromkeyword (beforevar(--mycolor))
Actual results
Contrast information are displayed in the color picker, but that's not what is used for the final color, so it could be confusing.
We should do like we did for other color functions in https://searchfox.org/firefox-main/rev/ccf89bb4e01e2a64f86cce9a39757535df9a693d/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js#103-115,157-161
static COLOR_MODIFYING_FUNCTIONS = new Set([
"color-mix",
"contrast-color",
// color functions can take a relative color after `from`
"color",
"hsl",
"hwb",
"lab",
"lch",
"oklab",
"oklch",
"rgb",
]);
...
// Only enable contrast if the type of property is color
// and its value isn't inside a color-modifying function (e.g. color-mix()).
this.spectrum.contrastEnabled =
name === "color" &&
!SwatchColorPickerTooltip.COLOR_MODIFYING_FUNCTIONS.has(colorFunction);
| Assignee | ||
Comment 1•2 months ago
|
||
Updated•2 months ago
|
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Updated•2 months ago
|
Severity: -- → S3
Priority: -- → P2
Pushed by nchevobbe@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/093870551502
https://hg.mozilla.org/integration/autoland/rev/ce7be0cbf149
[devtools] Don't display contrast information in color tooltip for relative color in alpha(). r=devtools-reviewers,ochameau.
Comment 3•2 months ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
status-firefox154:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
Comment 4•2 months ago
|
||
| bugherder | ||
Updated•23 days ago
|
QA Whiteboard: [qa-triage-done-c155/b154]
You need to log in
before you can comment on or make changes to this bug.
Description
•