Skip to content

Commit

Permalink
Polish theme colors and fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Aug 2, 2023
1 parent 3f8ca88 commit 177066e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/edit-site/src/components/canvas-spinner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ const { ProgressBar } = unlock( componentsPrivateApis );
const { useGlobalStyle } = unlock( blockEditorPrivateApis );

export default function CanvasSpinner() {
const [ textColor ] = useGlobalStyle( 'color.text' );
const [ fallbackTrackColor ] = useGlobalStyle( 'color.text' );
const { highlightedColors } = useStylesPreviewColors();

const trackColor = highlightedColors[ 0 ]?.color ?? textColor;
const trackColor = highlightedColors[ 1 ]?.color ?? fallbackTrackColor;
const trackColord = colord( trackColor );
const indicatorColor = trackColord.isDark()
const fallbackIndicatorColor = trackColord.isDark()
? trackColord.tints( 3 )[ 1 ].toHex()
: trackColord.shades( 3 )[ 1 ].toHex();
const indicatorColor =
highlightedColors[ 0 ]?.color ?? fallbackIndicatorColor;

return (
<div className="edit-site-canvas-spinner">
Expand Down

0 comments on commit 177066e

Please sign in to comment.