在材料主题中有这样的代码:
$md-indigo: (
50: #e8eaf6,
100: #c5cae9,
200: #9fa8da,
300: #7986cb,
400: #5c6bc0,
500: #3f51b5,
...
)
和
.text-overflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
如何在其他文件中我可以使用这个变量(跳过导入规则)?
例如:
.someclass {
color: $md-indigo-500;
.text-overflow();
}
答案 0 :(得分:1)
您可以在.text-overflow
中使用.someclass
作为
.someclass {
color: $md-indigo-500;
@extend .text-overflow;
}