{"id":15250466,"url":"https://github.com/art-in/css_mod","last_synced_at":"2025-04-10T19:42:01.969Z","repository":{"id":57614274,"uuid":"468250281","full_name":"art-in/css_mod","owner":"art-in","description":"CSS Modules for Rust","archived":false,"fork":false,"pushed_at":"2024-11-17T22:12:00.000Z","size":65,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T17:21:16.419Z","etag":null,"topics":["css","css-modules","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/art-in.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":"2022-03-10T08:09:44.000Z","updated_at":"2024-11-17T22:12:04.000Z","dependencies_parsed_at":"2025-02-17T21:32:53.951Z","dependency_job_id":"63ee3cb9-52e2-4023-a245-c039da531ea9","html_url":"https://github.com/art-in/css_mod","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/art-in%2Fcss_mod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-in%2Fcss_mod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-in%2Fcss_mod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-in%2Fcss_mod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/art-in","download_url":"https://codeload.github.com/art-in/css_mod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281415,"owners_count":21077423,"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","css-modules","rust"],"created_at":"2024-09-29T16:04:58.432Z","updated_at":"2025-04-10T19:42:01.941Z","avatar_url":"https://github.com/art-in.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css_mod\n\n[![ci](https://github.com/art-in/css_mod/actions/workflows/ci.yml/badge.svg)](https://github.com/art-in/css_mod/actions/workflows/ci.yml)\n[![crate](https://img.shields.io/crates/v/css_mod.svg)](https://crates.io/crates/css_mod)\n![rustc version](https://img.shields.io/badge/rustc-stable-lightgrey.svg)\n\n[CSS Modules] implementation for Rust web applications\n\n\u003e A **CSS Module** is a CSS file in which all class names and animation names are scoped locally by default.\n\n## Features\n\nThis is currently incomplete implementation of [CSS Modules] spec, as it only supports the vital features.\n\n-   [ ] Local scoping for names\n    -   [x] Classes\n    -   [x] Animations\n    -   [ ] Grid lines/areas\n    -   [ ] `@counter-style`\n-   [ ] `:local()` / `:global()`\n-   [ ] `composes`\n-   [ ] `url()` / `@import`\n\n## Usage\n\n1. Add this crate as a regular and build dependency:\n\n    ```toml\n    # Cargo.toml\n\n    [dependencies]\n    css_mod = \"0.1.0\"\n\n    [build-dependencies]\n    css_mod = \"0.1.0\"\n    ```\n\n2. Create build script and call compiler:\n\n    ```rust\n    // build.rs\n\n    fn main() {\n        css_mod::Compiler::new()\n            .add_modules(\"src/**/*.css\").unwrap()\n            .compile(\"assets/app.css\").unwrap();\n    }\n    ```\n\n3. Call init somewhere early in program execution:\n\n    ```rust\n    // src/main.rs\n\n    fn main() {\n        css_mod::init!();\n    }\n    ```\n\n4. Finally get name mapping for CSS module:\n\n    ```rust\n    // src/my-component.rs\n\n    let css = css_mod::get!(\"my-component.css\");\n    let global_class_name = css[\"local-class-name\"]; // my-component__local-class-name__0\n    ```\n\n## Examples\n\nLook in the [examples](./examples/) directory.\n\n[css modules]: https://github.com/css-modules/css-modules\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-in%2Fcss_mod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fart-in%2Fcss_mod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-in%2Fcss_mod/lists"}