{"id":14968116,"url":"https://github.com/postcss/postcss-relative-opacity","last_synced_at":"2025-10-19T09:31:48.892Z","repository":{"id":209872417,"uuid":"725157393","full_name":"postcss/postcss-relative-opacity","owner":"postcss","description":"PostCSS plugin to add opacity to any colors with Relative Color Syntax","archived":false,"fork":false,"pushed_at":"2023-11-29T16:28:36.000Z","size":41,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-04-14T02:32:52.810Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postcss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"open_collective":"postcss","github":"ai"}},"created_at":"2023-11-29T14:57:55.000Z","updated_at":"2024-02-04T21:00:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e5c419c-a5be-4684-951d-ffcc8438b038","html_url":"https://github.com/postcss/postcss-relative-opacity","commit_stats":null,"previous_names":["postcss/postcss-relative-opacity"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-relative-opacity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-relative-opacity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-relative-opacity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-relative-opacity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postcss","download_url":"https://codeload.github.com/postcss/postcss-relative-opacity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869976,"owners_count":16555409,"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-09-24T13:39:19.388Z","updated_at":"2025-10-19T09:31:48.887Z","avatar_url":"https://github.com/postcss.png","language":"JavaScript","readme":"# PostCSS Relative Opacity\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\"\n     title=\"Philosopher’s stone, logo of PostCSS\"\n     src=\"https://postcss.org/logo-leftp.svg\"\u003e\n\n[PostCSS] plugin to add opacity to any color with [Relative Color Syntax].\n\nCSS Colors 5 allows you to change any color including adding opacity. This\nsyntax gained [broad support] in mid-2024, but for older browsers, this plugin\npartially polyfills this syntax via [`color-mix()`].\n\n```css\n.notice {\n  background: oklch(from var(--accent-color) l c h / 30%);\n}\n```\n\nwill be processed to:\n\n```css\n.notice {\n  background: color-mix(in srgb, var(--accent-color) 30%, transparent);\n}\n```\n\nThis polyfill is based on [Adam Argyle idea].\n\n---\n\n\u003cimg src=\"https://cdn.evilmartians.com/badges/logo-no-label.svg\" alt=\"\" width=\"22\" height=\"16\" /\u003e  Made at \u003cb\u003e\u003ca href=\"https://evilmartians.com/devtools?utm_source=postcss-relative-opacity\u0026utm_campaign=devtools-button\u0026utm_medium=github\"\u003eEvil Martians\u003c/a\u003e\u003c/b\u003e, product consulting for \u003cb\u003edeveloper tools\u003c/b\u003e.\n\n---\n\n[Relative Color Syntax]: https://www.w3.org/TR/css-color-5/#relative-color\n[broad support]:         https://caniuse.com/css-relative-colors\n[Adam Argyle idea]:      https://twitter.com/argyleink/status/1633681345607241730?s=20\n[`color-mix()`]:         https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix\n[PostCSS]:               https://github.com/postcss/postcss\n\n\n## Usage\n\n**Step 1:** Install plugin:\n\n```sh\nnpm install --save-dev postcss postcss-relative-opacity\n```\n\n**Step 2:** Check your project for existing PostCSS config: `postcss.config.js`\nin the project root, `\"postcss\"` section in `package.json`\nor `postcss` in bundle config.\n\nIf you do not use PostCSS, add it according to [official docs]\nand set this plugin in settings.\n\n**Step 3:** Add the plugin to plugins list:\n\n```diff\nmodule.exports = {\n  plugins: [\n+   require('postcss-relative-opacity'),\n    require('autoprefixer')\n  ]\n}\n```\n\n[official docs]: https://github.com/postcss/postcss#usage\n\n","funding_links":["https://opencollective.com/postcss","https://github.com/sponsors/ai"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostcss%2Fpostcss-relative-opacity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostcss%2Fpostcss-relative-opacity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostcss%2Fpostcss-relative-opacity/lists"}