From 20c1434f618282accb0bc23a50e0a0a76c41656b Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 15 May 2026 14:47:27 +0300 Subject: [PATCH 1/3] Grid: make preview overlay line solid --- packages/grid/README.md | 11 ++++++----- packages/grid/src/dashboard-grid/grid-item.module.css | 8 +++++--- .../grid/src/dashboard-lanes/lanes-item.module.css | 8 +++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/grid/README.md b/packages/grid/README.md index f6ff1758d7b18b..b75dc7089d222f 100644 --- a/packages/grid/README.md +++ b/packages/grid/README.md @@ -175,10 +175,10 @@ display order independently of array position. When `editMode` is true: - Items become draggable (powered by `@dnd-kit`). The original tile - stays in place as a dashed placeholder while a clone follows the + stays in place as an outlined placeholder while a clone follows the cursor through ``. -- A resize handle appears on the bottom-right of each item. A - dashed outline previews the target size as the cursor moves. +- A resize handle appears on the bottom-right of each item. An + outline previews the target size as the cursor moves. - While any tile is dragging or resizing, `actionableArea` content on every tile is set `inert` so hovers on other tiles can't steal the gesture. @@ -474,8 +474,9 @@ root itself via `style`). All values fall back to sensible defaults. |----------|---------|------------| | `--wp-grid-drag-preview-scale` | `1.05` | Lift scale of the drag-preview functional frame. Set to `1` to disable the lift. | | `--wp-grid-placeholder-opacity` | `0.4` | Opacity of the placeholder tile (the original item while a drag is in flight). | -| `--wp-grid-placeholder-outline-color` | `var(--wpds-color-stroke-interactive-brand)` | Dashed outline color of the placeholder and of the resize-preview overlay. | -| `--wp-grid-placeholder-radius` | `0` | Border radius of the placeholder, used to match the consumer's tile shape so the dashed outline traces the right silhouette. | +| `--wp-grid-placeholder-outline-style` | `solid` | Outline or border style of the placeholder and of the resize-preview overlay (for example `dashed` or `dotted`). | +| `--wp-grid-placeholder-outline-color` | `var(--wpds-color-stroke-interactive-brand)` | Outline color of the placeholder and of the resize-preview overlay. | +| `--wp-grid-placeholder-radius` | `0` | Border radius of the placeholder, used to match the consumer's tile shape so the outline traces the right silhouette. | --- diff --git a/packages/grid/src/dashboard-grid/grid-item.module.css b/packages/grid/src/dashboard-grid/grid-item.module.css index d15f5d69237ec7..c4d0c10ba6e802 100644 --- a/packages/grid/src/dashboard-grid/grid-item.module.css +++ b/packages/grid/src/dashboard-grid/grid-item.module.css @@ -10,7 +10,7 @@ /* * During drag, the original item acts as a placeholder in its grid * cell while `` renders a clone that follows the cursor. - * Fading the placeholder and outlining it with a dashed border makes + * Fading the placeholder and outlining it makes * the destination visible without any scaling or translation on the * original element. */ @@ -18,7 +18,8 @@ opacity: var(--wp-grid-placeholder-opacity, 0.4); pointer-events: none; outline: - var(--wpds-border-width-sm) dashed + var(--wpds-border-width-sm) + var(--wp-grid-placeholder-outline-style, solid) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); border-radius: var(--wp-grid-placeholder-radius, 0); } @@ -36,7 +37,8 @@ pointer-events: none; z-index: 1; border: - var(--wpds-border-width-sm) dashed + var(--wpds-border-width-sm) + var(--wp-grid-placeholder-outline-style, solid) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); background: transparent; border-radius: var(--wp-grid-placeholder-radius, 0); diff --git a/packages/grid/src/dashboard-lanes/lanes-item.module.css b/packages/grid/src/dashboard-lanes/lanes-item.module.css index fdfd0d9bef6ec9..2501fe7b1ad983 100644 --- a/packages/grid/src/dashboard-lanes/lanes-item.module.css +++ b/packages/grid/src/dashboard-lanes/lanes-item.module.css @@ -10,7 +10,7 @@ /* * During drag, the original item acts as a placeholder in its lane * while `` renders a clone that follows the cursor. - * Fading the placeholder and outlining it with a dashed border makes + * Fading the placeholder and outlining it makes * the destination visible without any scaling or translation on the * original element. */ @@ -18,7 +18,8 @@ opacity: var(--wp-grid-placeholder-opacity, 0.4); pointer-events: none; outline: - var(--wpds-border-width-sm) dashed + var(--wpds-border-width-sm) + var(--wp-grid-placeholder-outline-style, solid) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); border-radius: var(--wp-grid-placeholder-radius, 0); } @@ -36,7 +37,8 @@ pointer-events: none; z-index: 1; border: - var(--wpds-border-width-sm) dashed + var(--wpds-border-width-sm) + var(--wp-grid-placeholder-outline-style, solid) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); background: transparent; } From 6a752ccd88eb9ed1d36edf213a2ffcdc52dd86ed Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 15 May 2026 15:14:31 +0300 Subject: [PATCH 2/3] Split placeholder and resize-preview border style to be separate --- packages/grid/README.md | 9 +++++---- packages/grid/src/dashboard-grid/grid-item.module.css | 4 ++-- packages/grid/src/dashboard-lanes/lanes-item.module.css | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/grid/README.md b/packages/grid/README.md index b75dc7089d222f..37aae03702a3cb 100644 --- a/packages/grid/README.md +++ b/packages/grid/README.md @@ -175,10 +175,10 @@ display order independently of array position. When `editMode` is true: - Items become draggable (powered by `@dnd-kit`). The original tile - stays in place as an outlined placeholder while a clone follows the + stays in place as a dashed placeholder while a clone follows the cursor through ``. -- A resize handle appears on the bottom-right of each item. An - outline previews the target size as the cursor moves. +- A resize handle appears on the bottom-right of each item. A + solid outline previews the target size as the cursor moves. - While any tile is dragging or resizing, `actionableArea` content on every tile is set `inert` so hovers on other tiles can't steal the gesture. @@ -474,7 +474,8 @@ root itself via `style`). All values fall back to sensible defaults. |----------|---------|------------| | `--wp-grid-drag-preview-scale` | `1.05` | Lift scale of the drag-preview functional frame. Set to `1` to disable the lift. | | `--wp-grid-placeholder-opacity` | `0.4` | Opacity of the placeholder tile (the original item while a drag is in flight). | -| `--wp-grid-placeholder-outline-style` | `solid` | Outline or border style of the placeholder and of the resize-preview overlay (for example `dashed` or `dotted`). | +| `--wp-grid-placeholder-outline-style` | `dashed` | Outline style of the drag placeholder (for example `solid` or `dotted`). | +| `--wp-grid-resize-preview-outline-style` | `solid` | Border style of the resize-preview overlay (for example `dashed` or `dotted`). | | `--wp-grid-placeholder-outline-color` | `var(--wpds-color-stroke-interactive-brand)` | Outline color of the placeholder and of the resize-preview overlay. | | `--wp-grid-placeholder-radius` | `0` | Border radius of the placeholder, used to match the consumer's tile shape so the outline traces the right silhouette. | diff --git a/packages/grid/src/dashboard-grid/grid-item.module.css b/packages/grid/src/dashboard-grid/grid-item.module.css index c4d0c10ba6e802..36e9be4fdaec89 100644 --- a/packages/grid/src/dashboard-grid/grid-item.module.css +++ b/packages/grid/src/dashboard-grid/grid-item.module.css @@ -19,7 +19,7 @@ pointer-events: none; outline: var(--wpds-border-width-sm) - var(--wp-grid-placeholder-outline-style, solid) + var(--wp-grid-placeholder-outline-style, dashed) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); border-radius: var(--wp-grid-placeholder-radius, 0); } @@ -38,7 +38,7 @@ z-index: 1; border: var(--wpds-border-width-sm) - var(--wp-grid-placeholder-outline-style, solid) + var(--wp-grid-resize-preview-outline-style, solid) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); background: transparent; border-radius: var(--wp-grid-placeholder-radius, 0); diff --git a/packages/grid/src/dashboard-lanes/lanes-item.module.css b/packages/grid/src/dashboard-lanes/lanes-item.module.css index 2501fe7b1ad983..fa561df823e62e 100644 --- a/packages/grid/src/dashboard-lanes/lanes-item.module.css +++ b/packages/grid/src/dashboard-lanes/lanes-item.module.css @@ -19,7 +19,7 @@ pointer-events: none; outline: var(--wpds-border-width-sm) - var(--wp-grid-placeholder-outline-style, solid) + var(--wp-grid-placeholder-outline-style, dashed) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); border-radius: var(--wp-grid-placeholder-radius, 0); } @@ -38,7 +38,7 @@ z-index: 1; border: var(--wpds-border-width-sm) - var(--wp-grid-placeholder-outline-style, solid) + var(--wp-grid-resize-preview-outline-style, solid) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); background: transparent; } From cef2d56d11fbc92b811bc5d19e6a47cc3455d2c5 Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 15 May 2026 15:14:36 +0300 Subject: [PATCH 3/3] Update CHANGELOG.md --- packages/grid/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/grid/CHANGELOG.md b/packages/grid/CHANGELOG.md index 7d832c37540898..92cc25ddb4af03 100644 --- a/packages/grid/CHANGELOG.md +++ b/packages/grid/CHANGELOG.md @@ -4,6 +4,10 @@ ### Enhancements +- Add `--wp-grid-placeholder-outline-style` and + `--wp-grid-resize-preview-outline-style` CSS custom properties for + the drag-placeholder outline (default `dashed`) and resize-preview + border (default `solid`). - 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)).