{"id":13395304,"url":"https://github.com/css-modules/css-modules","last_synced_at":"2025-05-13T17:14:09.874Z","repository":{"id":32668144,"uuid":"36256540","full_name":"css-modules/css-modules","owner":"css-modules","description":"Documentation about css-modules","archived":false,"fork":false,"pushed_at":"2024-05-30T14:58:51.000Z","size":64,"stargazers_count":17834,"open_issues_count":125,"forks_count":563,"subscribers_count":216,"default_branch":"master","last_synced_at":"2025-05-10T07:36:11.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/css-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-05-25T21:54:47.000Z","updated_at":"2025-05-09T05:12:40.000Z","dependencies_parsed_at":"2024-01-06T02:03:53.561Z","dependency_job_id":"0da3a2e6-7603-4680-9c0a-61592fad43ae","html_url":"https://github.com/css-modules/css-modules","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/css-modules%2Fcss-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/css-modules%2Fcss-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/css-modules%2Fcss-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/css-modules%2Fcss-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/css-modules","download_url":"https://codeload.github.com/css-modules/css-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990500,"owners_count":21995776,"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-07-30T17:01:50.509Z","updated_at":"2025-05-13T17:14:09.814Z","avatar_url":"https://github.com/css-modules.png","language":null,"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/css-modules/css-modules/assets/9113740/f0de16c6-aee2-4fb7-8752-bf400cc5145e\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/css-modules/logos/master/css-modules-logo.png\"\u003e\n  \u003cimg alt=\"CSS Modules Logo\" src=\"https://raw.githubusercontent.com/css-modules/logos/master/css-modules-logo.png\" width=\"150\" height=\"150\"\u003e\n\u003c/picture\u003e\n\n# CSS Modules\n\nA **CSS Module** is a CSS file where all class names and animation names are scoped locally by default. All URLs (`url(...)`) and `@imports` are in module request format (`./xxx` and `../xxx` means relative, `xxx` and `xxx/yyy` means in modules folder, i.e. in `node_modules`).\n\nCSS Modules compile to a low-level interchange format called ICSS (or [Interoperable CSS](https://github.com/css-modules/icss)) but are written like normal CSS files:\n\n```css\n/* style.css */\n.className {\n  color: green;\n}\n```\n\nWhen importing a **CSS Module** from a JavaScript Module, it exports an object with all mappings from local names to global names.\n\n```js\nimport styles from './style.css';\n\nelement.innerHTML = '\u003cdiv class=\"' + styles.className + '\"\u003e';\n```\n\n## Table of Contents\n\n- [Get Started \u0026 Examples](/docs/get-started.md)\n- [Naming](/docs/naming.md)\n- [Composition](/docs/composition.md)\n- [Local Scope](/docs/local-scope.md)\n- [History](/docs/history.md)\n- [Pseudo Class Selectors](/docs/pseudo-class-selectors.md)\n- [Theming](/docs/theming.md)\n\n## Why CSS Modules?\n\n- **Local Scope Prevents Clashes:** CSS Modules use local scope to avoid style conflicts across different project parts, allowing component-scoped styling.\n- **Clear Style Dependencies:** Importing styles into their respective components clarifies which styles impact which areas, enhancing code readability and maintenance.\n- **Solves Global Scope Problems:** CSS Modules prevent the common issue of styles in one file affecting the entire project by localizing styles to specific components.\n- **Boosts Reusability and Modularity:** CSS Modules allow the same class names in different modules, promoting modular, reusable styling.\n","funding_links":[],"categories":["Others","The AWESOME list","Problems","Unknow","Development","Stack","CSS","CSS Modules support","Adding a CSS Modules Stylesheet","🕹 Usage","Frameworks/Libraries"],"sub_categories":["Front-end","Additional objectives","Frontend","redux 扩展","macros","React Components","`Button.js`","CSS"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcss-modules%2Fcss-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcss-modules%2Fcss-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcss-modules%2Fcss-modules/lists"}