Show a color swatch next to CSS variable definitions that have color values
Categories
(DevTools :: Inspector: Rules, enhancement, P3)
Tracking
(firefox71 fixed)
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: pbro, Assigned: daisuke, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed, Whiteboard: [dt-q])
Attachments
(2 files)
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Reporter | ||
Comment 2•7 years ago
|
||
Updated•7 years ago
|
Comment 3•7 years ago
|
||
Updated•7 years ago
|
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Reporter | ||
Comment 7•6 years ago
|
||
Unassigning this bug since it has received no activity over the past 8 months.
Feel free to pick it up again if you did intend to work on it still.
Just trying to clean our backlog of bugs so they are available to people.
hi, i am interested in solving it. will u please assign it to me??
Reporter | ||
Comment 9•6 years ago
|
||
Hi, thanks for your interest. Yes I'll assign it to you now.
Make sure to go through our contribution documentation first: https://docs.firefox-dev.tools to set up your dev environment and know how to make and test changes in the code.
Once done, please take a look at comment 2, I believe that even if it's 8 months old, it still applies, and should give you a good idea on how to get started.
You can then also take a look at comment 4 where Chris shared some details regarding how to write a test for this.
You might also be interested in our documentation about tests: https://docs.firefox-dev.tools/tests/writing-tests.html
Comment 10•6 years ago
|
||
This is done with the boolean options.supportsColor which is, for now, only
set to true when we know the property accepts colors or gradients.
The approach I have in mind is to set this boolean to true also when the
property is a custom property (i.e. it starts with --).
hi, trying this approach i found out that there hasn't been an custom property hasn't been defined in the
devtools/shared/css/constants.js file. so do i manually change the contents of this file by adding a custom property, or am i missing something. please help.
i am sorry if the question isn't clear or sounds childish, i am really new to firefox development and am trying to learn
Reporter | ||
Comment 11•6 years ago
•
|
||
(In reply to asish7295 from comment #10)
hi, trying this approach i found out that there hasn't been an custom property hasn't been defined in the
devtools/shared/css/constants.js file. so do i manually change the contents of this file by adding a custom property, or am i missing something. please help.
I don't think it's necessary to add anything in the constants.js file for this. CSS custom properties always start with --
, so it might be enough to simply check if the name
variable starts with these --
character. And if so, set the options.supportsColor
to true.
i am sorry if the question isn't clear or sounds childish, i am really new to firefox development and am trying to learn
Oh, don't worry at all about asking questions, no matter if they may sound childish, stupid, whatever, or even if they have been asked before. There is no stupid questions. A question means that something isn't clear, and it's always always valid to clarify things for people, so people can go ahead and do the change they intended to do.
Comment 12•6 years ago
|
||
while trying to write the tests for this , i found that there was a function in the devtools/client/shared/test/browser_outputparser.js file which has a function testParseCssProperty which has a tests array where it makes use of makeColorTest function . so maybe we can do something like :
makeColorTest("--someproperty" , "blue" , {name : "blue"}) and add it to the tests array
is this the right approach being taken or am i missing something
Reporter | ||
Comment 13•6 years ago
|
||
Yes I think this is the right approach!
Reporter | ||
Comment 14•6 years ago
|
||
Hi Asish. Do you need more time to work on this bug? If so, that's totally ok.
If you, however, don't plan on working on it anymore, please let me know so I can make it available for others to pick up.
Reporter | ||
Comment 15•6 years ago
|
||
Making this bug unassigned again.
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Comment 17•6 years ago
|
||
Depends on D44943
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/25dba9986075
https://hg.mozilla.org/mozilla-central/rev/deeb30ce64e9
Updated•6 years ago
|
Updated•6 years ago
|
Description
•