Skip to content

Commit

Permalink
ToolsPanel: Tighten grid gaps (#43424)
Browse files Browse the repository at this point in the history
* ToolsPanel: Tighten grid gaps

* Add changelog

* Replace snapshot test with more explicit test
  • Loading branch information
mirka committed Aug 19, 2022
1 parent d6b928d commit 75a94c4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 215 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### Enhancements

- `CustomGradientPicker`, `GradientPicker`: Add `__nextHasNoMargin` prop for opting into the new margin-free styles ([#43387](https://github.com/WordPress/gutenberg/pull/43387)).
- `ToolsPanel`: Tighten grid gaps ([#43424](https://github.com/WordPress/gutenberg/pull/43424)).
- `ToggleGroupControl`: Improve TypeScript documentation ([#43265](https://github.com/WordPress/gutenberg/pull/43265)).
- `ComboboxControl`: Normalize hyphen-like characters to an ASCII hyphen ([#42942](https://github.com/WordPress/gutenberg/pull/42942)).
- `FormTokenField`: Refactor away from `_.difference()` ([#43224](https://github.com/WordPress/gutenberg/pull/43224/)).
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/tools-panel/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const toolsPanelGrid = {
grid-template-columns: ${ `repeat( ${ columns }, minmax(0, 1fr) )` };
`,
spacing: css`
column-gap: ${ space( 4 ) };
row-gap: ${ space( 6 ) };
column-gap: ${ space( 2 ) };
row-gap: ${ space( 4 ) };
`,
item: {
fullWidth: css`
Expand Down
210 changes: 0 additions & 210 deletions packages/components/src/tools-panel/test/__snapshots__/index.js.snap

This file was deleted.

5 changes: 3 additions & 2 deletions packages/components/src/tools-panel/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ describe( 'ToolsPanel', () => {

describe( 'first and last panel items', () => {
it( 'should apply first/last classes to appropriate items', () => {
const { container } = render(
render(
<SlotFillProvider>
<ToolsPanelItems>
<ToolsPanelItem { ...altControlProps }>
Expand Down Expand Up @@ -1113,7 +1113,8 @@ describe( 'ToolsPanel', () => {
expect( item3 ).toBeInTheDocument();
expect( screen.queryByText( 'Item 4' ) ).not.toBeInTheDocument();

expect( container ).toMatchSnapshot();
expect( item2.parentElement ).toHaveClass( 'first' );
expect( item3.parentElement ).toHaveClass( 'last' );
} );
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default function TypographyPanel( { name, element } ) {
>
Aa
</div>
<Grid columns={ 2 }>
<Grid columns={ 2 } rowGap={ 16 } columnGap={ 8 }>
{ element === 'heading' && (
<div className="edit-site-typography-panel__full-width-control">
<ToggleGroupControl
Expand Down

0 comments on commit 75a94c4

Please sign in to comment.