{"id":18817691,"url":"https://github.com/archfz/mini-css-themes-plugin","last_synced_at":"2026-05-01T16:34:29.921Z","repository":{"id":57148620,"uuid":"299583566","full_name":"archfz/mini-css-themes-plugin","owner":"archfz","description":"Webpack plugin to generate separate themes for css modules.","archived":false,"fork":false,"pushed_at":"2023-01-26T20:22:47.000Z","size":189,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-19T20:59:06.914Z","etag":null,"topics":["chunk","css","mini-css-extract-plugin","sass","theme","webpack-plugin"],"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/archfz.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}},"created_at":"2020-09-29T10:32:42.000Z","updated_at":"2023-01-23T20:35:56.000Z","dependencies_parsed_at":"2023-02-14T23:31:25.353Z","dependency_job_id":null,"html_url":"https://github.com/archfz/mini-css-themes-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/archfz/mini-css-themes-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archfz%2Fmini-css-themes-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archfz%2Fmini-css-themes-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archfz%2Fmini-css-themes-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archfz%2Fmini-css-themes-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/archfz","download_url":"https://codeload.github.com/archfz/mini-css-themes-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archfz%2Fmini-css-themes-plugin/sbom","scorecard":{"id":205516,"data":{"date":"2025-08-11","repo":{"name":"github.com/archfz/mini-css-themes-plugin","commit":"9798346dfacfc817c9d14ad90ae069cec5e1273b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"47 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T23:38:33.299Z","repository_id":57148620,"created_at":"2025-08-16T23:38:33.299Z","updated_at":"2025-08-16T23:38:33.299Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32505106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chunk","css","mini-css-extract-plugin","sass","theme","webpack-plugin"],"created_at":"2024-11-08T00:12:43.730Z","updated_at":"2026-05-01T16:34:29.901Z","avatar_url":"https://github.com/archfz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini CSS themes webpack plugin\n\nGenerates themes for webpack css modules based setup. Requires [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) \nas it depends on it to generate the different themes css files. Currently it supports only\nSASS.\n\n## Installation\n\n1. Install npm package:\n    ```bash\n    npm i --save mini-css-themes-plugin\n    ```\n2. Add plugin in webpack.\n    ```js\n    const MiniCssThemesWebpackPlugin = require('mini-css-themes-plugin');\n    // ...\n    module.exports = {\n       plugins: [\n         new MiniCssThemesWebpackPlugin({\n            themes: {\n                'theme_one': './path/to/theme_one/theme.scss',\n                'theme_two': './path/to/theme_two/theme.scss',\n            },\n            defaultTheme: 'theme_one'\n         })  \n       ]\n    };\n    ```\n3. By default use imports to the default theme in all css modules: ex /path/to/theme_one/theme.scss\nin this example.\n\n## How it works\n\nThe plugin will duplicate all css modules imports found in js modules for each non default theme.\nThese duplicates will then have their own compilation and a special loader will change the default\ntheme path import in scss files. Finally new chunk is generated for each non default theme.\n\nWith the installation example and with two entrypoints you will have the following additional \nchunks asset outputs:\n- theme__theme_two~entrypoint_1.hash.css\n- theme__theme_two~entrypoint_2.hash.css\n\nThis plugin is not providing the loading mechanism of these themes. You will have to write that \nyourself. Considering that you also have the webpack manifest plugin:\n\n```typescript\nconst defaultTheme: string = 'theme_one';\nconst selectedTheme: string = 'theme_two';\n\n// Here manifest is the loaded manifest.json.\nconst loadThemes: (entrypoint: string) =\u003e Array\u003cPromise\u003cany\u003e\u003e = (entrypoint) =\u003e \n  Object.keys(manifest)\n    .filter((file: string) =\u003e  {\n      if (selectedTheme !== defaultTheme) {\n        // There can be multiple chunks for same theme for this entry.\n        return file.indexOf(`theme__${selectedTheme}~${entrypoint}`) === 0 \u0026\u0026 file.match(/\\.css$/)\n      } else {\n        return file.indexOf(entrypoint) === 0 \u0026\u0026 file.match(/\\.css$/)\n      }\n    })\n    // addCss should take care of loading the css file in the DOM.\n    .map((file: string) =\u003e addCss(manifest[file]));\n\nPromise.all([\n  ...loadThemes('entrypoint_1'),\n]).then(() =\u003e {\n  // ... proceed to render your application ...\n});\n```\n\n## Themable composes\n\nUsing `composes` with switchable themes is supported, but not recommended as it will\nslow down unnecessarily the compilation. Prefer extracting components instead of\nrelying on `composes`.\n\nIt is recommended to separate all classes that get composed in a separate file in \norder to avoid bloating the css modules with many unused classes. This means that\none needs to have multiple entry points per theme. Here is an example how to do this:\n\nIn webpack config:\n```js\nnew MiniCssThemesWebpackPlugin({\n    themes: {\n        'theme_one': {\n          default: './path/to/theme_one/theme.scss',\n          composes: './path/to/theme_one/composes.scss'\n        },\n        'theme_two': {\n          default: './path/to/theme_two/theme.scss',\n          composes: './path/to/theme_one/composes.scss'\n        },\n    },\n    defaultTheme: 'theme_one'\n});\n```\n\nThen in css modules using composes.\n```scss\n@import './path/to/theme_one/theme.scss';\n\n.composed {\n  composes: someClass from './path/to/theme_one/composes.scss';\n}\n```\n\n## Limitations\n\n1. You must use the theme imports only in css modules. So for example the following is not \npossible since the plugin cannot detect the theme import and do the switch.\n\n```sass\n// MyComponent.scss\n@import './something/not/from/the/theme.scss'\n```\n\n```sass\n// ./something/not/from/the/theme.scss\n// This import won't be switched when generating the themes and the values below\n//  will remain the same for all themes.\n@import './path/to/theme_one/theme.scss'\n$myOtherVar: $themeVar1 + $themeVar2\n```\n\n2. Currently the plugin won't include plain `.css` imports from your sources or from under\nnode modules into the separate themes. Since these are not themable anyway it is advised\nto separate this css imports in their own files (common chunks) and then load them for all \nthemes. This is good for caching and theme file size overall.\n\n## Release notes\n\n#### 1.0.0-beta.1\n\n- Additional fixes for loader configurations and assets cleanup.\n\n#### 1.0.0-beta.0\n\n- Add support for webpack 5.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchfz%2Fmini-css-themes-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchfz%2Fmini-css-themes-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchfz%2Fmini-css-themes-plugin/lists"}