Skip to content

How to write a style tag #753

Answered by ealmloff
onichandame asked this question in Q&A
Discussion options

You must be logged in to vote

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})
            }
        }
    }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@onichandame
Comment options

Answer selected by onichandame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants