Im playing around SASS for now and been loving mixins. And Ive been experiencing writing media queries and feature queries a lot. And i just thought if i could make the code more readable. Ive been googling, and but i think it isn’t possible. Am I right?
So I’ve tried these:
- returning as a function
sass
@function grid-support($mixin)
@return #{
@supports(display: grid)
$mixin
}
@some-mixin()
body
display: grid
grid-support(@include some-mixin())
//syntax error
- as a mixin
sass
@mixin grid-support($mixin)
#{
@supports (display: grid)
@include $mixin
}
@some-mixin()
body
display: grid
@include grid-support(some-mixin())
//wrong again
Thank you in advance for sharing your thoughts about this.