Expand description
SalsaTheme provides a styling system for ratatui apps.
It has a simple flat naming scheme.
But it can store
- ratatui Style
- composite styles as used by rat-widget. eg CheckboxStyle
- practically anything else.
§Naming styles
-
It has an extension trait for Style that adds constants for known styles. In the same manner you can add your application specific styles and have them with code completion.
-
For rat-widget composite style it defines an anchor struct WidgetStyle that performs the same purpose.
§Usage
// ratatui Style
let s = theme.style::<Style>(Style::SELECT);
// composite style
Checkbox::new()
.styles(theme.style(WidgetStyle::CHECKBOX))
.render(area, buf, &mut state);Modules§
- palette
- Palette is the color palette for salsa-themes.
- palettes
- Currently shipped palettes.
- theme
- SalsaTheme is the main structure for themes.
- themes
Structs§
- Widget
Style - Anchor struct for the names of composite styles used by rat-widget’s.
Traits§
- RatWidget
Color - Extension trait for Color that defines standard names used by rat-theme to define color-aliases.
- Style
Name - Extension trait for Style that defines some standard names used by rat-theme/rat-widget
Functions§
- create_
palette - Create one of the defined palettes.
- create_
theme - Create one of the defined themes.
- log_
style_ define - Log style definition. May help debugging styling problems …
- salsa_
palettes - All defined color palettes.
- salsa_
themes - All defined rat-salsa themes.