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
3 changes: 2 additions & 1 deletion packages/react/src/PageLayout/PageLayout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,8 @@
content: '';
position: absolute;
inset: 0;
background-color: var(--bgColor-neutral-muted);
/* stylelint-disable-next-line primer/colors */
background-color: var(--draggable-handle--bg-color, var(--bgColor-neutral-muted));
opacity: var(--draggable-handle--drag-opacity, 0);
transition: var(--draggable-handle--transition, opacity 150ms ease); /* compositor-friendly, disabled during drag */
border-radius: inherit; /* optional if you need rounded corners */
Expand Down
6 changes: 4 additions & 2 deletions packages/react/src/PageLayout/paneUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const DATA_DRAGGING_ATTR = 'data-dragging'
/** Apply visual feedback and performance optimizations during drag */
export function setDraggingStyles({handle, pane, content}: DraggingStylesParams) {
// Handle visual feedback (must be inline for instant response)
handle?.style.setProperty('background-color', 'var(--bgColor-accent-emphasis)')
// Use CSS variable to control ::before pseudo-element background color.
// This avoids cascade conflicts between inline styles and pseudo-element backgrounds.
handle?.style.setProperty('--draggable-handle--bg-color', 'var(--bgColor-accent-emphasis)')
handle?.style.setProperty('--draggable-handle--drag-opacity', '1')
handle?.style.setProperty('--draggable-handle--transition', 'none')

Expand All @@ -20,7 +22,7 @@ export function setDraggingStyles({handle, pane, content}: DraggingStylesParams)

/** Remove drag styles and restore normal state */
export function removeDraggingStyles({handle, pane, content}: DraggingStylesParams) {
handle?.style.removeProperty('background-color')
handle?.style.removeProperty('--draggable-handle--bg-color')
handle?.style.removeProperty('--draggable-handle--drag-opacity')
handle?.style.removeProperty('--draggable-handle--transition')

Expand Down