1.7.2 • Published 2 years ago
@flatjs/forge-plugin-postcss-pixel v1.7.2
The flatjs plugin @flatjs/forge-plugin-postcss-pixel
Features
A plugin for PostCSS that generates rpx/rem units from px/rpx units
Installation
$ npm i --save @flatjs/forge-plugin-postcss-pixel
Usage
programing
import postcss from 'postcss';
import { writeFile, readFileSync } from 'fs';
import { forgePluginPostcssPixel } from '@flatjs/forge-plugin-postcss-pixel';
const css = readFileSync('/path/to/test.css', 'utf8');
const options = {
replace: false,
};
const processedCss = postcss(forgePluginPostcssPixel(options)).process(css).css;
writeFile('/path/to/test.rem.css', processedCss, err => {
if (err) throw err;
console.log('Rem file written.');
});
Using with @flatjs/forge
Please see samples of @flatjs/forge-plugin-styling
Defaults Configuration
const defaultOpts: Required<PixelOptions> = {
rootValue: { px: 100, rpx: 1 },
outputUnit: 'rem',
unitPrecision: 5,
selectorBlackList: [],
propWhiteList: [],
propBlackList: [],
replace: true,
mediaQuery: false,
minPixelValue: 0,
ignoreIdentifier: '',
exclude: null,
};
Reference
1.7.2
2 years ago
1.6.0
2 years ago
1.5.0
2 years ago
1.4.1
3 years ago
1.4.0
3 years ago
1.3.17
3 years ago
1.3.14
3 years ago
1.3.6
3 years ago
1.2.100
3 years ago
1.3.5
3 years ago
1.3.0
3 years ago
1.2.98
4 years ago
1.2.99
4 years ago
1.2.96
4 years ago
1.2.97
4 years ago
1.2.95
4 years ago
1.2.93
4 years ago
1.2.81
4 years ago
1.2.78
4 years ago
1.2.77
4 years ago
1.2.75
4 years ago
1.2.74
4 years ago
1.2.73
4 years ago
1.2.70
4 years ago
1.2.69
4 years ago
1.2.68
4 years ago
1.2.67
4 years ago
1.2.66
4 years ago
1.2.65
4 years ago