Loosie94 Loosie94 - 2 months ago 39
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:


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...


Answer Source

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


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