Skip to main content

orbital_shell/tokens/
stroke_width.rs

1//! Stroke widths for borders, dividers, and focus rings.
2
3/// Stroke width on the Orbital scale.
4#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
5pub enum StrokeWidth {
6    /// Hairline dividers, column underlines in nav.
7    Thin,
8    /// Focus ring and strong underlines (capability tab indicator).
9    Thick,
10    Thicker,
11    Thickest,
12}
13
14impl StrokeWidth {
15    pub const fn as_class(self) -> &'static str {
16        match self {
17            Self::Thin => "orbital-token-stroke-thin",
18            Self::Thick => "orbital-token-stroke-thick",
19            Self::Thicker => "orbital-token-stroke-thicker",
20            Self::Thickest => "orbital-token-stroke-thickest",
21        }
22    }
23
24    pub const fn as_token(self) -> &'static str {
25        match self {
26            Self::Thin => "var(--orb-stroke-thin)",
27            Self::Thick => "var(--orb-stroke-thick)",
28            Self::Thicker => "var(--orb-stroke-thicker)",
29            Self::Thickest => "var(--orb-stroke-thickest)",
30        }
31    }
32}