m3e/theme
theme provides Lustre support for the M3E Theme component
Types
Contrast is the contrast level in which to generate a color palette
pub type Contrast {
High
Medium
StandardContrast
}
Constructors
-
High -
Medium -
StandardContrast
Density controls layout compactness across density-aware components within a theme
pub type Density =
Int
Focus defines whether strong focus is enabled
pub type Focus {
Strong
Normal
}
Constructors
-
Strong -
Normal
Motion defines how components animate across the system
pub type Motion {
Expressive
Standard
}
Constructors
-
Expressive -
Standard
Scheme specifies the color scheme
pub type Scheme {
Auto
Dark
Light
}
Constructors
-
Auto -
Dark -
Light
Theme is the basis for an m3e-theme component
Fields:
- color: a HEX color from which to derive color palettes
- contrast: The contrast level of the theme
- density: The density of the theme
- motion: The motion of the theme
- scheme: The scheme of the theme
- strong_focus: Whether to enable strong focus indicators
pub opaque type Theme
Values
pub const default_color: String
pub fn default_config() -> Config
default_config creates a new Config with default values
pub const default_focus: Focus
pub fn from_config(config: Config, color: String) -> Theme
from_config constructs a Theme from a Config
pub fn render(
t: Theme,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates a Lustre Element from a Theme
Parameters:
- t: a Theme
- attributes: a list of additional Attributes
- children: a list of child Elements
pub fn render_config(
config: Config,
color: String,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element directly from a Config