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
5 changes: 0 additions & 5 deletions .changeset/olive-heads-enter.md

This file was deleted.

2 changes: 0 additions & 2 deletions e2e/components/Axe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const SKIPPED_TESTS = [
'components-flash-features--with-icon-action-dismiss', // TODO: Remove once color-contrast issues have been resolved
'components-flash-features--with-icon-and-action', // TODO: Remove once color-contrast issues have been resolved
'components-filteredactionlist--default',
'components-pagelayout-performance-tests--medium-content',
'components-pagelayout-performance-tests--heavy-content',
]

type Component = {
Expand Down
96 changes: 12 additions & 84 deletions packages/react/src/PageLayout/PageLayout.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/* Maintain resize cursor while dragging */
/* stylelint-disable-next-line selector-no-qualifying-type */
body[data-page-layout-dragging='true'] {
cursor: col-resize;
}

/* Disable text selection while dragging */
/* stylelint-disable-next-line selector-no-qualifying-type */
body[data-page-layout-dragging='true'] * {
user-select: none;
}

.PageLayoutRoot {
/* Region Order */
--region-order-header: 0;
Expand Down Expand Up @@ -345,12 +357,6 @@
flex-grow: 1;
flex-shrink: 1;

/**
* OPTIMIZATION: Isolate content area from rest of page
* Note: No 'paint' containment to allow overflow effects (tooltips, modals, etc.)
*/
contain: layout style;

&:where([data-is-hidden='true']) {
display: none;
}
Expand All @@ -377,26 +383,6 @@
}
}

/**
* OPTIMIZATION: Aggressive containment during drag for ContentWrapper
* CSS handles most optimizations automatically via :has() selector
* JavaScript only handles scroll locking (can't be done in CSS)
*/
.PageLayoutContent:has(.DraggableHandle[data-dragging='true']) .ContentWrapper {
/* Add paint containment during drag - safe since user can't interact */
contain: layout style paint;

/* Disable interactions */
pointer-events: none;

/* Disable transitions to prevent expensive recalculations */
transition: none;

/* Force compositor layer for hardware acceleration */
will-change: width;
transform: translateZ(0);
}

.Content {
width: 100%;

Expand All @@ -406,14 +392,6 @@
margin-left: auto;
flex-grow: 1;

/**
* OPTIMIZATION: Skip rendering off-screen content during scrolling/resizing
* This automatically helps consumers with large content by only rendering
* elements that are visible in the viewport
*/
content-visibility: auto;
contain-intrinsic-size: auto 500px;

&:where([data-width='medium']) {
max-width: 768px;
}
Expand All @@ -431,16 +409,6 @@
}
}

/**
* OPTIMIZATION: Freeze content layout during resize drag
* This prevents expensive recalculations of large content areas
* while keeping content visible (just frozen in place)
*/
.PageLayoutContent:has(.DraggableHandle[data-dragging='true']) .Content {
/* Full containment (without size) - isolate from layout recalculations */
contain: layout style paint;
}

.PaneWrapper {
display: flex;
width: 100%;
Expand Down Expand Up @@ -617,15 +585,6 @@
/* stylelint-disable-next-line primer/spacing */
padding: var(--spacing);

/**
* OPTIMIZATION: Full containment for pane - isolates from rest of page
*/
contain: layout style paint;
/**
* OPTIMIZATION: For extremely tall content - skip rendering off-screen content
*/
content-visibility: auto;

@media screen and (min-width: 768px) {
overflow: auto;
}
Expand All @@ -639,26 +598,6 @@
}
}

/**
* OPTIMIZATION: Performance enhancements for Pane during drag
* CSS handles all optimizations automatically - JavaScript only locks scroll
*/
.PaneWrapper:has(.DraggableHandle[data-dragging='true']) .Pane {
/* Full containment - isolate from layout recalculations */
contain: layout style paint;

/* Disable interactions during drag */
pointer-events: none;

/* Disable transitions during drag */
transition: none;

/* Force hardware acceleration */
will-change: width, transform;
transform: translateZ(0);
backface-visibility: hidden;
}

.PaneHorizontalDivider {
&:where([data-position='start']) {
/* stylelint-disable-next-line primer/spacing */
Expand Down Expand Up @@ -757,22 +696,12 @@
padding: var(--spacing);
}

/**
* DraggableHandle - Interactive resize handle
*/
.DraggableHandle {
position: absolute;
inset: 0 -2px;
cursor: col-resize;
background-color: transparent;
transition-delay: 0.1s;

/**
* OPTIMIZATION: Prevent touch scrolling and text selection during drag
* This is done in CSS because it needs to be set before any pointer events
*/
touch-action: none;
user-select: none;
}

.DraggableHandle:hover {
Expand All @@ -781,7 +710,6 @@

.DraggableHandle[data-dragging='true'] {
background-color: var(--bgColor-accent-emphasis);
cursor: col-resize;
}

.DraggableHandle[data-dragging='true']:hover {
Expand Down
Loading
Loading