Files
firefox/devtools/client/inspector
Nicolas Chevobbe 3a3ae50758 Bug 1915872 - [devtools] Make getColor rely on CSS variables computed values. r=devtools-reviewers,ochameau.
The function used to parse the variables.css file and do some regex matching
on the light/dark theme rules to extract the declaration value of a variable.

This patch makes the function simpler by getting the computed value of the
CSS variable, which automatically adapt to the current theme since we do set
`color-scheme` value properly when setting a theme.

In order for this to work properly, the variables that might be used in this
function need to be registered so the engine know they are colors.

We take this as an opportunity to rename the function to `getCssVariableColor`,
which is more explicit, and also make it take the actual CSS variable name,
and not only the suffix part that comes after `--theme-` for better grep-ability.

The test in browser_theme.js is adapted to reflect those changes.

Differential Revision: https://phabricator.services.mozilla.com/D220718
2024-09-03 15:00:54 +00:00
..
…
…