How to write a style tag #753
Answered
by
ealmloff
onichandame
asked this question in
Q&A
-
I wish to write some css in style tag. I saw #68 (comment) but it didn't help. My question is, what is the intended way to add style blocks? |
Beta Was this translation helpful? Give feedback.
Answered by
ealmloff
Jan 12, 2023
Replies: 1 comment 1 reply
-
You need to call into_iter() and use rsx to format the text: pub fn App(cx: Scope) -> Element {
render! {
div {
p {
"Hello!"
}
style {
vec!["p { color: red; }"].into_iter().map(|s| rsx!{s})
}
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
onichandame
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to call into_iter() and use rsx to format the text: