https://github.com/digitaledgeit/sass-ems
A SASS function for converting px to em.
https://github.com/digitaledgeit/sass-ems
Last synced: about 1 year ago
JSON representation
A SASS function for converting px to em.
- Host: GitHub
- URL: https://github.com/digitaledgeit/sass-ems
- Owner: digitaledgeit
- Created: 2015-08-20T13:43:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-07-14T20:35:59.000Z (almost 4 years ago)
- Last Synced: 2025-02-23T19:19:34.787Z (over 1 year ago)
- Language: CSS
- Homepage:
- Size: 113 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sass-ems
A SASS function for converting `px` to `em`.
## Installation
npm install --save sass-ems
## Usage
$ sass-composer example/example.scss -o compiled.css
SCSS: `example/settings.scss`
//this is the default setting if not specified by the user
$base-font-size: 16px;
SCSS: `example/example.scss`
@import "./settings";
@import "sass-ems";
h1 {
padding: em(15px);
font-size: em(24px);
}
CSS: `compiled.css`
h1 {
padding: 0.9375em;
font-size: 1.5em; }
## API
### em($val, $ctx: $base-font-size)
Convert a `px` value to `em`.
## License
The MIT License (MIT)
Copyright (c) 2015 James Newell