Trait CustomStyle

Source
pub trait CustomStyle:
    Default
    + Clone
    + Into<Style>
    + From<Style> {
    type StyleClass: StyleClass;

    // Provided methods
    fn style(self, style: impl FnOnce(Style) -> Style) -> Self { ... }
    fn hover(self, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn focus(self, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn focus_visible(self, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn selected(self, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn disabled(self, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn dark_mode(self, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn active(self, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn responsive(
        self,
        size: ScreenSize,
        style: impl FnOnce(Self) -> Self,
    ) -> Self { ... }
    fn apply_if(self, cond: bool, style: impl FnOnce(Self) -> Self) -> Self { ... }
    fn transition<P: StyleProp>(self, _prop: P, transition: Transition) -> Self { ... }
}

Required Associated Types§

Provided Methods§

Source

fn style(self, style: impl FnOnce(Style) -> Style) -> Self

Get access to a normal style

Source

fn hover(self, style: impl FnOnce(Self) -> Self) -> Self

Source

fn focus(self, style: impl FnOnce(Self) -> Self) -> Self

Source

fn focus_visible(self, style: impl FnOnce(Self) -> Self) -> Self

Similar to the :focus-visible css selector, this style only activates when tab navigation is used.

Source

fn selected(self, style: impl FnOnce(Self) -> Self) -> Self

Source

fn disabled(self, style: impl FnOnce(Self) -> Self) -> Self

Source

fn dark_mode(self, style: impl FnOnce(Self) -> Self) -> Self

Source

fn active(self, style: impl FnOnce(Self) -> Self) -> Self

Source

fn responsive(self, size: ScreenSize, style: impl FnOnce(Self) -> Self) -> Self

Source

fn apply_if(self, cond: bool, style: impl FnOnce(Self) -> Self) -> Self

Source

fn transition<P: StyleProp>(self, _prop: P, transition: Transition) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§