Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ module.exports = {
],
},
],
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: [
// CSS Modules global escape hatch.
'global',
],
},
],
},
},
],
Expand Down
6 changes: 6 additions & 0 deletions packages/grid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

### Enhancements

- Set `data-wp-dashboard-grid-resizing` on the `DashboardGrid` root
element while any tile resize gesture is active, so consumers can
adjust styles when the pointer may still hover tiles ([#78234](https://github.com/WordPress/gutenberg/pull/78234)).

### New Features

- Initial release. Ships two layout components:
Expand Down
3 changes: 3 additions & 0 deletions packages/grid/src/dashboard-grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ export const DashboardGrid = forwardRef< HTMLDivElement, DashboardGridProps >(
{ ...divProps }
ref={ mergedGridRef }
className={ clsx( styles.grid, className ) }
data-wp-dashboard-grid-resizing={
isResizing || undefined
}
style={ {
...style,
gridTemplateColumns: `repeat(${ effectiveColumns }, minmax(0, 1fr))`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
box-shadow: var(--wpds-elevation-md);
}

/*
* While a resize is in progress, the pointer often sits over the tile;
* keep resting elevation so the hover lift does not flicker or fight the
* gesture. `data-wp-dashboard-grid-resizing` is set on `@wordpress/grid`
* `DashboardGrid` root for the duration of the resize.
*/
:global([data-wp-dashboard-grid-resizing]) .tileEditMode:hover,
:global([data-wp-dashboard-grid-resizing]) .tileEditMode:focus-visible {
box-shadow: var(--wpds-elevation-xs);
}

.tileEditMode:focus-visible {
outline: var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);
outline-offset: 2px;
Expand Down
Loading