fix(bricks): restore theme toggle in Bricks 2.4 - #35
Merged
DavidBabinec merged 1 commit intoSep 26, 2026
Merged
Conversation
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.
What
Restores the Core Framework dark/light preview toggle in Bricks 2.4 while preserving compatibility with the legacy toolbar. The toggle uses its own accessible markup, stays after sibling controls using CSS order, and remounts after toolbar changes without duplicating buttons or listeners. Theme state is synchronized on initialization and iframe loads.
Includes the rebuilt
packages/wp/assets/public/js/bricks_builder.jsusing the existing esbuild settings.Why
Bricks 2.4 uses
.bricks-toolbarwith position-specific IDs, so the old#bricks-toolbarlookup exits without inserting the toggle. Cloning a native button also copies its inline CSS order, which means appending it does not put it visually last. Bricks can recreate toolbars when its interface layout changes.Verification
bun run test:www: 25 suites and 156 tests passed.node --check packages/wp/assets/public/js/bricks_builder.js: passed.git diff --check: passed before committing.oxygen6_builder.ts(TS2550 at line 1059 and TS2531 at line 1516), also reproduced against the unchanged base. Excluding that unchanged file, the builder type check passes.