Struct css_style::background::Background
source · [−]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
sourceimpl 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
sourceimpl Clone for Background
impl Clone for Background
sourcefn clone(&self) -> Background
fn clone(&self) -> Background
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Background
impl Debug for Background
sourceimpl Default for Background
impl Default for Background
sourcefn default() -> Background
fn default() -> Background
Returns the “default value” for a type. Read more
sourceimpl<T: Into<Color>> From<T> for Background
impl<T: Into<Color>> From<T> for Background
sourceimpl PartialEq<Background> for Background
impl PartialEq<Background> for Background
sourcefn eq(&self, other: &Background) -> bool
fn eq(&self, other: &Background) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Background) -> bool
fn ne(&self, other: &Background) -> bool
This method tests for !=
.
sourceimpl StyleUpdater for Background
impl StyleUpdater for Background
fn update_style(self, style: Style) -> Style
impl StructuralPartialEq for Background
Auto Trait Implementations
impl RefUnwindSafe for Background
impl Send for Background
impl Sync for Background
impl Unpin for Background
impl UnwindSafe for Background
Blanket Implementations
sourceimpl<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>,
sourcefn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified method Read more
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford method by default Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, U> IntoColor<U> for T where
U: FromColor<T>,
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
sourcefn 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
sourceimpl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
sourcefn 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