ghost elements
This commit is contained in:
+13
-16
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user