Repository navigation
Theme variables for the tree, combo box, context menu and form field editor colours - #364
Merged
Merged
Conversation
…editor colours The colours these components drew in fixed values now come from CSS variables a host can set on :root or a theme class. Each default is the colour the component drew before, so a host that sets nothing sees no change. - PDTree: --pd-tree-selected-bg and --pd-tree-selected-color for the selected node, and --pd-tree-node-radius and --pd-tree-node-inset-end for the shape the hover and the selection share. - PDComboBox: --pdcb-focus-border and --pdcb-focus-ring for the focused input. - PDContextMenu: --pd-contextmenu-bg, -color, -hover-bg, -border-color and -disabled-color; under Bootstrap 5.3's dark mode the same variables win, with the existing dark colours as defaults. - PDFormFieldEditor: --pd-form-editor-border-color for the frame around a field's editor. ThemeVariableStylesheetTests checks each variable and its default, and that no context menu colour is fixed. The four documentation pages gain a Colours section listing the variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 7 |
| Duplication | 0 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
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.
Summary
The tree, combo box, context menu and form field editor drew some colours in fixed values, so a host with a dark or coloured theme could only change them by overriding the library's scoped rules. Those colours now come from CSS variables a host can set on
:rootor on a theme class.Every default is the colour the component drew before, so a host that sets nothing sees no change.
--pd-tree-selected-bg#007bff--pd-tree-selected-colorinherit--pd-tree-node-radius(hover and selection share the shape)0--pd-tree-node-inset-end0--pdcb-focus-border#007bff--pdcb-focus-ringrgba(0, 123, 255, 0.25)--pd-contextmenu-bg#fff--pd-contextmenu-colorinherit--pd-contextmenu-hover-bg#eee--pd-contextmenu-border-colorrgba(0,0,0,.125)--pd-contextmenu-disabled-color#6c757d--pd-form-editor-border-color#ced4daUnder Bootstrap 5.3's
data-bs-theme="dark", the context menu keeps its existing dark colours as defaults, and a host's variables still win.Tests and documentation
ThemeVariableStylesheetTestschecks each variable and its default, and that no colour in the context menu's stylesheet is fixed (12 tests, passing locally).Why
Magic Suite's themes currently restyle these components from their own stylesheet, with selectors deep enough to outweigh the library's scoped rules. With these variables they can set the colours directly, and other hosts can theme the same components without overrides.
🤖 Generated with Claude Code