{"id":22330145,"url":"https://github.com/antharuu/mew","last_synced_at":"2026-03-16T00:08:17.177Z","repository":{"id":54691455,"uuid":"333514706","full_name":"antharuu/mew","owner":"antharuu","description":"🎨 Mew - A lightweight CSS preprocessor with elegant BEM support. Crafted in Rust, featuring intuitive nesting, variables, and seamless BEM integration. Write cleaner, more maintainable CSS with a minimalist yet powerful syntax.","archived":false,"fork":false,"pushed_at":"2024-11-12T14:51:32.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-30T16:50:00.487Z","etag":null,"topics":["bem","bem-css","bem-methodology","css","css-preprocessor","css3","developer-tools","preprocessor","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antharuu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-27T17:58:38.000Z","updated_at":"2024-11-12T14:51:32.000Z","dependencies_parsed_at":"2022-08-14T00:10:31.697Z","dependency_job_id":null,"html_url":"https://github.com/antharuu/mew","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/antharuu%2Fmew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antharuu%2Fmew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antharuu%2Fmew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antharuu%2Fmew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antharuu","download_url":"https://codeload.github.com/antharuu/mew/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228041354,"owners_count":17860221,"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":["bem","bem-css","bem-methodology","css","css-preprocessor","css3","developer-tools","preprocessor","rust","rust-lang"],"created_at":"2024-12-04T04:06:17.294Z","updated_at":"2026-03-16T00:08:17.085Z","avatar_url":"https://github.com/antharuu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mew - CSS Style Builder for Rust\n\nA fluent, chainable API for building CSS styles with strong typing in Rust.\n\n## Features\n\n- **Fluent, chainable API** for building CSS styles\n- **Strongly-typed CSS values** using enums and structs\n- **Extensible design** following SOLID principles\n- **No external dependencies**\n- **Comprehensive validation** of CSS values\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nmew = \"0.1.0\"\n```\n\n## Usage\n\n### Basic Example\n\n```rust\nuse mew_css::style;\nuse mew_css::values::{Color, Size, Display};\n\nfn main() {\n    let css = style()\n        .color(Color::White)\n        .background_color(Color::Rgba(255, 0, 0, 0.5))\n        .font_size(Size::Px(16))\n        .display(Display::Flex)\n        .apply();\n\n    println!(\"{}\", css);\n    // Output: color: white; background-color: rgba(255, 0, 0, 0.5); font-size: 16px; display: flex;\n}\n```\n\n### Complex Example\n\n```rust\nuse mew_css::style;\nuse mew_css::values::{Color, Size, Display, FlexDirection, JustifyContent, AlignItems};\n\nfn main() {\n    let css = style()\n        .display(Display::Flex)\n        .flex_direction(FlexDirection::Column)\n        .justify_content(JustifyContent::Center)\n        .align_items(AlignItems::Center)\n        .width(Size::Percent(100.0))\n        .height(Size::Vh(100.0))\n        .background_color(Color::Rgb(240, 240, 240))\n        .color(Color::Hex(\"333333\".to_string()))\n        .font_size(Size::Rem(1.2))\n        .font_family(\"Arial, sans-serif\")\n        .padding(Size::Px(20))\n        .margin(Size::Auto)\n        .border_radius(Size::Px(8))\n        .apply();\n\n    println!(\"{}\", css);\n}\n```\n\n### CSS Variables\n\n```rust\nuse mew_css::{style, var};\nuse mew_css::values::{Color};\n\nfn main() {\n    let css = style()\n        .set_var(\"primary\", Color::Red)\n        .custom_property(\"color\", var(\"primary\"))\n        .apply();\n\n    println!(\"{}\", css);\n    // Output: --primary: red; color: var(--primary);\n}\n```\n\n## Available CSS Properties\n\n### Color Properties\n- `color(Color)`\n- `background_color(Color)`\n- `border_color(Color)`\n\n### Size Properties\n- `width(Size)`\n- `height(Size)`\n- `margin(Size)`, `margin_top(Size)`, `margin_right(Size)`, `margin_bottom(Size)`, `margin_left(Size)`\n- `padding(Size)`, `padding_top(Size)`, `padding_right(Size)`, `padding_bottom(Size)`, `padding_left(Size)`\n- `font_size(Size)`\n- `line_height(Size)`\n- `border_width(Size)`\n- `border_radius(Size)`\n\n### Display Properties\n- `display(Display)`\n- `position(Position)`\n- `flex_direction(FlexDirection)`\n- `justify_content(JustifyContent)`\n- `align_items(AlignItems)`\n\n### Font Properties\n- `font_weight(FontWeight)`\n- `font_family(\u0026str)`\n- `text_align(\u0026str)`\n\n### Border Properties\n- `border_style(\u0026str)`\n\n## CSS Value Types\n\n### Color\n- Named colors: `Black`, `White`, `Red`, `Green`, `Blue`, `Yellow`, `Purple`, `Gray`, `Transparent`\n- RGB: `Rgb(u8, u8, u8)`\n- RGBA: `Rgba(u8, u8, u8, f32)`\n- Hex: `Hex(String)`\n\n### Size\n- Pixels: `Px(u32)`\n- Percentage: `Percent(f32)`\n- Em: `Em(f32)`\n- Rem: `Rem(f32)`\n- Viewport width: `Vw(f32)`\n- Viewport height: `Vh(f32)`\n- Auto: `Auto`\n\n### Display\n- `None`, `Block`, `Inline`, `InlineBlock`, `Flex`, `Grid`, `Table`\n\n### Position\n- `Static`, `Relative`, `Absolute`, `Fixed`, `Sticky`\n\n### FlexDirection\n- `Row`, `RowReverse`, `Column`, `ColumnReverse`\n\n### JustifyContent\n- `FlexStart`, `FlexEnd`, `Center`, `SpaceBetween`, `SpaceAround`, `SpaceEvenly`\n\n### AlignItems\n- `FlexStart`, `FlexEnd`, `Center`, `Baseline`, `Stretch`\n\n### FontWeight\n- `Normal`, `Bold`, `Bolder`, `Lighter`, `Weight(u16)`\n\n## Extending the Library\n\nThe library is designed to be easily extensible. To add new CSS properties:\n\n1. Add a new enum in `values.rs` if needed\n2. Add a new property function in the appropriate module in `properties.rs`\n3. Add a new method to the `Style` struct in `style.rs`\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantharuu%2Fmew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantharuu%2Fmew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantharuu%2Fmew/lists"}