Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Latest commit

 

History

History
89 lines (62 loc) · 1.61 KB

README.md

File metadata and controls

89 lines (62 loc) · 1.61 KB

Sass Em

Version Download License

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.

Introduction

Sass function & mixin to generate em value.

Install

npm install @sass-collective/sass-em --save

Usage

Function

em($values, $context);

Mixin

em($property, $values, $context);

Module System

@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);
}

Legacy @import

@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);
}

CSS

html,
body {
    font-size: 1em;
    margin: 1.25em 1.875em;
}