{"id":17084527,"url":"https://github.com/nsaunders/component-css-loader","last_synced_at":"2026-05-02T09:35:00.976Z","repository":{"id":65330569,"uuid":"589744695","full_name":"nsaunders/component-css-loader","owner":"nsaunders","description":"A Webpack loader that applies a prefix to CSS class names, IDs, and animation names","archived":false,"fork":false,"pushed_at":"2023-10-06T20:41:36.000Z","size":185,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T10:06:17.764Z","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/nsaunders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2023-01-16T20:46:56.000Z","updated_at":"2023-01-21T01:14:15.000Z","dependencies_parsed_at":"2024-11-30T12:34:33.377Z","dependency_job_id":null,"html_url":"https://github.com/nsaunders/component-css-loader","commit_stats":null,"previous_names":["nsaunders/prefix-loader"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsaunders%2Fcomponent-css-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsaunders%2Fcomponent-css-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsaunders%2Fcomponent-css-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsaunders%2Fcomponent-css-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsaunders","download_url":"https://codeload.github.com/nsaunders/component-css-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111928,"owners_count":20562511,"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-10-14T13:07:48.620Z","updated_at":"2026-05-02T09:35:00.943Z","avatar_url":"https://github.com/nsaunders.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# component-css-loader \u003ca href=\"https://github.com/nsaunders/component-css-loader/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/nsaunders/component-css-loader/ci.yml?branch=master\" alt=\"Build status\"\u003e\u003c/a\u003e \u003ca href=\"https://www.npmjs.com/package/component-css-loader\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/component-css-loader.svg\" alt=\"Latest Release\"\u003e\u003c/a\u003e \u003ca href=\"https://github.com/nsaunders/component-css-loader/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/nsaunders/component-css-loader.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\n## Overview\n\nThis Webpack loader applies a prefix to each class name, ID, and animation name\nthat appears within a given style sheet. While similar functionality could be\nachieved using e.g.\n[postcss-loader](http://github.com/webpack-contrib/postcss-loader), the unique\nfeature of this loader is that the prefix is supplied in the source content\nrather than within the Webpack configuration. Thus, a unique prefix can be\napplied to each style sheet module, allowing independent scoping.\n\n### Example\n\n**Input**\n```json\n{\n  \"moduleId\": \"button\",\n  \"css\": \".container\\n {\\n  /*...*/\\n}\"\n}\n```\n\n**Output**\n```css\n.button___container {\n  /*...*/\n}\n```\n\n## Options\n\n**prefix**: string\n\nA custom prefix to apply to classes, IDs, and animation names. Wrap the name of\neach field you would like to include in square brackets.\n\nFor example, given the default value `[moduleId]___`, the loader will replace\nthe `[moduleId]` placeholder with the value of the `moduleId` field in the JSON\ninput.\n\n**css**: string\n\nA custom field name for CSS content. Defaults to `css`.\n\n## FAQ\n\n\u003e The JSON content format is inconvenient and doesn't look like code I would\n\u003e normally write.\n\nIndeed, the JSON content that this loader accepts as input would typically be\nthe output produced by another loader, such as\n[execute-module-loader](https://github.com/nsaunders/execute-module-loader).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsaunders%2Fcomponent-css-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsaunders%2Fcomponent-css-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsaunders%2Fcomponent-css-loader/lists"}