[][src]Struct khalas::css::style::StyleMap

pub struct StyleMap {
    pub map: IndexMap<St, String>,
}

Fields

map: IndexMap<St, String>

Methods

impl StyleMap[src]

pub fn add(&mut self, key: impl Into<St>, value: impl ToString) -> &mut Self[src]

This method provied a way to add custom style or css style that doesn't have it's own method yet.

use khalas::css::{Style, values as val, St};

div![
    Style::default()
        .add(St::UserSelect, val::None)
        .add(St::BoxSizing, val::BorderBox)
]

pub fn try_add(
    &mut self,
    key: impl Into<St>,
    value: Option<impl ToString>
) -> &mut Self
[src]

This method is similar add but it accept an optional value, if the passed value is None then nothing added to the style.

pub fn merge(&mut self, other: &impl ToStyleMap) -> &mut Self[src]

Merge this style map with other

pub fn try_merge(&mut self, other: Option<&impl ToStyleMap>) -> &mut Self[src]

This method is similar to merge but it accept an optional value.

Trait Implementations

impl Clone for StyleMap[src]

impl Debug for StyleMap[src]

impl Default for StyleMap[src]

Auto Trait Implementations

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.