pub struct Style {Show 62 fields
pub display: Option<String>,
pub flex_direction: Option<String>,
pub flex_wrap: Option<String>,
pub align_items: Option<String>,
pub align_self: Option<String>,
pub justify_content: Option<String>,
pub justify_items: Option<String>,
pub gap: Option<String>,
pub row_gap: Option<String>,
pub column_gap: Option<String>,
pub padding: Option<String>,
pub padding_top: Option<String>,
pub padding_right: Option<String>,
pub padding_bottom: Option<String>,
pub padding_left: Option<String>,
pub margin: Option<String>,
pub margin_top: Option<String>,
pub margin_right: Option<String>,
pub margin_bottom: Option<String>,
pub margin_left: Option<String>,
pub background_color: Option<String>,
pub color: Option<String>,
pub border_color: Option<String>,
pub font_size: Option<String>,
pub font_weight: Option<String>,
pub font_family: Option<String>,
pub line_height: Option<String>,
pub text_align: Option<String>,
pub text_decoration: Option<String>,
pub letter_spacing: Option<String>,
pub border_radius: Option<String>,
pub border: Option<String>,
pub border_top: Option<String>,
pub border_right: Option<String>,
pub border_bottom: Option<String>,
pub border_left: Option<String>,
pub border_width: Option<String>,
pub box_shadow: Option<String>,
pub width: Option<String>,
pub height: Option<String>,
pub min_width: Option<String>,
pub min_height: Option<String>,
pub max_width: Option<String>,
pub max_height: Option<String>,
pub position: Option<String>,
pub top: Option<String>,
pub right: Option<String>,
pub bottom: Option<String>,
pub left: Option<String>,
pub z_index: Option<String>,
pub cursor: Option<String>,
pub opacity: Option<String>,
pub transition: Option<String>,
pub transform: Option<String>,
pub overflow: Option<String>,
pub visibility: Option<String>,
pub pointer_events: Option<String>,
pub user_select: Option<String>,
pub white_space: Option<String>,
pub word_break: Option<String>,
pub outline: Option<String>,
pub resize: Option<String>,
}Expand description
CSS Style builder with fluent API
§Example
use dioxus_ui_system::styles::Style;
use dioxus_ui_system::theme::ThemeTokens;
let theme = ThemeTokens::light();
let style = Style::new()
.flex()
.flex_col()
.items_center()
.gap(&theme.spacing, "md")
.bg(&theme.colors.primary)
.rounded(&theme.radius, "md")
.build();Fields§
§display: Option<String>§flex_direction: Option<String>§flex_wrap: Option<String>§align_items: Option<String>§align_self: Option<String>§justify_content: Option<String>§justify_items: Option<String>§gap: Option<String>§row_gap: Option<String>§column_gap: Option<String>§padding: Option<String>§padding_top: Option<String>§padding_right: Option<String>§padding_bottom: Option<String>§padding_left: Option<String>§margin: Option<String>§margin_top: Option<String>§margin_right: Option<String>§margin_bottom: Option<String>§margin_left: Option<String>§background_color: Option<String>§color: Option<String>§border_color: Option<String>§font_size: Option<String>§font_weight: Option<String>§font_family: Option<String>§line_height: Option<String>§text_align: Option<String>§text_decoration: Option<String>§letter_spacing: Option<String>§border_radius: Option<String>§border: Option<String>§border_top: Option<String>§border_right: Option<String>§border_bottom: Option<String>§border_left: Option<String>§border_width: Option<String>§box_shadow: Option<String>§width: Option<String>§height: Option<String>§min_width: Option<String>§min_height: Option<String>§max_width: Option<String>§max_height: Option<String>§position: Option<String>§top: Option<String>§right: Option<String>§bottom: Option<String>§left: Option<String>§z_index: Option<String>§cursor: Option<String>§opacity: Option<String>§transition: Option<String>§transform: Option<String>§overflow: Option<String>§visibility: Option<String>§pointer_events: Option<String>§user_select: Option<String>§white_space: Option<String>§word_break: Option<String>§outline: Option<String>§resize: Option<String>Implementations§
Source§impl Style
impl Style
Sourcepub fn inline_block(self) -> Self
pub fn inline_block(self) -> Self
Set display to inline-block
Sourcepub fn inline_flex(self) -> Self
pub fn inline_flex(self) -> Self
Set display to inline-flex
Set display to none
Sourcepub fn flex_nowrap(self) -> Self
pub fn flex_nowrap(self) -> Self
Set flex-wrap to nowrap
Sourcepub fn items_center(self) -> Self
pub fn items_center(self) -> Self
Set align-items to center
Sourcepub fn items_start(self) -> Self
pub fn items_start(self) -> Self
Set align-items to start
Sourcepub fn items_stretch(self) -> Self
pub fn items_stretch(self) -> Self
Set align-items to stretch
Sourcepub fn self_center(self) -> Self
pub fn self_center(self) -> Self
Set align-self to center
Sourcepub fn justify_center(self) -> Self
pub fn justify_center(self) -> Self
Set justify-content to center
Sourcepub fn justify_start(self) -> Self
pub fn justify_start(self) -> Self
Set justify-content to start
Sourcepub fn justify_end(self) -> Self
pub fn justify_end(self) -> Self
Set justify-content to end
Sourcepub fn justify_between(self) -> Self
pub fn justify_between(self) -> Self
Set justify-content to space-between
Sourcepub fn justify_around(self) -> Self
pub fn justify_around(self) -> Self
Set justify-content to space-around
Sourcepub fn justify_evenly(self) -> Self
pub fn justify_evenly(self) -> Self
Set justify-content to space-evenly
Sourcepub fn gap(self, spacing: &SpacingScale, size: &str) -> Self
pub fn gap(self, spacing: &SpacingScale, size: &str) -> Self
Set gap from spacing scale
Sourcepub fn row_gap(self, spacing: &SpacingScale, size: &str) -> Self
pub fn row_gap(self, spacing: &SpacingScale, size: &str) -> Self
Set row gap from spacing scale
Sourcepub fn column_gap(self, spacing: &SpacingScale, size: &str) -> Self
pub fn column_gap(self, spacing: &SpacingScale, size: &str) -> Self
Set column gap from spacing scale
Sourcepub fn p(self, spacing: &SpacingScale, size: &str) -> Self
pub fn p(self, spacing: &SpacingScale, size: &str) -> Self
Set padding from spacing scale
Sourcepub fn px(self, spacing: &SpacingScale, size: &str) -> Self
pub fn px(self, spacing: &SpacingScale, size: &str) -> Self
Set horizontal padding (left and right)
Sourcepub fn py(self, spacing: &SpacingScale, size: &str) -> Self
pub fn py(self, spacing: &SpacingScale, size: &str) -> Self
Set vertical padding (top and bottom)
Sourcepub fn pt(self, spacing: &SpacingScale, size: &str) -> Self
pub fn pt(self, spacing: &SpacingScale, size: &str) -> Self
Set top padding
Sourcepub fn pr(self, spacing: &SpacingScale, size: &str) -> Self
pub fn pr(self, spacing: &SpacingScale, size: &str) -> Self
Set right padding
Sourcepub fn pb(self, spacing: &SpacingScale, size: &str) -> Self
pub fn pb(self, spacing: &SpacingScale, size: &str) -> Self
Set bottom padding
Sourcepub fn pl(self, spacing: &SpacingScale, size: &str) -> Self
pub fn pl(self, spacing: &SpacingScale, size: &str) -> Self
Set left padding
Sourcepub fn m(self, spacing: &SpacingScale, size: &str) -> Self
pub fn m(self, spacing: &SpacingScale, size: &str) -> Self
Set margin from spacing scale
Sourcepub fn mx(self, spacing: &SpacingScale, size: &str) -> Self
pub fn mx(self, spacing: &SpacingScale, size: &str) -> Self
Set horizontal margin
Sourcepub fn my(self, spacing: &SpacingScale, size: &str) -> Self
pub fn my(self, spacing: &SpacingScale, size: &str) -> Self
Set vertical margin
Sourcepub fn mt(self, spacing: &SpacingScale, size: &str) -> Self
pub fn mt(self, spacing: &SpacingScale, size: &str) -> Self
Set top margin
Sourcepub fn mr(self, spacing: &SpacingScale, size: &str) -> Self
pub fn mr(self, spacing: &SpacingScale, size: &str) -> Self
Set right margin
Sourcepub fn mb(self, spacing: &SpacingScale, size: &str) -> Self
pub fn mb(self, spacing: &SpacingScale, size: &str) -> Self
Set bottom margin
Sourcepub fn ml(self, spacing: &SpacingScale, size: &str) -> Self
pub fn ml(self, spacing: &SpacingScale, size: &str) -> Self
Set left margin
Sourcepub fn text_color(self, color: &Color) -> Self
pub fn text_color(self, color: &Color) -> Self
Set text color
Sourcepub fn border_color(self, color: &Color) -> Self
pub fn border_color(self, color: &Color) -> Self
Set border color
Sourcepub fn text(self, typography: &TypographyScale, size: &str) -> Self
pub fn text(self, typography: &TypographyScale, size: &str) -> Self
Set typography from scale
Sourcepub fn font_weight(self, weight: u16) -> Self
pub fn font_weight(self, weight: u16) -> Self
Set font weight
Sourcepub fn font_family(self, family: &str) -> Self
pub fn font_family(self, family: &str) -> Self
Set font family
Sourcepub fn line_height(self, height: f32) -> Self
pub fn line_height(self, height: f32) -> Self
Set line height
Sourcepub fn text_align(self, align: &str) -> Self
pub fn text_align(self, align: &str) -> Self
Set text align
Sourcepub fn text_center(self) -> Self
pub fn text_center(self) -> Self
Set text align to center
Sourcepub fn text_right(self) -> Self
pub fn text_right(self) -> Self
Set text align to right
Sourcepub fn text_align_left(self) -> Self
pub fn text_align_left(self) -> Self
Set text align to left
Sourcepub fn no_underline(self) -> Self
pub fn no_underline(self) -> Self
Set text decoration to none
Sourcepub fn rounded(self, radius: &RadiusScale, size: &str) -> Self
pub fn rounded(self, radius: &RadiusScale, size: &str) -> Self
Set border radius from scale
Sourcepub fn rounded_px(self, px: u16) -> Self
pub fn rounded_px(self, px: u16) -> Self
Set border radius to specific value
Sourcepub fn rounded_full(self) -> Self
pub fn rounded_full(self) -> Self
Set border radius to full (circle/pill)
Sourcepub fn border_width(self, width: u8) -> Self
pub fn border_width(self, width: u8) -> Self
Set border width only
Sourcepub fn border_top(self, width: u8, color: &Color) -> Self
pub fn border_top(self, width: u8, color: &Color) -> Self
Set top border
Sourcepub fn border_right(self, width: u8, color: &Color) -> Self
pub fn border_right(self, width: u8, color: &Color) -> Self
Set right border
Sourcepub fn border_bottom(self, width: u8, color: &Color) -> Self
pub fn border_bottom(self, width: u8, color: &Color) -> Self
Set bottom border
Sourcepub fn border_left(self, width: u8, color: &Color) -> Self
pub fn border_left(self, width: u8, color: &Color) -> Self
Set left border
Sourcepub fn border_style(self, style: &str) -> Self
pub fn border_style(self, style: &str) -> Self
Set border style (dashed, dotted, etc.)
Sourcepub fn shadow_themed(self, theme: &ThemeTokens, size: &str) -> Self
pub fn shadow_themed(self, theme: &ThemeTokens, size: &str) -> Self
Set box shadow from theme
Sourcepub fn shadow_none(self) -> Self
pub fn shadow_none(self) -> Self
Remove box shadow
Sourcepub fn cursor_pointer(self) -> Self
pub fn cursor_pointer(self) -> Self
Set cursor to pointer
Sourcepub fn transition(self, transition: &str) -> Self
pub fn transition(self, transition: &str) -> Self
Set transition
Set overflow to hidden
Sourcepub fn overflow_auto(self) -> Self
pub fn overflow_auto(self) -> Self
Set overflow to auto
Sourcepub fn overflow_scroll(self) -> Self
pub fn overflow_scroll(self) -> Self
Set overflow to scroll
Sourcepub fn pointer_events_none(self) -> Self
pub fn pointer_events_none(self) -> Self
Disable pointer events
Sourcepub fn pointer_events_auto(self) -> Self
pub fn pointer_events_auto(self) -> Self
Enable pointer events
Sourcepub fn select_none(self) -> Self
pub fn select_none(self) -> Self
Disable user selection
Sourcepub fn whitespace_nowrap(self) -> Self
pub fn whitespace_nowrap(self) -> Self
Set white-space to nowrap
Sourcepub fn flex_shrink(self, value: u8) -> Self
pub fn flex_shrink(self, value: u8) -> Self
Set flex-shrink
Sourcepub fn bg_transparent(self) -> Self
pub fn bg_transparent(self) -> Self
Set transparent background
Sourcepub fn min_h_full(self) -> Self
pub fn min_h_full(self) -> Self
Set min-height to 100%
Sourcepub fn inset(self, value: &str) -> Self
pub fn inset(self, value: &str) -> Self
Set inset (top, right, bottom, left) - shorthand for absolute positioning
Sourcepub fn overflow_x_auto(self) -> Self
pub fn overflow_x_auto(self) -> Self
Set overflow-x to auto
Sourcepub fn overflow_y_auto(self) -> Self
pub fn overflow_y_auto(self) -> Self
Set overflow-y to auto