DEPRECATED: this package has been moved to new reference in Sass Collective monorepo
@sass-collective/em
, use this package because the current repository is no more maintained.
Sass function & mixin to generate em value.
npm install @sass-collective/sass-em --save
em($values, $context);
em($property, $values, $context);
@use "@sass-collective/sass-em";
// Function
html,
body {
// Single value
font-size: sass-em.em(16, 16);
// Multiple values
margin: sass-em.em(20 30, 16);
}
// Mixin
html,
body {
// Single value
@include sass-em.em(font-size, 16, 16);
// Multiple values
@include sass-em.em(margin, 20 30, 16);
}
@import "@sass-collective/sass-em";
// Function
html,
body {
font-size: sass-em(16, 16);
margin: sass-em(20 30, 16);
}
// Mixin
html,
body {
@include sass-em(font-size, 16, 16);
@include sass-em(margin, 20 30, 16);
}
html,
body {
font-size: 1em;
margin: 1.25em 1.875em;
}