Microsoft/vscode
在 GitHub 查看Use modern (CSS color level 4) syntax for colors in the color picker
Open
#139,840 创建于 2021年12月28日
editor-color-pickerfeature-requesthelp wanted
仓库指标
- Star
- (74,848 star)
- PR 合并指标
- (平均合并 11小时 43分钟) (30 天内合并 1,000 个 PR)
描述
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.