| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
use ratatui::style::{Modifier, Style}; |
| 10 |
use ratatui::text::Span; |
| 11 |
|
| 12 |
use crate::theme::Theme; |
| 13 |
|
| 14 |
|
| 15 |
pub fn primary(theme: &Theme, s: impl Into<String>) -> Span<'static> { |
| 16 |
Span::styled(s.into(), Style::default().fg(theme.content_primary)) |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
pub fn muted(theme: &Theme, s: impl Into<String>) -> Span<'static> { |
| 21 |
Span::styled(s.into(), Style::default().fg(theme.content_muted)) |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
pub fn secondary(theme: &Theme, s: impl Into<String>) -> Span<'static> { |
| 26 |
Span::styled(s.into(), Style::default().fg(theme.content_secondary)) |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
pub fn bold(theme: &Theme, s: impl Into<String>) -> Span<'static> { |
| 31 |
Span::styled( |
| 32 |
s.into(), |
| 33 |
Style::default() |
| 34 |
.fg(theme.content_primary) |
| 35 |
.add_modifier(Modifier::BOLD), |
| 36 |
) |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
pub fn action(theme: &Theme, s: impl Into<String>) -> Span<'static> { |
| 43 |
Span::styled(s.into(), Style::default().fg(theme.action_primary)) |
| 44 |
} |
| 45 |
|