feat(ui): load user theme files and resolve custom themes by name#476
Open
indaco wants to merge 1 commit into
Open
feat(ui): load user theme files and resolve custom themes by name#476indaco wants to merge 1 commit into
indaco wants to merge 1 commit into
Conversation
Users can define their own semantic colour palettes in a JSON file and have both the CLI and the dashboard honour them, selected by name or a file default. The file is read once at boot through a hardened path and validated all-or-nothing, falling back to the built-in themes on any problem so a bad file is never a crash or a partial apply. A custom name can never shadow a built-in.
de6dbde to
a1ba786
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Users can now define their own semantic colour themes in a JSON file and have both the CLI and the
mt tuidashboard honour them - with no call-site change.The file lives at
MALT_THEMES_FILE(else{prefix}/etc/malt/themes.json), carries multiple named palettes and adefaultmarker, and is read once at bootValidation is strict and all-or-nothing: a version gate, theme-count and name caps, all six roles present, in-range colours, and a resolvable
default. Any single failure rejects the whole file and malt keeps the built-in themes - onenotice, never a crash, never a partial apply. A custom name can never shadow a built-in (an explicit
MALT_THEME=draculaalways selects the built-in), and a theme whose polarity contradicts the detected background degrades to the default exactly like a built-in. Degradation is wholesale on the truecolor gate, with one refinement: a theme written entirely from 256-colour indexes also paints on a 256-colour terminal, so that colour form is not dead weight.Related Issue
Notes for Reviewers
This is part 2 of 2 in a stack made with GitButler: