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§
type StyleClass: StyleClass
Provided Methods§
fn hover(self, style: impl FnOnce(Self) -> Self) -> Self
fn focus(self, style: impl FnOnce(Self) -> Self) -> Self
Sourcefn focus_visible(self, style: impl FnOnce(Self) -> Self) -> Self
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.
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
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.