#[non_exhaustive]pub struct BoxShadow {
pub inset: bool,
pub offset_x: LengthDefaultsToZero,
pub offset_y: LengthDefaultsToZero,
pub blur_radius: LengthDefaultsToZero,
pub spread_radius: LengthDefaultsToZero,
pub color: ColorInput,
}Expand description
Represents a box shadow with all its properties.
Construct with BoxShadow::builder.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.inset: boolWhether the shadow is inset (inside the element) or outset (outside the element).
offset_x: LengthDefaultsToZeroHorizontal offset of the shadow.
offset_y: LengthDefaultsToZeroVertical offset of the shadow.
blur_radius: LengthDefaultsToZeroBlur radius of the shadow. Higher values create a more blurred shadow.
spread_radius: LengthDefaultsToZeroSpread radius of the shadow. Positive values expand the shadow, negative values shrink it.
color: ColorInputColor of the shadow.
Implementations§
Source§impl BoxShadow
impl BoxShadow
Sourcepub fn builder() -> BoxShadowBuilder<((), (), (), (), (), ())>
pub fn builder() -> BoxShadowBuilder<((), (), (), (), (), ())>
Create a builder for building BoxShadow.
On the builder, call .inset(...)(optional), .offset_x(...)(optional), .offset_y(...)(optional), .blur_radius(...)(optional), .spread_radius(...)(optional), .color(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of BoxShadow.
Trait Implementations§
impl Copy for BoxShadow
Source§impl<'i> FromCss<'i> for BoxShadow
impl<'i> FromCss<'i> for BoxShadow
Source§fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, BoxShadow>
fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, BoxShadow>
Parses a box-shadow value from CSS input.
The box-shadow syntax allows for the following components in any order:
- inset keyword (optional)
- Two length values for horizontal and vertical offsets (required)
- Two optional length values for blur radius and spread radius
- A color value (optional)
Examples:
box-shadow: 2px 4px;box-shadow: 2px 4px 6px;box-shadow: 2px 4px 6px 8px;box-shadow: 2px 4px red;box-shadow: inset 2px 4px 6px red;