soldier soldier - 1 year ago 155
Sass (Sass) Question

Sass mixin variable inside proprieties

I was using mixin proprieties in SASS an i was wondering if there were a way to use variables inside mixins.
Here's a very simply example

overflow-$axe: $show

@mixin overflow($axe,$show){
overflow-$axe: $show;

Thanks to all for further answers :)

Answer Source

Yes, it is possible and called interpolation:

@mixin overflow($axe,$show){
    overflow-#{$axe}: $show;

body {
    @include overflow('x', 'hidden');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download