-
Notifications
You must be signed in to change notification settings - Fork 1
feat: builder-agnostic CSS delivery and de-Bricks admin UI #170
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
Merged
jackgranatowski
merged 2 commits into
main
from
claude/gutenberg-integration-scope-jSOZX
May 31, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| <?php | ||
| /** | ||
| * Core SLASHED CSS enqueue — builder-agnostic. | ||
| * | ||
| * Registers and enqueues the `slashed-framework` stylesheet on every | ||
| * WordPress site where the plugin is active, regardless of which builder | ||
| * (if any) is installed. This makes SLASHED usable with custom themes, | ||
| * classic themes, or any setup that does not match a bundled integration. | ||
| * | ||
| * Builder integrations add their own inline rules on top of the | ||
| * `slashed-framework` handle (e.g. Bricks dark-mode bridge, Gutenberg | ||
| * dark-mode bridge). Token override CSS is injected separately by | ||
| * slashed_inject_token_overrides() at priority 20. | ||
| * | ||
| * @package SLASHED | ||
| */ | ||
|
|
||
| if ( ! defined( 'ABSPATH' ) ) { | ||
| exit; | ||
| } | ||
|
|
||
| /** | ||
| * Class Slashed_Core_Enqueue | ||
| */ | ||
| class Slashed_Core_Enqueue { | ||
|
|
||
| public function __construct() { | ||
| add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend' ) ); | ||
| add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor' ) ); | ||
| } | ||
|
|
||
| /** | ||
| * Enqueue the framework stylesheet on the public frontend (and Bricks canvas iframe). | ||
| * | ||
| * Skips the Bricks builder-panel context: loading CSS resets into the | ||
| * builder admin chrome breaks Bricks' toolbar icons and colours. | ||
| * bricks_is_builder_main() returns true only for that panel — the canvas | ||
| * iframe and public frontend both pass this guard correctly. | ||
| */ | ||
| public function enqueue_frontend() { | ||
| if ( function_exists( 'bricks_is_builder_main' ) && bricks_is_builder_main() ) { | ||
| return; | ||
| } | ||
|
|
||
| $url = Slashed_CSS_Loader::get_url(); | ||
| if ( '' === $url ) { | ||
| return; | ||
| } | ||
|
|
||
| wp_enqueue_style( 'slashed-framework', $url, array(), Slashed_CSS_Loader::get_version( $url ) ); | ||
|
|
||
| // HTML font-size override — affects all rem-based framework values. | ||
| $settings = Slashed_Token_Store::get_plugin_settings(); | ||
| $font_size = isset( $settings['html_font_size'] ) ? (string) $settings['html_font_size'] : ''; | ||
| if ( '100' === $font_size || '62.5' === $font_size ) { | ||
| wp_add_inline_style( 'slashed-framework', 'html { font-size: ' . $font_size . '% !important; }' ); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Enqueue the framework stylesheet in the block editor. | ||
| * | ||
| * Fires for both the post editor and FSE site editor. Styles are injected | ||
| * into the editor iframe so they affect the editing canvas without touching | ||
| * the surrounding wp-admin chrome. | ||
| */ | ||
| public function enqueue_editor() { | ||
| $url = Slashed_CSS_Loader::get_url(); | ||
| if ( '' === $url ) { | ||
| return; | ||
| } | ||
| wp_enqueue_style( 'slashed-framework', $url, array(), Slashed_CSS_Loader::get_version( $url ) ); | ||
|
|
||
| // Mirror the frontend rem-base override so the iframed editor canvas | ||
| // matches the public site. The block editor is always iframed in WP 6.4+ | ||
| // (our declared minimum), so this rule targets the canvas <html>, not | ||
| // the surrounding wp-admin chrome. | ||
| $settings = Slashed_Token_Store::get_plugin_settings(); | ||
| $font_size = isset( $settings['html_font_size'] ) ? (string) $settings['html_font_size'] : ''; | ||
| if ( '100' === $font_size || '62.5' === $font_size ) { | ||
| wp_add_inline_style( 'slashed-framework', 'html { font-size: ' . $font_size . '% !important; }' ); | ||
| } | ||
| } | ||
| } | ||
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
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.