{"id":19653006,"url":"https://github.com/csstools/postcss-unrgba","last_synced_at":"2025-04-28T17:31:05.538Z","repository":{"id":45101197,"uuid":"43992564","full_name":"csstools/postcss-unrgba","owner":"csstools","description":"Convert rgba() values to hex","archived":true,"fork":false,"pushed_at":"2022-01-08T11:10:12.000Z","size":144,"stargazers_count":4,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-21T21:40:32.991Z","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":"other","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-10T03:38:40.000Z","updated_at":"2024-12-28T18:48:13.000Z","dependencies_parsed_at":"2022-09-08T06:13:11.805Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-unrgba","commit_stats":null,"previous_names":["jonathantneal/postcss-unrgba"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unrgba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unrgba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unrgba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unrgba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-unrgba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219601,"owners_count":21554444,"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:12:54.135Z","updated_at":"2025-04-28T17:31:05.517Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnRGBA [![Build Status][ci-img]][ci]\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\" src=\"http://postcss.github.io/postcss/logo-leftp.png\" title=\"Philosopher’s stone, logo of PostCSS\"\u003e\n\n[UnRGBA] changes `rgba()` values to hex. This can be useful for outputting CSS for older browsers like Internet Explorer 8.\n\n```css\n/* before */\n\n.hero {\n\tbackground: rgba(153, 221, 153, .8);\n\tborder: solid 1px rgba(100, 102, 103, .8);\n\tborder-right-color: rgba(100, 102, 103, 0);\n}\n\n/* after */\n\n.hero {\n\tbackground: #99dd99;\n\tborder: solid 1px #646667;\n\tborder-right-color: transparent;\n}\n```\n\n## Usage\n\nAdd [UnRGBA] to your build tool:\n\n```bash\nnpm install postcss-unrgba --save-dev\n```\n\n#### Node\n\n```js\nrequire('postcss-unrgba')({ /* options */ }).process(YOUR_CSS);\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nLoad [UnRGBA] as a PostCSS plugin:\n\n```js\npostcss([\n    require('postcss-unrgba')({ /* options */ })\n]);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [UnRGBA] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n    return gulp.src('./css/src/*.css').pipe(\n        postcss([\n            require('postcss-unrgba')({ /* options */ })\n        ])\n    ).pipe(\n        gulp.dest('./css')\n    );\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nEnable [UnRGBA] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n    postcss: {\n        options: {\n            processors: [\n                require('postcss-unrgba')({ /* options */ })\n            ]\n        },\n        dist: {\n            src: 'css/*.css'\n        }\n    }\n});\n```\n\n## Options\n\n#### `method`\n\nType: `String`  \nDefault: `'replace'`\n\n##### `clone`\nCopies any properties with `rgba` values to new properties using hex.\n```css\n/* before */\n\n.hero {\n\tbackground: rgba(153, 221, 153, .8);\n}\n\n/* after */\n\n.hero {\n\tbackground: #99dd99;\n\tbackground: rgba(153, 221, 153, .8);\n}\n```\n\n##### `replace`\nCopies any properties with `rgba` values to new properties using hex while removing the original.\n```css\n/* before */\n\n.hero {\n\tbackground: rgba(153, 221, 153, .8);\n}\n\n/* after */\n\n.hero {\n\tbackground: #99dd99;\n}\n```\n\n##### `warn`\nWarns whenever a property with an `rgba` value is found.\n\n#### `filter`\n\nType: `Boolean`  \nDefault: `false`\n\n##### `true`\nUses the Internet Explorer proprietary filter to preserve alpha-transparent backgrounds.\n```css\n/* before */\n\n.hero {\n\tbackground: rgba(153, 221, 153, .8);\n}\n\n/* after */\n\n.hero {\n\tfilter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#8099dd99',endColorstr='#8099dd99');\n}\n```\n\n##### `false`\nUses regular hexadecimal values when processing backgrounds.\n```css\n/* before */\n\n.hero {\n\tbackground: rgba(153, 221, 153, .8);\n}\n\n/* after */\n\n.hero {\n\tbackground: #99dd99;\n}\n```\n\n#### `properties`\n\nType: `Array`  \nDefault: `['background', 'background-color', 'color', 'border', 'border-bottom', 'border-bottom-color', 'border-color', 'border-left', 'border-left-color', 'border-right', 'border-right-color', 'border-top', 'border-top-color', 'outline', 'outline-color']`\n\nSpecifies the properties on which rgba values will be processed. If a falsey value is passed then all properties will be processed.\n\n[ci]: https://travis-ci.org/jonathantneal/postcss-unrgba\n[ci-img]: https://travis-ci.org/jonathantneal/postcss-unrgba.svg\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n[PostCSS]: https://github.com/postcss/postcss\n[UnRGBA]: https://github.com/jonathantneal/postcss-unrgba\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unrgba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-unrgba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unrgba/lists"}