Skip to content

Commit

Permalink
Add fallback Cover block colors when serving a Reader theme
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Apr 8, 2021
1 parent 99d01d0 commit 2347340
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/ReaderThemeLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,22 @@ function () {
$this->disable_widgets();
add_filter( 'customize_previewable_devices', [ $this, 'customize_previewable_devices' ] );
add_action( 'customize_register', [ $this, 'remove_customizer_themes_panel' ], 11 );

// Add fallback style for cover block in case theme palette of active theme is not the same as the reader theme.
add_action(
'wp_enqueue_scripts',
function () {
wp_add_inline_style(
'amp-default',
'
.wp-block-cover {
background: black;
color: white;
}
'
);
}
);
}

/**
Expand Down

0 comments on commit 2347340

Please sign in to comment.