ghost elements

This commit is contained in:
2024-12-24 13:15:19 +01:00
parent e98285a360
commit ea7e9c1e1c
6 changed files with 112 additions and 47 deletions
+13 -16
View File
@@ -6,9 +6,20 @@ fn main() {
#[component]
pub fn App() {
rsx! {
@SetStyle(app_style())
@SetChild(1)
@SetStyle(css! {
example {
outline: true,
y: Auto,
x: 0 px,
}
example: "hover" {
color: Blue,
outline_color: Red,
}
})
text { static "Select an example" }
%text { class: "red-bg", static "Select an example" }
button { class: "example", on_click: fn(_, _, document) {
document.clear_css();
@@ -26,17 +37,3 @@ pub fn App() {
}, static "Login" }
}
}
pub fn app_style() -> Css {
css! {
"example" {
outline: true,
y: Auto,
x: 0 px,
}
"example": "hover" {
color: Blue,
outline_color: Red,
}
}
}