-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: Add multi-template theme support with Tokyonight variants #38
base: main
Are you sure you want to change the base?
Conversation
- Implement dynamic template handling system to support Catppuccin and Tokyo Night themes - Add Tokyo Night variants (Storm, Day, Night, Moon) with dedicated color schemes - Introduce template-based generation with separate TOML configurations - Expand color variables system with precise mappings for each theme family - Add validation for template placeholders and color consistency - Update README generation to handle theme-specific metadata and modes
Thanks for the change, but I don't want to introduce a new template file because it would increase maintenance cost. The whole purpose of I have a few questions:
|
While aiming for theme-agnosticism, Tokyonight's structure fundamentally differs in:1. Structural Divergence Between Theme FamiliesTokyo Night requires components that don't exist in Catppuccin's design system: # Tokyo Night-specific sections
[confirm]
btn_yes = { bg = "${surface2}" }
[spot]
border = { fg = "${border_accent}" } 2. Needs Additional Colors
3. Forcing these into a single template would:
4. Separate templates actually reduce maintenance by:
I'm happy to demonstrate how this approach keeps the core engine simple while accommodating structural differences between theme philosophies. |
Which components, can you elaborate on them?
Which colors? Can these colors be merged or omitted? If they can't be omitted, meaning they are necessary colors, is it possible to support them on top of the existing Currently, Yazi's color system supports 16 colors. From my experience, this should be enough. Too many colors usually lead to more visual confusion. Supporting all colors in a single theme is not the goal here. For example, Catppuccin provides 26 colors, but Yazi only uses 16 of them. |
[confirm]
border = { fg = "#0db9d7" }
title = { fg = "#27a1b9" }
content = {}
list = {}
btn_yes = { bg = "#283457" }
btn_no = {}
btn_labels = [ " [Y]es ", " (N)o " ]
[spot]
border = { fg = "#27a1b9" }
title = { fg = "#27a1b9" } This Sections don't exist in Catppuccin's design.andconst VARIANTS = {
"Tokyonight Storm": {
text: "#c0caf5",
text_secondary: "#a9b1d6",
text_inverted: "#1d202f",
background: "#24283b",
background_alt: "#1f2335",
surface: "#292e42",
surface1: "#3b4261",
surface2: "#2e3c64",
surface3: "#22374b",
primary: "#7aa2f7",
secondary: "#bb9af7",
tertiary: "#9d7cd8",
accent: "#0db9d7",
border_accent: "#29a4bd",
red: "#f7768e",
red_dark: "#db4b4b",
green: "#9ece6a",
green_light: "#73daca",
yellow: "#e0af68",
orange: "#ff9e64",
cyan: "#41a6b5",
cyan_light: "#7dcfff",
blue_dark: "#3d59a1",
onSurface1: "#3b4261",
onSurface2: "#414868",
onSurface3: "#565f89",
},
} here are the full color variablesHere is some Screenshots , i don't think it is visually confusing |
I noticed that Tokyonight provides 33 colors, which seems like too many to me. It's hard to use all of them. Is it possible to refine it down to just 16 colors? Even for a theme like Catppuccin, which offers 36 colors, only 16 are actually used, and there's not much of a noticeable visual difference. As for other popular themes like Solarized and Dracula, they provide even fewer colors—16 and 11, respectively. |
If it is too many for you don't worry close the PR |
✨ feat: Add multi-template theme support with Tokyonight variants
What This PR Does
Adds support for generating themes from multiple templates, starting with:
Key Additions
✅ Dynamic template handling system
✅ 4 new Tokyonight color schemes
✅ Template-specific color validation
Technical Approach
Template Isolation
Color Safety
Backward Compatibility
Template System
Plugin Enhancement
This is a significant addition to Yazi's theming ecosystem, enabling:
Verification Checklist
Benefits:
I believe this PR is a valuable addition to the Yazi project.