|
| 1 | +/* Maintain resize cursor while dragging */ |
| 2 | +/* stylelint-disable-next-line selector-no-qualifying-type */ |
| 3 | +body[data-page-layout-dragging='true'] { |
| 4 | + cursor: col-resize; |
| 5 | +} |
| 6 | + |
| 7 | +/* Disable text selection while dragging */ |
| 8 | +/* stylelint-disable-next-line selector-no-qualifying-type */ |
| 9 | +body[data-page-layout-dragging='true'] * { |
| 10 | + user-select: none; |
| 11 | +} |
| 12 | + |
1 | 13 | .PageLayoutRoot { |
2 | 14 | /* Region Order */ |
3 | 15 | --region-order-header: 0; |
|
345 | 357 | flex-grow: 1; |
346 | 358 | flex-shrink: 1; |
347 | 359 |
|
348 | | - /** |
349 | | - * OPTIMIZATION: Isolate content area from rest of page |
350 | | - * Note: No 'paint' containment to allow overflow effects (tooltips, modals, etc.) |
351 | | - */ |
352 | | - contain: layout style; |
353 | | - |
354 | 360 | &:where([data-is-hidden='true']) { |
355 | 361 | display: none; |
356 | 362 | } |
|
377 | 383 | } |
378 | 384 | } |
379 | 385 |
|
380 | | -/** |
381 | | - * OPTIMIZATION: Aggressive containment during drag for ContentWrapper |
382 | | - * CSS handles most optimizations automatically via :has() selector |
383 | | - * JavaScript only handles scroll locking (can't be done in CSS) |
384 | | - */ |
385 | | -.PageLayoutContent:has(.DraggableHandle[data-dragging='true']) .ContentWrapper { |
386 | | - /* Add paint containment during drag - safe since user can't interact */ |
387 | | - contain: layout style paint; |
388 | | - |
389 | | - /* Disable interactions */ |
390 | | - pointer-events: none; |
391 | | - |
392 | | - /* Disable transitions to prevent expensive recalculations */ |
393 | | - transition: none; |
394 | | - |
395 | | - /* Force compositor layer for hardware acceleration */ |
396 | | - will-change: width; |
397 | | - transform: translateZ(0); |
398 | | -} |
399 | | - |
400 | 386 | .Content { |
401 | 387 | width: 100%; |
402 | 388 |
|
|
406 | 392 | margin-left: auto; |
407 | 393 | flex-grow: 1; |
408 | 394 |
|
409 | | - /** |
410 | | - * OPTIMIZATION: Skip rendering off-screen content during scrolling/resizing |
411 | | - * This automatically helps consumers with large content by only rendering |
412 | | - * elements that are visible in the viewport |
413 | | - */ |
414 | | - content-visibility: auto; |
415 | | - contain-intrinsic-size: auto 500px; |
416 | | - |
417 | 395 | &:where([data-width='medium']) { |
418 | 396 | max-width: 768px; |
419 | 397 | } |
|
431 | 409 | } |
432 | 410 | } |
433 | 411 |
|
434 | | -/** |
435 | | - * OPTIMIZATION: Freeze content layout during resize drag |
436 | | - * This prevents expensive recalculations of large content areas |
437 | | - * while keeping content visible (just frozen in place) |
438 | | - */ |
439 | | -.PageLayoutContent:has(.DraggableHandle[data-dragging='true']) .Content { |
440 | | - /* Full containment (without size) - isolate from layout recalculations */ |
441 | | - contain: layout style paint; |
442 | | -} |
443 | | - |
444 | 412 | .PaneWrapper { |
445 | 413 | display: flex; |
446 | 414 | width: 100%; |
|
617 | 585 | /* stylelint-disable-next-line primer/spacing */ |
618 | 586 | padding: var(--spacing); |
619 | 587 |
|
620 | | - /** |
621 | | - * OPTIMIZATION: Full containment for pane - isolates from rest of page |
622 | | - */ |
623 | | - contain: layout style paint; |
624 | | - /** |
625 | | - * OPTIMIZATION: For extremely tall content - skip rendering off-screen content |
626 | | - */ |
627 | | - content-visibility: auto; |
628 | | - |
629 | 588 | @media screen and (min-width: 768px) { |
630 | 589 | overflow: auto; |
631 | 590 | } |
|
639 | 598 | } |
640 | 599 | } |
641 | 600 |
|
642 | | -/** |
643 | | - * OPTIMIZATION: Performance enhancements for Pane during drag |
644 | | - * CSS handles all optimizations automatically - JavaScript only locks scroll |
645 | | - */ |
646 | | -.PaneWrapper:has(.DraggableHandle[data-dragging='true']) .Pane { |
647 | | - /* Full containment - isolate from layout recalculations */ |
648 | | - contain: layout style paint; |
649 | | - |
650 | | - /* Disable interactions during drag */ |
651 | | - pointer-events: none; |
652 | | - |
653 | | - /* Disable transitions during drag */ |
654 | | - transition: none; |
655 | | - |
656 | | - /* Force hardware acceleration */ |
657 | | - will-change: width, transform; |
658 | | - transform: translateZ(0); |
659 | | - backface-visibility: hidden; |
660 | | -} |
661 | | - |
662 | 601 | .PaneHorizontalDivider { |
663 | 602 | &:where([data-position='start']) { |
664 | 603 | /* stylelint-disable-next-line primer/spacing */ |
|
757 | 696 | padding: var(--spacing); |
758 | 697 | } |
759 | 698 |
|
760 | | -/** |
761 | | - * DraggableHandle - Interactive resize handle |
762 | | - */ |
763 | 699 | .DraggableHandle { |
764 | 700 | position: absolute; |
765 | 701 | inset: 0 -2px; |
766 | 702 | cursor: col-resize; |
767 | 703 | background-color: transparent; |
768 | 704 | transition-delay: 0.1s; |
769 | | - |
770 | | - /** |
771 | | - * OPTIMIZATION: Prevent touch scrolling and text selection during drag |
772 | | - * This is done in CSS because it needs to be set before any pointer events |
773 | | - */ |
774 | | - touch-action: none; |
775 | | - user-select: none; |
776 | 705 | } |
777 | 706 |
|
778 | 707 | .DraggableHandle:hover { |
|
781 | 710 |
|
782 | 711 | .DraggableHandle[data-dragging='true'] { |
783 | 712 | background-color: var(--bgColor-accent-emphasis); |
784 | | - cursor: col-resize; |
785 | 713 | } |
786 | 714 |
|
787 | 715 | .DraggableHandle[data-dragging='true']:hover { |
|
0 commit comments