使用SCSS将RGB转换为RGBA,并分配给CSS属性

问题描述 投票:0回答:1
.test1 { --foo: rgba(#f00, .5); } // .test1 { --foo: rgba(#f00, .5) }

$col: rgba(#f00, .5); .test2 { --foo: $col; } // .test2 { --foo: $col }

怎么做?

您正在寻找相对颜色

body { --foo: rgb(from #f00 r g b / .5); background: var(--foo) }
css sass
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.