Enum css_style::box_shadow::BoxShadow [−][src]
pub enum BoxShadow {
One(ShadowValue),
Multiple(Vec<ShadowValue>),
Initial,
Inherit,
None,
Unset,
}
Expand description
use css_style::{Style, color, unit::em};
use palette::rgb::Rgb;
Style::default()
// for single shadow
.and_box_shadow(|conf| {
conf.x(em(0.4))
.y(em(-0.8))
// rgb value f32 based, we can pass u32 hex value too e.g. 0xFFFFFFFF
.color((0.5, 0.1, 0.1))
// or we can use HTML colors
.color(color::named::BLUEVIOLET)
// shadow blur radius
.blur(em(1.0))
// spread radius
.spread(em(2.0))
// inset shadow
.inset()
})
// for multiple shadows
.and_box_shadow(|conf| {
conf
.push(|conf| {
conf.x(em(1.0))
.y(em(2.0))
.color(color::named::DIMGRAY)
})
.push(|conf| {
conf.x(em(-2.0))
.y(em(-4.0))
.color(color::named::RED)
})
});
Variants
One(ShadowValue)
Tuple Fields
0: ShadowValue
Multiple(Vec<ShadowValue>)
Tuple Fields
0: Vec<ShadowValue>
Initial
Inherit
None
Unset
Implementations
Trait Implementations
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for BoxShadow
impl UnwindSafe for BoxShadow
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more