| 11 | impl AnsiTheme for DefaultAnsiTheme { |
| 12 | #[cfg(feature = "anstyle")] |
| 13 | fn get_anstyle(&self, kind: crate::SemanticKind, modifier: crate::SemanticModifier) -> anstyle::Style { |
| 14 | use crate::SemanticKind; |
| 15 | use anstyle::{AnsiColor, Color, Effects, Style}; |
| 16 | |
| 17 | let color = match kind { |
| 18 | SemanticKind::None => Color::Ansi(AnsiColor::White), |
| 19 | SemanticKind::Id => Color::Ansi256(214.into()), |
| 20 | SemanticKind::Tag => Color::Ansi256(203.into()), |
| 21 | // Bright green |
| 22 | SemanticKind::Class => Color::Ansi256(149.into()), |
| 23 | // Salmon/pink |
| 24 | SemanticKind::Wildcard => Color::Ansi256(203.into()), |
| 25 | // Bright green |
| 26 | SemanticKind::Attribute => Color::Ansi256(149.into()), |
| 27 | // Cyan |
| 28 | SemanticKind::Namespace => Color::Ansi256(81.into()), |
| 29 | // White |
| 30 | SemanticKind::Combinator => Color::Ansi(AnsiColor::White), |
| 31 | // Bright green |
| 32 | SemanticKind::PseudoClass => Color::Ansi256(149.into()), |
| 33 | // Bright green |
| 34 | SemanticKind::PseudoElement => Color::Ansi256(149.into()), |
| 35 | // Bright green |
| 36 | SemanticKind::LegacyPseudoElement => Color::Ansi256(149.into()), |
| 37 | // Bright green |
| 38 | SemanticKind::FunctionalPseudoClass => Color::Ansi256(149.into()), |
| 39 | // Bright green |
| 40 | SemanticKind::FunctionalPseudoElement => Color::Ansi256(149.into()), |
| 41 | |
| 42 | // Rule Elements |
| 43 | // Salmon/pink |
| 44 | SemanticKind::AtKeyword => Color::Ansi256(203.into()), |
| 45 | // Bright green |
| 46 | SemanticKind::Prelude => Color::Ansi256(149.into()), |
| 47 | |
| 48 | // Property Declarations |
| 49 | // Cyan |
| 50 | SemanticKind::Declaration => Color::Ansi256(81.into()), |
| 51 | // Cyan |
| 52 | SemanticKind::StyleValueKeyword => Color::Ansi256(81.into()), |
| 53 | // Purple |
| 54 | SemanticKind::StyleValueDimension => Color::Ansi256(141.into()), |
| 55 | // Purple |
| 56 | SemanticKind::StyleValueNumber => Color::Ansi256(141.into()), |
| 57 | // Yellow/Gold for strings |
| 58 | SemanticKind::StyleValueString => Color::Ansi256(220.into()), |
| 59 | // Blue for URLs |
| 60 | SemanticKind::StyleValueUrl => Color::Ansi256(39.into()), |
| 61 | // Magenta for colors |
| 62 | SemanticKind::StyleValueColor => Color::Ansi256(201.into()), |
| 63 | // Cyan for functions |
| 64 | SemanticKind::StyleValueFunction => Color::Ansi256(51.into()), |
| 65 | // Red for !important |
| 66 | SemanticKind::StyleValueImportant => Color::Ansi256(196.into()), |
| 67 | SemanticKind::Punctuation => Color::Ansi(AnsiColor::White), |
| 68 | }; |
| 69 | |
| 70 | let mut effects = Effects::new(); |