npm.io
1.0.1 • Published 5 years ago

@taikonauten/postcss-function-rem

Licence
MIT
Version
1.0.1
Deps
0
Size
1 kB
Vulns
0
Weekly
0

Taikonauten postCSS function rem

 

Installation

npm install --save-dev @taikonauten/postcss-function-rem

Create a postcss.config.js file in your project root:

const postCSSFunctions = {
  functions: {
    rem: require('@taikonauten/postcss-function-rem'),
  }
};

module.exports = {
  plugins: [
    require('postcss-functions')(postCSSFunctions),
  ]
};

Usage

body {

  padding: rem(20 20);
}

Use default base font size of 16. result: padding: 1.25rem 1.25rem

body {

  padding: rem(20 20, 24);
}

Overwrite default base font size with 24. result: padding: 0.8333333333333334rem 0.8333333333333334rem


Made with ♡ at Taikonauten