{"id":27938529,"url":"https://github.com/willowtreeapps/css-variable-theme-webpack-plugin","last_synced_at":"2025-06-12T18:08:29.602Z","repository":{"id":66754489,"uuid":"83071654","full_name":"willowtreeapps/css-variable-theme-webpack-plugin","owner":"willowtreeapps","description":"Generate theme stylesheets using CSS variable syntax","archived":false,"fork":false,"pushed_at":"2019-04-15T15:45:28.000Z","size":18,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":136,"default_branch":"master","last_synced_at":"2025-06-03T18:27:16.321Z","etag":null,"topics":["css-variables","postcss","theme","theming","webpack-loader","webpack-plugin"],"latest_commit_sha":null,"homepage":null,"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/willowtreeapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2017-02-24T18:38:09.000Z","updated_at":"2020-08-10T15:28:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"2bb325eb-1664-42b8-a31d-d0d0ad60fe13","html_url":"https://github.com/willowtreeapps/css-variable-theme-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/willowtreeapps/css-variable-theme-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcss-variable-theme-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcss-variable-theme-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcss-variable-theme-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcss-variable-theme-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willowtreeapps","download_url":"https://codeload.github.com/willowtreeapps/css-variable-theme-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcss-variable-theme-webpack-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259518829,"owners_count":22870302,"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":["css-variables","postcss","theme","theming","webpack-loader","webpack-plugin"],"created_at":"2025-05-07T08:49:01.274Z","updated_at":"2025-06-12T18:08:29.576Z","avatar_url":"https://github.com/willowtreeapps.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSS Variable Theme Webpack Plugin\n\n## Install\n\n```bash\nnpm install --save-dev css-variable-theme-webpack-plugin\n```\n\n## Usage\n\n```js\n/* webpack.config.js */\nconst path = require('path');\nconst ThemePlugin = require('css-variable-theme-webpack-plugin');\n\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [\n          'css-loader',\n          path.join(__dirname, './node_modules/css-variable-theme-webpack-plugin/loader')\n        ]\n      }\n    ]\n  },\n  plugins: [\n    new ThemePlugin({\n      themes: {\n        light: 'light.css',\n        dark: 'dark.css'\n      }\n    }),\n  ]\n}\n```\n\nTheme files support CSS variable syntax on the `:root` selector.\n```css\n/* light.css */\n:root {\n    --color: black;\n    --background-color: white;\n}\n\n/* dark.css */\n:root {\n    --color: white;\n    --background-color: black;\n}\n```\n\nUse variables from your theme files in your stylesheets.\n```css\n/* styles.css */\nbody {\n    color: theme-var(--color);\n    background-color: theme-var(--background-color);\n}\n```\n\n### Usage with [CSS Modules](https://github.com/css-modules/css-modules)\n\nUse loader options `modules` and `localIdentName` to generate locally scoped CSS class names. These work the same as [css-loader](https://github.com/webpack-contrib/css-loader#css-scope).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillowtreeapps%2Fcss-variable-theme-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillowtreeapps%2Fcss-variable-theme-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillowtreeapps%2Fcss-variable-theme-webpack-plugin/lists"}