Answer the question
In order to leave comments, you need to log in
Why is the em() function not working in sass?
Hello, I write a line like this: font-size: em(20px)
I get the same output. Tell me what I'm doing wrong or maybe something is not connected?
Otherwise, sass works, the code compiles.
Thanks in advance to all who respond
Answer the question
In order to leave comments, you need to log in
Because you need to write a mixin:
$browser-context: 16; // Default
@function em($pixels, $context: $browser-context) {
@return #{$pixels/$context}em;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question