pub enum BgSpec {
Solid(Rgba),
Linear {
angle_deg: f32,
stops: Vec<(f32, Rgba)>,
},
Radial {
radius: f32,
stops: Vec<(f32, Rgba)>,
},
Conic {
from_deg: f32,
stops: Vec<(f32, Rgba)>,
},
Image(String),
}Expand description
Parsed bg= value. Solid colors, gradients, and images share one
attribute surface so authors don’t pick between bg= and bg-gradient=.
Variants§
Solid(Rgba)
Solid color.
Linear
CSS-style linear gradient.
Fields
Radial
CSS-style radial gradient centred on the rect.
Fields
Conic
CSS-style conic (sweep) gradient.
Fields
Image(String)
url("path"): an image painted behind the element’s content, sized by
Attributes::bg_fit. The path is as authored; it resolves against
the app directory the way an <image src> does.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BgSpec
impl<'de> Deserialize<'de> for BgSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> TryFrom<&'a BgSpec> for Fill
A colour or gradient bg is a Fill. An image is not one: it paints
through the asset pipeline instead, and the conversion hands back the path
it names.
impl<'a> TryFrom<&'a BgSpec> for Fill
A colour or gradient bg is a Fill. An image is not one: it paints
through the asset pipeline instead, and the conversion hands back the path
it names.
impl StructuralPartialEq for BgSpec
Auto Trait Implementations§
impl Freeze for BgSpec
impl RefUnwindSafe for BgSpec
impl Send for BgSpec
impl Sync for BgSpec
impl Unpin for BgSpec
impl UnsafeUnpin for BgSpec
impl UnwindSafe for BgSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.