Skip to content
This repository was archived by the owner on Jul 19, 2020. It is now read-only.

Latest commit

 

History

History
36 lines (27 loc) · 750 Bytes

styling.md

File metadata and controls

36 lines (27 loc) · 750 Bytes

Styling

<Work in progress>

Proposal for proper CSS support can be found here: yewstack/yew#533

In the meantime you can define the style with any standard CSS tools

Yew component does not support yet class attribute

So far Yew component does not support natively the class attribute. You can add the class attribute to your component:

#[derive(Properties, Clone, PartialEq)]
...
pub struct Props{
...
#[prop_or_default]
    pub class:String,
...
}
...

and render how you wish!

...
        html! {
            <div class={format!("{}",self.props.class)}>
                <h1>{"I am super Class"}</h1>
            </div>
        }
...