Skip to content

Commit

Permalink
Remove background, use block's currentColor
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed May 16, 2024
1 parent 6d2a0bb commit 3db9172
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ const GridVisualizerGrid = forwardRef( ( { blockElement }, ref ) => {
style={ gridInfo.style }
>
{ Array.from( { length: gridInfo.numItems }, ( _, i ) => (
<div key={ i } className="block-editor-grid-visualizer__item" />
<div
key={ i }
className="block-editor-grid-visualizer__item"
style={ {
boxShadow: `inset 0 0 0 1px color-mix(in srgb, ${ gridInfo.currentColor } 20%, #0000)`,
} }
/>
) ) }
</div>
);
Expand All @@ -84,6 +90,7 @@ function getGridInfo( blockElement ) {
const numItems = numColumns * numRows;
return {
numItems,
currentColor: getComputedCSS( blockElement, 'color' ),
style: {
gridTemplateColumns,
gridTemplateRows,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
}

.block-editor-grid-visualizer__item {
background-color: color-mix(in srgb, currentColor 10%, transparent);
box-shadow: inset 0 0 0 $border-width color-mix(in srgb, currentColor 20%, #0000);
outline: 1px solid transparent;
border-radius: $radius-block-ui;
}
Expand Down

0 comments on commit 3db9172

Please sign in to comment.