pub trait Theme: Clone + 'static {
// Required method
fn fast_cmp(&self, other: &Self) -> bool;
}
Expand description
A trait for themes: Themes contain shared data which can be used in your styles.
For example, you can define color, paddings, and so on in a datatype. Alternatively, you can use css variables which is probably even better. However, themes are an easy way to precompute some things, for example complex box-shadows. They can also be changed at runtime which will update all styles which depend on this theme.
If you do not need theme support, you can use EmptyTheme
Required Methods§
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.