Skip to content

Commit

Permalink
Update packages/block-editor/src/components/dark-editor-style/index.js
Browse files Browse the repository at this point in the history
Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
  • Loading branch information
scruffian and aristath committed Jan 15, 2021
1 parent 3975412 commit 81a6fa2
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ export default function DarkEditorStyle( ref ) {
.getComputedStyle( editorStylesWrapper[ 0 ], null )
.getPropertyValue( 'background-color' );

// Calculate the luminosity (0 - 255)
const brightness = tinycolor( backgroundColor ).getBrightness();

if ( brightness > 100 ) {
if ( tinycolor( backgroundColor ).getLuminance() > 0.5 ) {
// Is 100 the right number?
const body = ownerDocument.getElementsByTagName( 'body' )[ 0 ];
// If we only remove it rather than adding it, then if themes don't declare support this will have no impact
Expand Down

0 comments on commit 81a6fa2

Please sign in to comment.