fix(overflow): 🐛 align scroll buttons with content margin

This commit is contained in:
alistair3149 2024-06-11 19:07:38 -04:00
parent cbf60030f1
commit 4b457dfa08
No known key found for this signature in database
2 changed files with 14 additions and 2 deletions

View file

@ -158,8 +158,14 @@ class OverflowElement {
this.content = content;
if ( this.isPointerDevice ) {
const elementStyles = window.getComputedStyle( this.element );
const topMargin = parseInt( elementStyles.marginTop );
const bottomMargin = parseInt( elementStyles.marginBottom );
const nav = document.createElement( 'div' );
nav.className = 'citizen-overflow-nav';
nav.style.marginTop = `${ topMargin }px`;
nav.style.marginBottom = `${ bottomMargin }px`;
const leftButton = document.createElement( 'button' );
leftButton.className =

View file

@ -55,11 +55,10 @@
inset: 0;
display: flex;
justify-content: space-between;
margin-top: var( --space-md );
margin-bottom: var( --space-md );
}
&-navButton {
width: @overflow-affordnance-size;
height: 100%;
padding: 0;
appearance: none;
@ -67,8 +66,15 @@
background: transparent;
border: 0;
border-radius: var( --border-radius--small );
display: flex;
align-items: center;
justify-content: center;
.hideOverflowButton();
&::before {
width: 1.25rem;
}
&-left {
.citizen-overflow--left & {
.showOverflowButton();