You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
mahdi 0cb8d673d7 update 2 years ago
..
LICENSE.md update 2 years ago
README.md update 2 years ago
index.js update 2 years ago
package.json update 2 years ago

README.md

PostCSS Opacity Percentage

Test Coverage Status Install size XO code style MIT license

PostCSS plugin to transform percentage-based opacity values to more compatible floating-point values.

Install

Using npm:

npm install --save-dev postcss postcss-opacity-percentage

Using yarn:

yarn add --dev postcss postcss-opacity-percentage

Example

/* Input */
.foo {
  opacity: 45%;
}
/* Output */
.foo {
  opacity: 0.45;
}

Usage

postcss([
  require('postcss-opacity-percentage'),
]);

See PostCSS documentation for examples for your environment.

Options

preserve

The preserve option determines whether the original percentage value is preserved. By default, it is not preserved.

// Keep the original notation
postcss([
  require('postcss-opacity-percentage')({preserve: true}),
]);
/* Input */
.foo {
  opacity: 45%;
}
/* Output */
.foo {
  opacity: 0.45;
  opacity: 45%;
}

License

MIT © Marc Görtz