{"id":13726826,"url":"https://github.com/RanolP/rustyle","last_synced_at":"2025-05-07T22:30:34.173Z","repository":{"id":57665932,"uuid":"175617464","full_name":"RanolP/rustyle","owner":"RanolP","description":"A new way to represent the CSS stylesheet in Rust","archived":true,"fork":false,"pushed_at":"2019-05-22T09:32:21.000Z","size":277,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-03T22:04:05.389Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RanolP.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":"2019-03-14T12:27:37.000Z","updated_at":"2023-12-19T15:37:41.000Z","dependencies_parsed_at":"2022-09-12T15:12:43.925Z","dependency_job_id":null,"html_url":"https://github.com/RanolP/rustyle","commit_stats":null,"previous_names":["ranolp/rustyle","project-rustyle/rustyle-abandoned"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RanolP%2Frustyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RanolP%2Frustyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RanolP%2Frustyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RanolP%2Frustyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RanolP","download_url":"https://codeload.github.com/RanolP/rustyle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252965081,"owners_count":21832819,"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":[],"created_at":"2024-08-03T01:03:25.463Z","updated_at":"2025-05-07T22:30:33.827Z","avatar_url":"https://github.com/RanolP.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# rustyle\n\n![rust-nightly](https://img.shields.io/badge/rust-nightly-important.svg)\n[![Travis](https://img.shields.io/travis/com/RanolP/rustyle.svg)](https://travis-ci.com/RanolP/rustyle)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/RanolP/rustyle.svg)\n![Codecov coverage status](https://img.shields.io/codecov/c/github/RanolP/rustyle.svg)\n![crates.io version](https://img.shields.io/crates/v/rustyle.svg)\n![crates.io downloads](https://img.shields.io/crates/d/rustyle.svg)\n![crates.io license](https://img.shields.io/crates/l/rustyle.svg)\n\nA new way to represent the CSS stylesheet in Rust\n\n## Basic Information\n\nRead like \\[rough style\\]. It seems like styled-components, emotion, glamor, and other CSS-in-JS libraries. It's basically inspired by their concepts. But more friendly with rust.\n\n## Syntax\n\nWrite CSS-in-Rust like this! (We call it rusty css syntax)\n\n```rust\nlet (Class, File) = css! {\n  background-color: gray;\n\n  \u0026:hover {\n    background-color: lighten!(15%, gray);\n  }\n\n  \u0026:not(:hover) \u003e p {\n    display: none;\n  }\n}\n```\n\n## Special features which not exists on CSS\n\n### Root Metadata\n\nRoot Metadata syntax is inspired by the metadata syntax in Rust.\nIt appends the metadata of root ruleset which controls the behavior of code generator.\nFor the cleaner code, We decided it should not appear after other rule appeared.\n\nSyntax:\n\n```rust\nlet (Ruleset, RulesetFile) = rustyle! {\n  #![ruleset_metadata]\n  #![ruleset_metadata(with_param)]\n}\n```\n\nrustyle embedded those ruleset attributes:\n\n- `#![inject_global]` (todo)\n- `#![no_optimize]` (todo)\n- `#![no_collapse]` (todo)\n- `#![include(NAME)]` (todo)\n- `#![filename(filename)]`\n\n### Rule Metadata\n\nRule Metadata syntax is inspired by the attribute syntax in Rust.\nIt appends the metadata of rule which gives hint to the code generator.\nAffect on the rule on the next line.\n\nSyntax:\n\n```rust\nlet (Ruleset, RulesetFile) = rustyle! {\n  #[rule_metadata]\n  the: rule;\n\n  #[rule_metadata]\n  the rule {\n    #[rule_metadata(with_param)]\n    the: rule;\n  }\n}\n```\n\nrustyle embedded those ruleset attributes:\n\n- `#[no_warn(vendor_prefix)]`\n- `#[no_optimize]` (todo)\n\n### Function\n\nFunction seems like Sass, Less, etc's. But more likey with macro on Rust.\nFunction evaluated at the compile time. And our custom function ends with exclamation(!) character.\nYou can declare custom function if we can :p.\n\nSyntax:\n\n```rust\nlet (Ruleset, RulesetFile) = rustyle! {\n  expression_position: function!();\n\n  statement_position!();\n}\n```\n\nrustyle embedded those functions:\n\n- `adjust_hue!(color, angle)` (todo)\n- `lighten!(color, amount)` (todo)\n- `darken!(color, amount)` (todo)\n- `saturate!(color, amount)` (todo)\n- `desaturate!(color, amount)` (todo)\n- `transparentize!(color, amount)` (todo)\n- `grayscale!(color)` (todo)\n- `complement!(color)` (todo)\n- `invert!(color)` (todo)\n\n## How's it works\n\nIt's written in proc macro. The css codes checked and wrote at compile time. macro calls replaced to randomly generated class names.\n\n## Links\n\n- [Known Issues](https://github.com/RanolP/rustyle/blob/master/KNOWN_ISSUES.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRanolP%2Frustyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRanolP%2Frustyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRanolP%2Frustyle/lists"}