{"id":14962498,"url":"https://github.com/ryoppippi/svelte-preprocess-css-mods","last_synced_at":"2025-09-30T15:31:29.606Z","repository":{"id":251907081,"uuid":"838776094","full_name":"ryoppippi/svelte-preprocess-css-mods","owner":"ryoppippi","description":"use css modules in svelte","archived":true,"fork":false,"pushed_at":"2024-09-24T03:20:46.000Z","size":274,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T01:44:36.993Z","etag":null,"topics":["css-modules","cssmodules","svelte","svelte-preprocessor","sveltekit"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ryoppippi.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":"2024-08-06T10:14:55.000Z","updated_at":"2024-09-25T16:23:21.000Z","dependencies_parsed_at":"2024-08-24T08:33:22.911Z","dependency_job_id":"eef21fa2-a1d6-442b-a674-d612d65df8ea","html_url":"https://github.com/ryoppippi/svelte-preprocess-css-mods","commit_stats":{"total_commits":144,"total_committers":2,"mean_commits":72.0,"dds":0.4027777777777778,"last_synced_commit":"d847915242de9e85cae8004c973a281ec0995a34"},"previous_names":["ryoppippi/svelte-preprocess-css-modules"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fsvelte-preprocess-css-mods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fsvelte-preprocess-css-mods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fsvelte-preprocess-css-mods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fsvelte-preprocess-css-mods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryoppippi","download_url":"https://codeload.github.com/ryoppippi/svelte-preprocess-css-mods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234747825,"owners_count":18880510,"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-modules","cssmodules","svelte","svelte-preprocessor","sveltekit"],"created_at":"2024-09-24T13:29:53.856Z","updated_at":"2025-09-30T15:31:24.312Z","avatar_url":"https://github.com/ryoppippi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-preprocess-css-mods\n\n[![npm version](https://img.shields.io/npm/v/svelte-preprocess-css-mods?color=yellow)](https://npmjs.com/package/svelte-preprocess-css-mods)\n[![npm downloads](https://img.shields.io/npm/dm/svelte-preprocess-css-mods?color=yellow)](https://npmjs.com/package/svelte-preprocess-css-mods)\n\n[![JSR](https://jsr.io/badges/@ryoppippi/svelte-preprocess-css-mods)](https://jsr.io/@ryoppippi/svelte-preprocess-css-mods)\n[![JSR](https://jsr.io/badges/@ryoppippi/svelte-preprocess-css-mods/score)](https://jsr.io/@ryoppippi/svelte-preprocess-css-mods)\n\nSuccessor of [svelte-preprocess-cssmodules](https://github.com/micantoine/svelte-preprocess-cssmodules)\n\n## Installation\n\n```bash\nnpx nypm add -D svelte-preprocess-css-mods\n```\n\n## Usage\n\n### Config\n\n```javascript\n// svelte.config.js\n\nimport { cssModules } from 'svelte-preprocess-css-mods';\n\nexport default {\n\tpreprocess: cssModules({/* options */}),\n};\n```\n\nSee [options](./src/options.ts) for more information.\n\n### Svelte\n\n```svelte\n\u003c!-- App.svelte --\u003e\n\u003cscript\u003e\n\timport styles from './App.module.css';\n\u003c/script\u003e\n\n\u003cdiv class={styles.container}\u003e\n\t\u003ch1 class={styles.title}\u003eHello World!\u003c/h1\u003e\n\u003c/div\u003e\n```\n\n```css\n/* App.module.css */\n.container {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n\n.title {\n\tcolor: red;\n}\n```\n\nget converted into:\n\n```svelte\n\u003cscript\u003e\n\tconst styles = {\n\t\tcontainer: 'App_module_container',\n\t\ttitle: 'App_module_title',\n\t};\n\u003c/script\u003e\n\n\u003cdiv class={styles.container}\u003e\n\t\u003ch1 class={styles.title}\u003eHello World!\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cstyle\u003e\n  .App_module_container {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n  }\n\n  .App_module_title {\n    color: red;\n  }\n\u003c/style\u003e\n```\n\n## Related Works\n\n- [svelte-true-css-modules](https://github.com/naumstory/svelte-true-css-modules)\n- [svelte-preprocess-cssmodules](https://github.com/micantoine/svelte-preprocess-cssmodules)\n  - [I forked this project](https://github.com/ryoppippi/svelte-preprocess-cssmodules), but I gave it up\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryoppippi%2Fsvelte-preprocess-css-mods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryoppippi%2Fsvelte-preprocess-css-mods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryoppippi%2Fsvelte-preprocess-css-mods/lists"}