From fee47f6414cc3ae9a88f3ee0ed20f1d6f2d9f556 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:58:02 +0800 Subject: added plugin from postcss: postcss-fixes rucksack-css --- node_modules/postcss-unopacity/README.md | 187 +++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 node_modules/postcss-unopacity/README.md (limited to 'node_modules/postcss-unopacity/README.md') diff --git a/node_modules/postcss-unopacity/README.md b/node_modules/postcss-unopacity/README.md new file mode 100644 index 00000000..16c7ca21 --- /dev/null +++ b/node_modules/postcss-unopacity/README.md @@ -0,0 +1,187 @@ +# UnOpacity [![Build Status][ci-img]][ci] + + + +[UnOpacity] replaces the `opacity` property with a `filter` property. This can be useful for outputting CSS for older browsers like Internet Explorer 8. + +```css +/* before */ + +.figure { + opacity: .5; +} + +/* after */ + +.figure { + filter: alpha(opacity=50); +} +``` + +## Usage + +Add [UnOpacity] to your build tool: + +```bash +npm install postcss-unopacity --save-dev +``` + +#### Node + +```js +require('postcss-unopacity')({ /* options */ }).process(YOUR_CSS); +``` + +#### PostCSS + +Add [PostCSS] to your build tool: + +```bash +npm install postcss --save-dev +``` + +Load [UnOpacity] as a PostCSS plugin: + +```js +postcss([ + require('postcss-unopacity')({ /* options */ }) +]); +``` + +#### Gulp + +Add [Gulp PostCSS] to your build tool: + +```bash +npm install gulp-postcss --save-dev +``` + +Enable [UnOpacity] within your Gulpfile: + +```js +var postcss = require('gulp-postcss'); + +gulp.task('css', function () { + return gulp.src('./css/src/*.css').pipe( + postcss([ + require('postcss-unopacity')({ /* options */ }) + ]) + ).pipe( + gulp.dest('./css') + ); +}); +``` + +#### Grunt + +Add [Grunt PostCSS] to your build tool: + +```bash +npm install grunt-postcss --save-dev +``` + +Enable [UnOpacity] within your Gruntfile: + +```js +grunt.loadNpmTasks('grunt-postcss'); + +grunt.initConfig({ + postcss: { + options: { + processors: [ + require('postcss-unopacity')({ /* options */ }) + ] + }, + dist: { + src: 'css/*.css' + } + } +}); +``` + +### Options + +#### `method` + +Type: `String` +Default: `'replace'` + +##### `replace` +Replace any `opacity` property with a fallback. +```css +/* before */ + +.figure { + opacity: .5; +} + +/* after */ + +.figure { + filter: alpha(opacity=50); +} +``` + +##### `copy` +Copy any `opacity` property with a fallback. +```css +/* before */ + +.figure { + opacity: .5; +} + +/* after */ + +.figure { + filter: alpha(opacity=50); + opacity: .5; +} +``` + +##### `warn` +Warn when an `opacity` property is used. + +#### `prefixed` + +Type: `Boolean` +Default: `false` + +##### `true` +Use an `-ms-filter` property as a fallback. +```css +/* before */ + +.figure { + opacity: .5; +} + +/* after */ + +.figure { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; +} +``` + +##### `false` +Use a `filter` property as a fallback. +```css +/* before */ + +.figure { + opacity: .5; +} + +/* after */ + +.figure { + filter: alpha(opacity=50); +} +``` + +[ci]: https://travis-ci.org/jonathantneal/postcss-unopacity +[ci-img]: https://travis-ci.org/jonathantneal/postcss-unopacity.svg +[Gulp PostCSS]: https://github.com/postcss/gulp-postcss +[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss +[PostCSS]: https://github.com/postcss/postcss +[UnOpacity]: https://github.com/jonathantneal/postcss-unopacity -- cgit v1.2.3