简体   繁体   English

如何在scss中使用rgb颜色?

[英]How to use rgb color in scss?

I'm using sccs.我正在使用 scc。 But when I use rgb/rgba color, then showing error.但是当我使用 rgb/rgba 颜色时,则显示错误。 Otherwise It's work very well.否则它的工作非常好。

Error message:错误信息:

在此处输入图片说明

If I use this, It's working.如果我使用它,它的工作。

$color: #f5325c;

.class-name {
    background-color: $color; 
 }

But If I use this, showing error:但是如果我使用这个,显示错误:

$color:rgba(15,34,58,.12);

.class-name {
    background-color: $color;
}

Please help!请帮忙!

Thanks!谢谢!

I found that there is an issue with your scssphp compiler.我发现您的 scssphp 编译器存在问题。 It is not supporting the rgba value.它不支持 rgba 值。 Please see the thread.请看线程。 https://github.com/octobercms/october/issues/5058 https://github.com/octobercms/october/issues/5058

I don't really see a problem here in your scss code.我在您的 scss 代码中并没有真正看到问题。
you can even use css variables if you want.如果需要,您甚至可以使用 css 变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM