Struct css_style::style::Style[][src]

pub struct Style { /* fields omitted */ }
Expand description

This is the main struct used to build and manipulate css properties, it provieds many methods to do that.

use css_style::{Style, color, unit::{ms, px}};

Style::default()
    .and_transition(|conf| {
        conf
            .insert("opacity", |conf| conf.duration(ms(150.)).ease())
            .insert("transform", |conf| conf.duration(ms(150.)).ease())
            .insert("visibility", |conf| conf.duration(ms(150.)).ease())
    })
    .and_position(|conf| conf.absolute())
    .and_background(|conf| conf.color(color::named::WHITE))
    .and_border(|conf| {
        conf.none()
            .width(px(0))
            .radius(px(4))
    })
    .and_padding(|conf| conf.x(px(4)).y(px(2)))
    .and_margin(|conf| conf.top(px(2)))
    .insert("box-shadow", "0 2px 8px rgba(0, 35, 11, 0.15)");

Implementations

This method convert this style to html style value

Insert a new css key value pair, or overwrite an existing one.

Same as insert but take Option

Merge two style

Same as merge but take Option

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Setter for $prop_ty

Setter for $prop_ty that takes Option<$prop_ty

Setter for $prop_ty that takes a closure which returns $prop_ty

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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