假设我有一个文件“_file1.scss”和“_file2.scss”。它们都有一个名为“my-mixin”的mixin。是否可以在“main.scss”文件中导入“_file1.scss”和“_file2.scss”并指出我想从哪个文件中使用mixin?
像“file1/my-mixin”这样的东西。
我遇到的问题是我正在使用 SUSY 和“compass/css3”,并且都有一个“columns”mixin。
https://sass-lang.com/documentation/at-rules/use
You can use the last part of the file path that you're importing as a namespace.
@use '_file1';
@use '_file2';
@include _file1.my-mixin;
or, you can add an alias yourself:
@use '_file1' as one;
@use '_file2' as two;
@include one.my-mixin;