Available Themes
Markdown-OS includes 6 built-in themes with automatic syntax highlighting and Mermaid coordination:- Default Light
- Default Dark
- Dracula
- Nord Light
- Nord Dark
- Lofi
Clean, professional light theme with blue accents.
- Background:
#f7f8fa(light gray) - Text:
#17233b(dark blue-gray) - Accent:
#2563eb(blue)
Switching Themes
Theme Dropdown
Click the color dots in the top-right corner to open the theme selector:- Theme name (e.g., “Default Dark”)
- Color preview dots (background, text, accent)
- Active theme indicator (checkmark)
Keyboard Navigation
The theme dropdown is fully keyboard accessible:EnterorSpace- Open/close dropdownArrow Up/Down- Navigate themesEnter- Select highlighted themeEscape- Close dropdown
Theme Persistence
Selected themes are saved tolocalStorage:
- Browser restarts
- Different files and directories
- Multiple editor sessions
If
localStorage is unavailable (private browsing, storage quota exceeded), themes fall back to system preference.System Theme Detection
On first launch, the editor detects your operating system’s color scheme:prefers-color-scheme CSS media query to match your system settings:
- macOS: System Preferences → General → Appearance
- Windows: Settings → Personalization → Colors
- Linux: Varies by desktop environment
Theme Architecture
CSS Custom Properties
Themes are implemented with CSS variables inthemes.css:
Theme Application
When you select a theme, theThemeManager class:
-
Sets data attribute on
<html>element: -
Updates highlight.js stylesheet:
-
Configures Mermaid theme:
-
Emits theme change event:
Changing themes re-renders all Mermaid diagrams to match the new color scheme.
Syntax Highlighting
Highlight.js Integration
Each theme specifies ahighlight.js stylesheet:
The stylesheet is dynamically loaded:
Mermaid Theme Coordination
Mermaid diagrams use theme-coordinated color schemes:Creating Custom Themes
While Markdown-OS doesn’t currently support user-defined themes in the UI, you can add custom themes by modifying the source:1
Define theme object
Add your theme to the
THEMES array in static/js/theme.js:2
Add CSS variables
Define your theme’s CSS custom properties in
static/css/themes.css:3
Test and refine
Reload the editor and select your custom theme from the dropdown. Test all UI components to ensure consistent appearance.
Theme Variables Reference
Common variables used across themes:Core Colors
Semantic Colors
Component-Specific
File Tree & Tabs
Accessibility Considerations
Color Contrast
All themes meet WCAG AA contrast requirements for normal text (4.5:1):Reduced Motion
Theme transitions respect theprefers-reduced-motion setting:
Focus Indicators
Focus rings use theme-aware accent colors:Performance
Theme Switching Speed
Theme changes are near-instantaneous because:- CSS variables update synchronously
- No page reload required
- Highlight.js stylesheet loads from CDN cache
- Mermaid diagrams re-render asynchronously