I'm working on SASS with compass. I've already created some mixins but still, there is one mixin I can't make it to work. That's the user-select one. I know I can import it using @import "compass/css3/user-interface"; but that's not the point. Why my 'handmade' @mixin user-select($value){..} does 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);
}
Seems to work fine for me.. 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);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With