Crates.io | styler_core |
lib.rs | styler_core |
version | 0.1.2 |
source | src |
created_at | 2023-01-22 06:49:23.509095 |
updated_at | 2023-01-24 13:03:14.161323 |
description | build_style is scoped css parsing solution for style macro of styler |
homepage | |
repository | https://github.com/abishekatp/stylers |
max_upload_size | |
id | 764823 |
size | 41,573 |
#[component]
fn Hello(cx: Scope, name: &'static str) -> impl IntoView {
let styler_class = style! {"Hello",
#two{
color: blue;
}
div.one{
color: red;
content: raw_str(r#"\hello"#);
font: "1.3em/1.2" Arial, Helvetica, sans-serif;
}
div {
border: 1px solid black;
margin: 25px 50px 75px 100px;
background-color: lightblue;
}
h2 {
color: purple;
}
@media only screen and (max-width: 1000px) {
h3 {
background-color: lightblue;
color: blue
}
}
};
view! {cx, class = styler_class,
<div class="one">
<h1 id="two">"Hello"</h1>
<h2>"World"</h2>
<h2>{name}</h2>
<h3>"Hello Kanna"</h3>
</div>
}
}
style!{"mystyle",
h2 {
color: green;
}
}
raw_str
as given below:style!(
div{
content: raw_str(r#"\hello"#);
font: "1.3em/1.2" Arial;
}
)
div.l-23432{
content: "\hello";
font: 1.3em/1.2 Arial;
}
You have to include generated main.css in the index.html
(e.g <link data-trunk rel="css" href="./main.css">
).
In Trunk.toml
you have to add the below lines to prevent infinite loop
[watch]
ignore = ["./css"]