rustyle

Crates.iorustyle
lib.rsrustyle
version0.1.0
sourcesrc
created_at2019-03-23 12:50:42.090941
updated_at2019-03-23 12:50:42.090941
descriptionA new way to represent the CSS stylesheet in Rust
homepage
repositoryhttps://github.com/RanolP/rustyle
max_upload_size
id123286
size20,158
RanolP (RanolP)

documentation

README

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.

Commit count: 76

cargo fmt