Skip to content

Commit

Permalink
Exmplain why !important is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlende committed Sep 9, 2021
1 parent 358c456 commit 8c421cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/block-supports/duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ function gutenberg_render_duotone_support( $block_content, $block ) {
}
$selector = implode( ', ', $scoped );

// !important is needed because these styles render before global styles,
// and they should be overriding the duotone filters set by global styles.
$filter_style = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG
? $selector . " {\n\tfilter: " . $filter_property . " !important;\n}\n"
: $selector . '{filter:' . $filter_property . ' !important;}';
Expand Down

0 comments on commit 8c421cc

Please sign in to comment.