m3e/theme
Theme is a non-visual element responsible for application-level theming.
This file was generated by m3e/generator
DO NOT EDIT
Types
Config is a public record for configuring this component.
pub type Config {
Config(
color: String,
contrast: contrast_level.ContrastLevel,
density: Float,
scheme: color_scheme.ColorScheme,
strong_focus: StrongFocus,
motion: motion_scheme.MotionScheme,
)
}
Constructors
-
Config( color: String, contrast: contrast_level.ContrastLevel, density: Float, scheme: color_scheme.ColorScheme, strong_focus: StrongFocus, motion: motion_scheme.MotionScheme, )
StrongFocus is whether to enable strong focus indicators.
pub type StrongFocus {
IsStrongFocus
IsNotStrongFocus
}
Constructors
-
IsStrongFocus -
IsNotStrongFocus
Theme is a View Model for this component
Fields:
- color: The hex color from which to derive dynamic color palettes.
- contrast: The contrast level of the theme.
- density: The density scale (0, -1, -2).
- scheme: The color scheme of the theme.
- strong_focus: Whether to enable strong focus indicators.
- motion: The motion scheme.
pub opaque type Theme
Values
pub fn contrast(
record: Theme,
contrast: contrast_level.ContrastLevel,
) -> Theme
contrast sets the value of contrast for this Theme.
pub const default_color: String
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_contrast: contrast_level.ContrastLevel
pub const default_density: Float
pub const default_motion: motion_scheme.MotionScheme
pub const default_scheme: color_scheme.ColorScheme
pub const default_strong_focus: StrongFocus
pub fn density(record: Theme, density: Float) -> Theme
density sets the value of density for this Theme.
pub fn from_config(config: Config) -> Theme
from_config creates a new Theme from the given configuration.
pub fn motion(
record: Theme,
motion: motion_scheme.MotionScheme,
) -> Theme
motion sets the value of motion for this Theme.
pub fn render(
model: Theme,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates a Lustre Element for a Theme
pub fn render_config(
c: Config,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element from a Theme Config
pub fn scheme(
record: Theme,
scheme: color_scheme.ColorScheme,
) -> Theme
scheme sets the value of scheme for this Theme.
pub fn strong_focus(
record: Theme,
strong_focus: StrongFocus,
) -> Theme
strong_focus sets the value of strong_focus for this Theme.