SASS selects custom mixer without import - compass

I am working on SASS with a compass. I already created some mixins, but still, there is one mixin, I can not get it to work. This is chosen by the user. I know that I can import it using @import "compass / css3 / user-interface"; but that is not the point. Why does my "handmade" @mixin user-select ($ value) {..} not seem to work? Is there any known reason?

@mixin user-select($value) {
  -webkit-user-select: $value; 
  -moz-user-select: $value; 
  -ms-user-select: $value; 
  -o-user-select: $value; 
  user-select: $value;    
}

.myclass {
  @include user-select(none);
}
+4
source share
1 answer

Everything seems to work just fine. You can try this approach:

@mixin user-select($select) {
  @each $pre in -webkit-, -moz-, -ms-, -o- {
    #{$pre + user-select}: #{$select};
  } 
  #{user-select}: #{$select};
}

.myclass {
  @include user-select(none);
}
+1
source

Source: https://habr.com/ru/post/1538553/


All Articles