pub struct Style {
pub declarations: StyleDeclarationBlock,
}Expand description
Defines the style of an element.
Fields§
§declarations: StyleDeclarationBlockImplementations§
Source§impl Style
impl Style
Sourcepub fn with(self, declaration: StyleDeclaration) -> Self
pub fn with(self, declaration: StyleDeclaration) -> Self
Returns a new style with one declaration appended in source order.
Sourcepub fn with_animation(self, value: Animations) -> Self
pub fn with_animation(self, value: Animations) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_padding(self, value: Sides<LengthDefaultsToZero>) -> Self
pub fn with_padding(self, value: Sides<LengthDefaultsToZero>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_padding_inline(self, value: SpacePair<LengthDefaultsToZero>) -> Self
pub fn with_padding_inline(self, value: SpacePair<LengthDefaultsToZero>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_padding_block(self, value: SpacePair<LengthDefaultsToZero>) -> Self
pub fn with_padding_block(self, value: SpacePair<LengthDefaultsToZero>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_margin(self, value: Sides<LengthDefaultsToZero>) -> Self
pub fn with_margin(self, value: Sides<LengthDefaultsToZero>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_margin_inline(self, value: SpacePair<LengthDefaultsToZero>) -> Self
pub fn with_margin_inline(self, value: SpacePair<LengthDefaultsToZero>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_margin_block(self, value: SpacePair<LengthDefaultsToZero>) -> Self
pub fn with_margin_block(self, value: SpacePair<LengthDefaultsToZero>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_inset(self, value: Sides<Length>) -> Self
pub fn with_inset(self, value: Sides<Length>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_inset_inline(self, value: SpacePair<Length>) -> Self
pub fn with_inset_inline(self, value: SpacePair<Length>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_inset_block(self, value: SpacePair<Length>) -> Self
pub fn with_inset_block(self, value: SpacePair<Length>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_mask(self, value: Backgrounds) -> Self
pub fn with_mask(self, value: Backgrounds) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_gap(self, value: SpacePair<LengthDefaultsToZero>) -> Self
pub fn with_gap(self, value: SpacePair<LengthDefaultsToZero>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_flex_flow(self, value: FlexFlow) -> Self
pub fn with_flex_flow(self, value: FlexFlow) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_flex(self, value: Option<Flex>) -> Self
pub fn with_flex(self, value: Option<Flex>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_place_items(self, value: PlaceItems) -> Self
pub fn with_place_items(self, value: PlaceItems) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_place_content(self, value: PlaceContent) -> Self
pub fn with_place_content(self, value: PlaceContent) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_place_self(self, value: PlaceSelf) -> Self
pub fn with_place_self(self, value: PlaceSelf) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_grid_column(self, value: GridLine) -> Self
pub fn with_grid_column(self, value: GridLine) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_grid_row(self, value: GridLine) -> Self
pub fn with_grid_row(self, value: GridLine) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_grid_area(self, value: GridArea) -> Self
pub fn with_grid_area(self, value: GridArea) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_radius(self, value: BorderRadius) -> Self
pub fn with_border_radius(self, value: BorderRadius) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_width(self, value: Sides<Length>) -> Self
pub fn with_border_width(self, value: Sides<Length>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_inline_width(self, value: SpacePair<Length>) -> Self
pub fn with_border_inline_width(self, value: SpacePair<Length>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_block_width(self, value: SpacePair<Length>) -> Self
pub fn with_border_block_width(self, value: SpacePair<Length>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border(self, value: Border) -> Self
pub fn with_border(self, value: Border) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_top(self, value: Border) -> Self
pub fn with_border_top(self, value: Border) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_right(self, value: Border) -> Self
pub fn with_border_right(self, value: Border) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_bottom(self, value: Border) -> Self
pub fn with_border_bottom(self, value: Border) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_left(self, value: Border) -> Self
pub fn with_border_left(self, value: Border) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_style(self, value: Sides<BorderStyle>) -> Self
pub fn with_border_style(self, value: Sides<BorderStyle>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_border_color(self, value: Sides<ColorInput>) -> Self
pub fn with_border_color(self, value: Sides<ColorInput>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_outline(self, value: Border) -> Self
pub fn with_outline(self, value: Border) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_overflow(self, value: SpacePair<Overflow>) -> Self
pub fn with_overflow(self, value: SpacePair<Overflow>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_background(self, value: Backgrounds) -> Self
pub fn with_background(self, value: Backgrounds) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_font_synthesis(self, value: FontSynthesis) -> Self
pub fn with_font_synthesis(self, value: FontSynthesis) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_webkit_text_stroke(self, value: Option<TextStroke>) -> Self
pub fn with_webkit_text_stroke(self, value: Option<TextStroke>) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_text_decoration(self, value: TextDecoration) -> Self
pub fn with_text_decoration(self, value: TextDecoration) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_white_space(self, value: WhiteSpace) -> Self
pub fn with_white_space(self, value: WhiteSpace) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_text_wrap(self, value: TextWrap) -> Self
pub fn with_text_wrap(self, value: TextWrap) -> Self
Returns a new style with this shorthand expanded and appended in source order.
Sourcepub fn with_important(self, declaration: StyleDeclaration) -> Self
pub fn with_important(self, declaration: StyleDeclaration) -> Self
Returns a new style with one !important declaration appended in source order.
pub fn append_block(&mut self, declarations: StyleDeclarationBlock)
pub fn push(&mut self, declaration: StyleDeclaration, important: bool)
Sourcepub fn resource_urls(&self) -> impl Iterator<Item = &str>
pub fn resource_urls(&self) -> impl Iterator<Item = &str>
Collects resource URLs referenced by this style’s declarations.