You probably don't mean to use the color value red in interpolation here.


在scss文件中定义了变量,但是使用时报错

$colors: (
        white: #ffffff,
        black: #000000,
        red: (
           500: #ef4444,
           600: #dc2626,
        ),
);
WARNING: You probably don't mean to use the color value red in interpolation here.
It may end up represented as red, which will likely produce invalid CSS.
Always quote color names when using them as strings or map keys (for example, "red").
If you really want to use the color value here, use '"" + $name'.

 

解决方式:在键名上增加引号

$colors: (
        'white': #ffffff,
        'black': #000000,
        'red': (
           '500': #ef4444,
           '600': #dc2626,
        ),
);
发布时间 : 2025-09-17,阅读量:1
本文链接:https://upwqy.com/index.php/details/1007.html
tsconfig.json tsconfig.app.json tsconfig.node.json 有什么区别