Closed Bug 1718894 Opened 4 years ago Closed 9 months ago

Color picker is not displayed when CSS custom property is used in colour definition

Categories

(DevTools :: Inspector: Rules, defect, P3)

Firefox 89
defect

Tracking

(firefox126 fixed)

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: lwarlow, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached image Actual results.png

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4557.4 Safari/537.36

Steps to reproduce:

Steps to reproduce the problem:

  1. Go to https://jsfiddle.net/qz3206rf/3/
  2. Inspect the red text

Actual results:

No colour picker is displayed.

Expected results:

It would be nice if dev tools could display the colour picker for colour definitions (color, background-color etc) that make use of a CSS custom property.

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Component: CSS Parsing and Computation → Style Editor
Product: Core → DevTools

Visible in data:text/html,<meta charset=utf8><style>body { --alpha: 1;%20 background: rgba(100, 0, 100, var(--alpha)) }</style>hello
The body background value does not have the color swatch

Blocks: 1223058
Type: enhancement → defect
Component: Style Editor → Inspector: Rules
Summary: Display colour picker when CSS custom property is used in colour definition → Color picker is not displayed when CSS custom property is used in colour definition

Since we resolve variables on the client at the moment, we might still have cases where we can't resolve the value at the moment. But as long as we have a value for the color we should show the color swatch.

In case the value gets modified by the color picker, we will just override the whole value and won't try to preserve the usage of the variable in the property definition.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Just as an fyi this is now supported in chromium.

This should show the color swatch for case like rgb(var(--r), 0, var(--b)).

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9d21544852f8 [devtools] Display swatches for functions with css variables. r=devtools-reviewers,bomsy.
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
QA Whiteboard: [qa-126b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: