generated from nhcarrigan/template
feat: add high contrast mode for accessibility
- Add HighContrast variant to Theme enum in Rust backend - Add high-contrast CSS theme with pure black/white for max contrast - Use bright saturated colors for syntax highlighting - Add High Contrast button to theme selector with accessibility tooltip - Follows WCAG guidelines for contrast ratios Closes #20
This commit is contained in:
@@ -123,6 +123,8 @@ pub enum Theme {
|
||||
#[default]
|
||||
Dark,
|
||||
Light,
|
||||
#[serde(rename = "high-contrast")]
|
||||
HighContrast,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -185,8 +187,13 @@ mod tests {
|
||||
fn test_theme_serialization() {
|
||||
let dark = Theme::Dark;
|
||||
let light = Theme::Light;
|
||||
let high_contrast = Theme::HighContrast;
|
||||
|
||||
assert_eq!(serde_json::to_string(&dark).unwrap(), "\"dark\"");
|
||||
assert_eq!(serde_json::to_string(&light).unwrap(), "\"light\"");
|
||||
assert_eq!(
|
||||
serde_json::to_string(&high_contrast).unwrap(),
|
||||
"\"high-contrast\""
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user