1.7.2 • Published 11 months ago

@flatjs/forge-plugin-postcss-pixel v1.7.2

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

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

11 months ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.17

2 years ago

1.3.14

2 years ago

1.3.6

2 years ago

1.2.100

2 years ago

1.3.5

2 years ago

1.3.0

2 years ago

1.2.98

2 years ago

1.2.99

2 years ago

1.2.96

2 years ago

1.2.97

2 years ago

1.2.95

2 years ago

1.2.93

3 years ago

1.2.81

3 years ago

1.2.78

3 years ago

1.2.77

3 years ago

1.2.75

3 years ago

1.2.74

3 years ago

1.2.73

3 years ago

1.2.70

3 years ago

1.2.69

3 years ago

1.2.68

3 years ago

1.2.67

3 years ago

1.2.66

3 years ago

1.2.65

3 years ago