rustyle 0.1.0

A new way to represent the CSS stylesheet in Rust
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented3 out of 3 items with examples
  • Size
  • Source code size: 24.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 426.11 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • RanolP/rustyle
    8 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • RanolP

rustyle

A new way to represent the CSS stylesheet in Rust

Basic Information

Read 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.

Syntax

Write CSS-in-Rust like this! (We call it rusty css syntax)

let CLASS = css! {
  background-color: gray;

  &:hover {
    background-color: lighten!(15%, gray);
  }

  &:not(:hover) > p {
    display: none;
  }
}

How's it works

It's written in proc macro. The css codes checked and wrote at compile time. macro calls replaced to randomly generated class names.