Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更少的css-我们可以使用更多与coma分离的变量吗_Css_Variables_Less - Fatal编程技术网

更少的css-我们可以使用更多与coma分离的变量吗

更少的css-我们可以使用更多与coma分离的变量吗,css,variables,less,Css,Variables,Less,像这样 @ShuttleGrey: #606369; 我需要从更多变量中获得相同的输出颜色值[我正在寻找单线解决方案] @themeOne:, @themeTwo:, @themeThree: @ShuttleGrey; 我知道我的代码是错误的,有人知道如何修复这种情况吗 谢谢假设您希望在许多地方应用相同的属性,您可以这样做 .aProperty{ color:#606369 } 然后,您可以这样做,将相同的属性添加到其他元素中 .anotherPrope

像这样

@ShuttleGrey:  #606369;
我需要从更多变量中获得相同的输出颜色值[我正在寻找单线解决方案]

@themeOne:, @themeTwo:, @themeThree:             @ShuttleGrey;
我知道我的代码是错误的,有人知道如何修复这种情况吗


谢谢

假设您希望在许多地方应用相同的属性,您可以这样做

.aProperty{
  color:#606369
 }
然后,您可以这样做,将相同的属性添加到其他元素中

 .anotherProperty{
   background:#000; //just like that
   .aProperty;
  }
.anotherProperty{
 background:#000; //just like that
 .aProperty;
 }
这样
。另一个属性
将继承
属性

这样,您甚至可以添加其他属性并在许多地方使用它们

 .aProperty{
  color:#606369
  }
然后,您可以这样做,将相同的属性添加到其他元素中

 .anotherProperty{
   background:#000; //just like that
   .aProperty;
  }
.anotherProperty{
 background:#000; //just like that
 .aProperty;
 }

由于没有答案被接受,我正在尝试我的运气:)

研究这个问题:你需要对许多组件应用相同的颜色值吗?@Shibin Ragh,请你接受一个答案,还是只是标记用户2072923的答案,他只是复制了所有内容复制答案没有帮助