{"id":19653048,"url":"https://github.com/csstools/postcss-unopacity","last_synced_at":"2025-04-28T17:31:21.067Z","repository":{"id":57328622,"uuid":"43656645","full_name":"csstools/postcss-unopacity","owner":"csstools","description":"Use the opacity property in older Internet Explorer","archived":false,"fork":false,"pushed_at":"2017-01-11T06:31:07.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T03:59:11.428Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-04T23:27:18.000Z","updated_at":"2023-01-22T20:33:39.000Z","dependencies_parsed_at":"2022-09-04T11:42:32.551Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-unopacity","commit_stats":null,"previous_names":["jonathantneal/postcss-unopacity"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unopacity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unopacity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unopacity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unopacity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-unopacity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224124800,"owners_count":17259746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T15:13:01.159Z","updated_at":"2024-11-11T15:13:02.257Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnOpacity [\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\"\u003e][postcss]\n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Licensing][lic-img]][lic-url]\n[![Changelog][log-img]][log-url]\n[![Gitter Chat][git-img]][git-url]\n\n[UnOpacity] lets you use the `opacity` property in older Internet Explorer.\n\n```css\n/* before */\n\n.figure {\n    opacity: .5;\n}\n\n/* after */\n\n.figure {\n    filter: alpha(opacity=50);\n}\n```\n\n## Usage\n\nAdd [UnOpacity] to your build tool:\n\n```bash\nnpm install postcss-unopacity --save-dev\n```\n\n#### Node\n\nUse [UnOpacity] to process your CSS:\n\n```js\nrequire('postcss-unopacity').process(YOUR_CSS, { /* options */ });\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nUse [UnOpacity] as a plugin:\n\n```js\npostcss([\n\trequire('postcss-unopacity')({ /* options */ })\n]).process(YOUR_CSS, /* options */);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nUse [UnOpacity] in your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n\treturn gulp.src('./src/*.css').pipe(\n\t\tpostcss([\n\t\t\trequire('postcss-unopacity')({ /* options */ })\n\t\t])\n\t).pipe(\n\t\tgulp.dest('.')\n\t);\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nUse [UnOpacity] in your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n\tpostcss: {\n\t\toptions: {\n\t\t\tuse: [\n\t\t\t\trequire('postcss-unopacity')({ /* options */ })\n\t\t\t]\n\t\t},\n\t\tdist: {\n\t\t\tsrc: '*.css'\n\t\t}\n\t}\n});\n```\n\n## Options\n\n#### `browsers`\n\nType: `String` | `Array`  \nDefault: `null`\n\nA list of browsers you want to target in your project. If no older Internet Explorer browsers are specified, this plugin will not make any changes to your CSS.\n\n```js\nrequire('postcss-unopacity')({\n  browsers: [\"\u003e 1%\", \"last 2 versions\", \"Firefox ESR\"]\n})\n```\n\nThis may also be defined in `package.json`.\n\n```json\n{\n  \"browserslist\": [\"\u003e 1%\", \"last 2 versions\", \"Firefox ESR\"]\n}\n```\n\n#### `method`\n\nType: `String`  \nDefault: `'replace'`\n\n##### `replace`\n\nReplace any `opacity` property with a fallback.\n\n```css\n/* before */\n\n.figure {\n    opacity: .5;\n}\n\n/* after */\n\n.figure {\n    filter: alpha(opacity=50);\n}\n```\n\n##### `copy`\n\nCopy any `opacity` property with a fallback.\n\n```css\n/* before */\n\n.figure {\n    opacity: .5;\n}\n\n/* after */\n\n.figure {\n    filter: alpha(opacity=50);\n    opacity: .5;\n}\n```\n\n##### `warn`\n\nWarn when an `opacity` property is used.\n\n#### `prefixed`\n\nType: `Boolean`  \nDefault: `false`\n\n##### `true`\n\nUse an `-ms-filter` property as a fallback.\n\n```css\n/* before */\n\n.figure {\n    opacity: .5;\n}\n\n/* after */\n\n.figure {\n    -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n}\n```\n\n##### `false`\n\nUse a `filter` property as a fallback.\n\n```css\n/* before */\n\n.figure {\n    opacity: .5;\n}\n\n/* after */\n\n.figure {\n    filter: alpha(opacity=50);\n}\n```\n\n[npm-url]: https://www.npmjs.com/package/postcss-unopacity\n[npm-img]: https://img.shields.io/npm/v/postcss-unopacity.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-unopacity\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-unopacity.svg\n[lic-url]: LICENSE.md\n[lic-img]: https://img.shields.io/npm/l/postcss-unopacity.svg\n[log-url]: CHANGELOG.md\n[log-img]: https://img.shields.io/badge/changelog-md-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[git-img]: https://img.shields.io/badge/chat-gitter-blue.svg\n\n[UnOpacity]: https://github.com/jonathantneal/postcss-unopacity\n[PostCSS]: https://github.com/postcss/postcss\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unopacity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-unopacity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unopacity/lists"}