0

Suppose I have a file "_file1.scss" and "_file2.scss". Both of them have a mixin with the same name "my-mixin". Is it possible in "main.scss" file to import "_file1.scss" and "_file2.scss" and indicate from which file I want to use the mixin?

Something like "file1/my-mixin".

The problem that I have is I'm using SUSY and "compass/css3" and both have a "columns" mixin.

SBel
  • 3,315
  • 6
  • 29
  • 47
  • I cannot find a reference for any mixin named "columns" in the Susy documentation, are you sure there is supposed to be one? – cimmanon Dec 30 '14 at 18:02
  • I guess that I'm using an old version of Susy. I'll look into upgrading it, hopefully no other conflicts will occur in the future. – SBel Dec 30 '14 at 19:16
  • possible duplicate of [How to pick the method to call when there is mixin method name conflict?](http://stackoverflow.com/questions/9102050/how-to-pick-the-method-to-call-when-there-is-mixin-method-name-conflict) – Paul Sweatte Jul 24 '15 at 01:05

1 Answers1

0

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;
nickf
  • 537,072
  • 198
  • 649
  • 721