Skip to content

Commit e9d69d8

Browse files
Moved allow_css only when needed
1 parent 43eb4ac commit e9d69d8

File tree

1 file changed

+3
-2
lines changed
  • src/plugins/theme-block-style-inheritance

1 file changed

+3
-2
lines changed

src/plugins/theme-block-style-inheritance/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function __construct() {
2121

2222
add_action( 'body_class', array( $this, 'add_body_class_block_style_inheritance' ) );
2323
add_filter( 'stackable_block_style_inheritance_inline_styles_nodep', array( $this, 'add_block_style_inheritance' ) );
24-
25-
add_filter( 'safecss_filter_attr_allow_css', array( $this, 'allow_css' ), 10, 2 );
2624
}
2725

2826
// Register the settings for block style inheritance
@@ -324,6 +322,9 @@ function add_block_style_inheritance( $current_css ) {
324322
$styles[] = $declaration;
325323
}
326324

325+
// Allow some CSS functions like color-mix() to be included in the generated CSS.
326+
add_filter( 'safecss_filter_attr_allow_css', array( $this, 'allow_css' ), 10, 2 );
327+
327328
$generated_css = wp_style_engine_get_stylesheet_from_css_rules( $styles );
328329
if ( $generated_css ) {
329330
$generated_css = "/* Block style inheritance */\n" . $generated_css;

0 commit comments

Comments
 (0)