Crates.io | rustyle |
lib.rs | rustyle |
version | 0.1.0 |
source | src |
created_at | 2019-03-23 12:50:42.090941 |
updated_at | 2019-03-23 12:50:42.090941 |
description | A new way to represent the CSS stylesheet in Rust |
homepage | |
repository | https://github.com/RanolP/rustyle |
max_upload_size | |
id | 123286 |
size | 20,158 |
A new way to represent the CSS stylesheet in Rust
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.
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;
}
}
It's written in proc macro. The css codes checked and wrote at compile time. macro calls replaced to randomly generated class names.