We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
You can find this implemented in Overture Promotions's core.php. Essentially, the code wasn't loaded in the iframe-ed editor, but this forced it to:
/** * Allow access to current background color var * * This let's you do things like: * .thing { * border: 1px solid var(--c-bg); * } * So, for .thing.has-0-000-background-color * you'll get a black border, and for * .thing.has-0-900-background-color you'll * get a white border, matching their respective * backgrounds. It's often quite useful. */ function aquamin_bg_css() { $style_html = ''; $colors = wp_get_global_settings( array( 'color', 'palette', 'theme' ) ); $site_background = wp_get_global_styles( array( 'color', 'background' ) ); if ( $colors ) { $styles = array( sprintf( ':root,.is-root-container{--c-bg:%s;}/*%s*/', $site_background, __( 'Value of theme.json\'s styles.color.background' ) ) ); foreach( $colors as $color ) { array_push( $styles, sprintf( '.has-%s-background-color{--c-bg:var(--c-%s)}/*%s*/', $color[ 'slug' ], $color[ 'slug' ], $color[ 'name' ] ) ); } $style_html = implode( "\n", $styles ); } return $style_html; } add_action( 'wp_enqueue_scripts', 'aquamin_bg_front_end', 50 ); function aquamin_bg_front_end() { $style_html = aquamin_bg_css(); if ( $style_html ) { wp_add_inline_style( 'aquamin-style', $style_html ); } } add_filter( 'block_editor_settings_all', 'aquamin_bg_back_end', 10,2 ); function aquamin_bg_back_end( $editor_settings, $editor_context ) { $style_html = aquamin_bg_css(); if ( $style_html ) { $editor_settings["styles"][] = array( "css" => $style_html ); } return $editor_settings; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
You can find this implemented in Overture Promotions's core.php. Essentially, the code wasn't loaded in the iframe-ed editor, but this forced it to:
The text was updated successfully, but these errors were encountered: