{"id":16114949,"url":"https://github.com/simbleau/cssugar","last_synced_at":"2025-09-09T18:38:13.121Z","repository":{"id":103369196,"uuid":"534988554","full_name":"simbleau/cssugar","owner":"simbleau","description":"A CSS library for Rust, focusing on ergnomic abstractions.","archived":false,"fork":false,"pushed_at":"2023-01-18T05:12:33.000Z","size":82,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T14:49:23.953Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simbleau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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-09-10T12:15:54.000Z","updated_at":"2023-10-21T13:06:11.000Z","dependencies_parsed_at":"2023-07-08T20:45:44.046Z","dependency_job_id":null,"html_url":"https://github.com/simbleau/cssugar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simbleau/cssugar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbleau%2Fcssugar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbleau%2Fcssugar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbleau%2Fcssugar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbleau%2Fcssugar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simbleau","download_url":"https://codeload.github.com/simbleau/cssugar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbleau%2Fcssugar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274340921,"owners_count":25267297,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"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":[],"created_at":"2024-10-09T20:16:44.399Z","updated_at":"2025-09-09T18:38:13.079Z","avatar_url":"https://github.com/simbleau.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSSugar\nA CSS values and units library for Rust, focusing on ergnomic abstractions.\n\n# Goal\nThe goal is to wrap all CSS values and units in an ergonomic, rusty way. This is primarily for ecosystem tooling built around Yew and Stylist.\n\nRead more:\n- https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units\n\n# Examples\n\n## Numbers, lengths, and percentages\n[Read more](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#numbers_lengths_and_percentages)\n```rs\nuse cssugar::prelude::*;\n\n#[function_component(SizedButton)]\npub fn sized_button() -\u003e Html {\n    let size = Vw(100) - Px(300);\n    let button_css = format!(\"width: ${size};\");\n    html! {\n        \u003cbutton style={button_css}\u003e{ \"CLICK ME!\" }\u003c/button\u003e\n    }\n}\n```\n\nExpected Output:\n\u003e `\u003cbutton style=\"width: calc(100vw - 300px);\"\u003eCLICK ME!\u003c/button\u003e`\n\n## Colors\n[Read more](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#color)\n```rs\nuse cssugar::prelude::*;\n\n#[function_component(SizedButton)]\npub fn sized_button() -\u003e Html {\n    let color = Color::rgb(255, 0, 0).blend(BLACK);\n    let label_css = format!(\"color: ${color};\");\n    html! {\n        \u003clabel style={label_css}\u003e{ \"I am dark red!\" }\u003c/label\u003e\n    }\n}\n```\nExpected Output:\n\u003e `\u003clabel style=\"color: rgba(128, 0, 0, 1.0);\"\u003eI am dark red!\u003c/label\u003e`\n\n## Images\n[Read more](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#images)\nTODO\n\n## Functions\n[Read more](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#functions)\n```rs\nuse cssugar::prelude::*;\n\n#[function_component(SizedButton)]\npub fn sized_button() -\u003e Html {\n    let l1 = Length::Vw(100.);\n    let l2 = Length::Px(300.);\n    let size = l1.min(l2);\n    let button_css = format!(\"width: ${size};\");\n    html! {\n        \u003cbutton style={button_css}\u003e{ \"CLICK ME!\" }\u003c/button\u003e\n    }\n}\n```\nExpected Output:\n\u003e `\u003cbutton style=\"width: min(100vw, 300px);\"\u003eCLICK ME!\u003c/button\u003e`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbleau%2Fcssugar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimbleau%2Fcssugar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbleau%2Fcssugar/lists"}