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<Clip>,
pub origin: Option<Origin>,
pub size: Option<Size>,
}
Expand description
use css_style::{prelude::*, Color, color, unit::em};
style()
.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<Clip>
§origin: Option<Origin>
§size: Option<Size>
Implementations§
Source§impl Background
impl Background
pub fn color(self, value: impl Into<Color>) -> Self
pub fn image(self, value: impl Into<Image>) -> Self
pub fn empty(self) -> Self
pub fn repeat_x(self) -> Self
pub fn repeat_y(self) -> Self
pub fn repeat(self) -> Self
pub fn repeat_with_space(self) -> Self
pub fn repeat_round(self) -> Self
pub fn no_repeat(self) -> Self
pub fn initial_repeat(self) -> Self
pub fn inherit_repeat(self) -> Self
pub fn attachment(self, value: impl Into<Attachment>) -> Self
pub fn scroll(self) -> Self
pub fn fixed(self) -> Self
pub fn local(self) -> Self
pub fn initial_attachment(self) -> Self
pub fn inherit_attachment(self) -> Self
pub fn position(self, value: impl Into<Position>) -> Self
pub fn center_top(self) -> Self
pub fn center(self) -> Self
pub fn center_bottom(self) -> Self
pub fn left_top(self) -> Self
pub fn left_center(self) -> Self
pub fn left_bottom(self) -> Self
pub fn right_top(self) -> Self
pub fn right_center(self) -> Self
pub fn right_bottom(self) -> Self
pub fn clip(self, value: impl Into<Clip>) -> Self
pub fn fill_under_border(self) -> Self
pub fn fill_inside_border(self) -> Self
pub fn fill_under_content(self) -> Self
pub fn origin(self, value: impl Into<Origin>) -> Self
pub fn image_fill_under_border(self) -> Self
pub fn image_inside_border(self) -> Self
pub fn image_under_content(self) -> Self
pub fn size(self, value: impl Into<Size>) -> Self
pub fn full(self) -> Self
pub fn half(self) -> Self
pub fn quarter(self) -> Self
pub fn auto_size(self) -> Self
pub fn cover(self) -> Self
pub fn contain(self) -> Self
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 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, 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