{"id":25044967,"url":"https://github.com/sectorlabs/postcss-inline-class","last_synced_at":"2025-10-19T06:09:40.127Z","repository":{"id":42886932,"uuid":"255105185","full_name":"SectorLabs/postcss-inline-class","owner":"SectorLabs","description":"A webpack plugin to inline CSS classes in other CSS classes using postcss","archived":false,"fork":false,"pushed_at":"2024-10-23T11:25:32.000Z","size":75,"stargazers_count":8,"open_issues_count":9,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-27T15:55:58.928Z","etag":null,"topics":["inline","mixins","postcss","postcss-plugins","webpack"],"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/SectorLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2020-04-12T14:52:56.000Z","updated_at":"2024-10-23T11:18:10.000Z","dependencies_parsed_at":"2024-11-08T10:33:29.650Z","dependency_job_id":"850fd9c9-fe8d-45aa-9037-3cff3bac1469","html_url":"https://github.com/SectorLabs/postcss-inline-class","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"943317020887a939858b6d93c4ad4e3f4ccadb63"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Fpostcss-inline-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Fpostcss-inline-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Fpostcss-inline-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SectorLabs%2Fpostcss-inline-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SectorLabs","download_url":"https://codeload.github.com/SectorLabs/postcss-inline-class/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809032,"owners_count":21164895,"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":["inline","mixins","postcss","postcss-plugins","webpack"],"created_at":"2025-02-06T05:20:06.092Z","updated_at":"2025-10-19T06:09:40.019Z","avatar_url":"https://github.com/SectorLabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/SectorLabs/postcss-inline-class/tree/master.svg?style=svg)](https://circleci.com/gh/SectorLabs/postcss-inline-class/tree/master)\n\n# postcss-inline-class\n\nA webpack plugin to inline CSS classes in other CSS classes using postcss.\n\n## Installation\n\n```\nyarn add -D @sector-labs/postcss-inline-class\n```\n\n## Usage\n\nJust add `postcss-inline-class` in the list of the webpack plugins\n\n```js\nplugins: [\n    require('@sector-labs/postcss-inline-class')(),\n]\n```\n\n## Resolving files\n\n`postcss-inline-class` uses [resolve](https://github.com/browserify/resolve) under the hood to support file resolving.\n\n```js\nplugins: [\n    require('@sector-labs/postcss-inline-class')({\n        paths: [\n            path.join(process.cwd(), '/theme/dark'),\n            path.join(process.cwd(), '/theme/default'),\n        ],\n    }),\n],\n```\n\n## Examples\n\n### Minimal example\n\n```css\n.a {\n    color: red;\n}\n\n.b {\n    @inline .a;\n    font-size: 14px;\n}\n```\nbecomes\n```css\n.a {\n    color: red;\n}\n\n.b {\n    color: red;\n    font-size: 14px;\n}\n```\n\n### Multiple blocks\n\n```css\n.a {\n    color: red;\n}\n\n.a, .b {\n    font-size: 14px\n}\n\n.c {\n    @inline .a;\n}\n```\nbecomes\n```css\n.a {\n    color: red;\n}\n\n.a, .b {\n    font-size: 14px\n}\n\n.c {\n    color: red;\n    font-size: 14px;\n}\n```\n\n### Different files\n\n```css\n/* foo.css */\n\n.a {\n    color: red;\n}\n\n/* bar.css */\n\n.b {\n    @inline .a from './foo.css';\n    font-size: 14px;\n}\n```\nbecomes\n```css\n/* foo.css */\n\n.a {\n    color: red;\n}\n\n/* bar.css */\n\n.b {\n    color: red;\n    font-size: 14px;\n}\n```\n\n### Nested\n\n```css\n.foo + div.a {\n    color: red;\n}\n\n.b {\n    @inline .a;\n    font-size: 14px;\n}\n```\nbecomes \n```css\n.foo + div.a {\n    color: red;\n}\n\n.b {\n    font-size: 14px;\n}\n\n.foo + div.b {\n    color: red;\n}\n```\n\n### Media queries\n\n```css\n.a {\n    color: red;\n}\n\n@media (min-width: 240px) {\n    .a {\n        color: green;\n    }\n}\n\n.b {\n    @inline .a;\n    font-size: 14px;\n}\n```\nbecomes\n```css\n.a {\n    color: red;\n}\n\n@media (min-width: 240px) {\n    .a {\n        color: green;\n    }\n}\n\n.b {\n    color: red;\n    font-size: 14px;\n}\n\n@media (min-width: 240px) {\n    .b {\n        color: green;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectorlabs%2Fpostcss-inline-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsectorlabs%2Fpostcss-inline-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectorlabs%2Fpostcss-inline-class/lists"}