过去几个月我一直在处理同样的问题。我用谷歌搜索了同样的问题,但我想以前没有人解决过这个问题。
以前当我更改十六进制颜色透明度时,例如#FFFFFF,Chrome devtools 给了我 RGBA 版本的选项,如 RGBA(255,255,255,10%) 但是现在当我做同样的事情时,结果是 10% 的白色透明度 is RGB(255 255 255/10%)
如您所见,RGBA 现在消失了,并且 devtool onşy 显示了 rgb 类型的奇怪版本。
有没有人以前发布过同样的问题?你知道如何修复它吗?
最佳答案
这是 an intentional change in DevTools .基于逗号的语法就是规范现在所说的“遗留语法”。
见 https://twitter.com/mathias/status/1253242715304857601 :
💡 In source code, stop using the old
rgb()
/hsl()
CSS color syntax with commas.Get used to the modern comma-free CSS color syntax, supported in all modern browsers.
Why? Upcoming new features such as
lab()
,lch()
, andcolor()
use the same syntax (and don’t work with commas).
规范:https://drafts.csswg.org/css-color/#rgb-functions
[…] for legacy reasons, an
rgba()
function also exists, with an identical grammar and behavior torgb()
.
关于google-chrome - Google Chrome Devtool RGBA 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64280376/