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)). diff --git a/packages/grid/README.md b/packages/grid/README.md index f6ff1758d7b18b..37aae03702a3cb 100644 --- a/packages/grid/README.md +++ b/packages/grid/README.md @@ -178,7 +178,7 @@ When `editMode` is true: 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. A - dashed outline previews the target size as the cursor moves. + 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,8 +474,10 @@ 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` | `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 d15f5d69237ec7..36e9be4fdaec89 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, dashed) 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-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 fdfd0d9bef6ec9..fa561df823e62e 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, dashed) 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-resize-preview-outline-style, solid) var(--wp-grid-placeholder-outline-color, var(--wpds-color-stroke-interactive-brand)); background: transparent; }