1.0.33 • Published 4 years ago

@alexsvg/postcss-pxrem v1.0.33

Weekly downloads
5
License
SEE LICENSE IN LI...
Repository
github
Last release
4 years ago

PostCSS pxrem

Converts px to rem based on baseFontSize setting.

Installation this:

npm install @alexsvg/postcss-pxrem

Usage this:

In webpack.config.js if you use stylus:

const poststylus = require('poststylus'),
      pxr = require('@alexsvg/postcss-pxrem')
{
    rules: {
        test: /\.styl(us)?$/,
        use: [
            {
                loader: 'stylus-loader',
                options: {
                    use: [
                        poststylus([
                            pxr({ baseFontSize: 18 })
                        ])
                    ],
                }
            },
        ]
    }
}

Input code:

html, body {
    font-size 18px
}
.style {
    font-size 54pxr
    margin 18pxr 18pxr
}

Output code:

html, body {
    font-size: 18px;
}
.style {
    font-size: 3rem;
    margin: 1rem 1rem;
}
1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago