Skip to content

Commit

Permalink
zu: Update styles in FormGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Nov 24, 2023
1 parent 0496bbf commit 6bfb247
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions crates/zu/src/form_group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ pub struct Props {
#[prop_or_default]
pub aria_label: AttrValue,

/// The content of the component.
#[prop_or_default]
pub children: Children,

/// Override or extend the styles applied to the component.
#[prop_or_default]
pub classes: Classes,

Expand All @@ -37,9 +39,10 @@ pub fn form_group(props: &Props) -> Html {
);

html! {
<div class={root_cls}
style={props.style.to_attr()}
aria-label={props.aria_label.to_attr()}>
<div
aria-label={props.aria_label.to_attr()}
class={root_cls}
style={props.style.to_attr()}>
{for props.children.iter()}
</div>
}
Expand Down
8 changes: 4 additions & 4 deletions crates/zu/src/form_group/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
display: flex;
flex-direction: column;
flex-wrap: wrap;
}

/* Styles applied to the root element if row={true}. */
.ZuFormGroup-row {
flex-direction: row;
/* Styles applied to the root element if row={true}. */
&.ZuFormGroup-row {
flex-direction: row;
}
}

/* State class applied to the root element if error={true}. */
Expand Down

0 comments on commit 6bfb247

Please sign in to comment.