Loosie94 Loosie94 - 9 months ago 99
Less Question

Easyer way to call mixin SASS instead of @include

I am currently using a mixing for rem font-sizes with a fallback to pixels in SASS, for responsive font sizes. I'm using this mixin:

@mixin font-size ($size) {
$remValue: $size / 16;
$pxValue: ($size);
font-size: $pxValue + px;
font-size: $remValue + rem;
}


Now i was wondering if there's a shorter way to call on this mixin.
Now i have to type:

@include font-size(20);


For a size of 20 pixels (1.25rem)

Witch is good, to set for a couple of font-sizes, but if i have to use it more than 30 times it's getting annoying...

Now i saw that LESS uses:

.font-size(20);


To do the same thing, witch is better but for now i need to use SASS.

Can i make this call shorter or do i still need to use @include?


I could not find a emmet shortcode for this...

Thanks!

Answer Source

No you can't, as you can see in SASS Docs

SS

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download