pub struct Background {
pub color: Option<Color>,
pub image: Option<Image>,
pub repeat: Option<Repeat>,
pub attachment: Option<Attachment>,
pub position: Option<Position>,
pub clip: Option<Box>,
pub origin: Option<Box>,
pub size: Option<Size>,
}
Expand description
use css_style::{Style, Color, color, unit::em};
Style::default()
.and_background(|conf| {
conf.image("/bg/fullpage.png")
.color(color::named::WHITE)
.scroll()
});
Fields§
§color: Option<Color>
§image: Option<Image>
§repeat: Option<Repeat>
§attachment: Option<Attachment>
§position: Option<Position>
§clip: Option<Box>
§origin: Option<Box>
§size: Option<Size>
Implementations§
Source§impl Background
impl Background
pub fn color(self, value: impl Into<Color>) -> Background
pub fn image(self, value: impl Into<Image>) -> Background
pub fn empty(self) -> Background
pub fn repeat_x(self) -> Background
pub fn repeat_y(self) -> Background
pub fn repeat(self) -> Background
pub fn repeat_with_space(self) -> Background
pub fn repeat_round(self) -> Background
pub fn no_repeat(self) -> Background
pub fn initial_repeat(self) -> Background
pub fn inherit_repeat(self) -> Background
pub fn attachment(self, value: impl Into<Attachment>) -> Background
pub fn scroll(self) -> Background
pub fn fixed(self) -> Background
pub fn local(self) -> Background
pub fn initial_attachment(self) -> Background
pub fn inherit_attachment(self) -> Background
pub fn position(self, value: impl Into<Position>) -> Background
pub fn center_top(self) -> Background
pub fn center(self) -> Background
pub fn center_bottom(self) -> Background
pub fn left_top(self) -> Background
pub fn left_center(self) -> Background
pub fn left_bottom(self) -> Background
pub fn right_top(self) -> Background
pub fn right_center(self) -> Background
pub fn right_bottom(self) -> Background
pub fn clip(self, value: impl Into<Box>) -> Background
pub fn fill_under_border(self) -> Background
pub fn fill_inside_border(self) -> Background
pub fn fill_under_content(self) -> Background
pub fn origin(self, value: impl Into<Box>) -> Background
pub fn image_fill_under_border(self) -> Background
pub fn image_inside_border(self) -> Background
pub fn image_under_content(self) -> Background
pub fn size(self, value: impl Into<Size>) -> Background
pub fn full(self) -> Background
pub fn half(self) -> Background
pub fn quarter(self) -> Background
pub fn auto_size(self) -> Background
pub fn cover(self) -> Background
pub fn contain(self) -> Background
Trait Implementations§
Source§impl Clone for Background
impl Clone for Background
Source§fn clone(&self) -> Background
fn clone(&self) -> Background
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Background
impl Debug for Background
Source§impl Default for Background
impl Default for Background
Source§fn default() -> Background
fn default() -> Background
Returns the “default value” for a type. Read more
Source§impl<T> From<T> for Background
impl<T> From<T> for Background
Source§fn from(source: T) -> Background
fn from(source: T) -> Background
Converts to this type from the input type.
Source§impl PartialEq for Background
impl PartialEq for Background
Source§impl StyleUpdater for Background
impl StyleUpdater for Background
fn update_style(self, style: Style) -> Style
impl StructuralPartialEq for Background
Auto Trait Implementations§
impl Freeze for Background
impl RefUnwindSafe for Background
impl Send for Background
impl Sync for Background
impl Unpin for Background
impl UnwindSafe for Background
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
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,
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
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