Microsoft/vscode
Vedi su GitHubUse modern (CSS color level 4) syntax for colors in the color picker
Open
#139.840 aperta il 28 dic 2021
editor-color-pickerfeature-requesthelp wanted
Metriche repository
- Star
- (74.848 star)
- Metriche merge PR
- (Merge medio 11h 43m) (1000 PR mergiate in 30 g)
Descrizione
When converting colors using the color picker, the old comma-based syntax is used:
(it should also show hsl here, at the top of the picker, not rgba)
Please update the picker to use the modern (CSS color level 4) syntax for colors.
With regard to the exact syntax, I agree with these suggestions from @mathiasbynens:
- consider being opinionated w.r.t. how to represent alpha values. IMHO using percentage notation is most readable, as it clarifies the range: e.g. 70% vs 0.7
- consider being opinionated about using the deg suffix where applicable, e.g. in the first parameter for hsl() and the last non-alpha parameter for lch(). Again, because this clarifies that the range lies between 0-360.
i.e. Use percentages for alpha, and always include the deg suffix.
This also matches the syntax displayed in Chrome developer tools.