Skip to content

Commit 1611bb8

Browse files
committed
fix(search): prevent layout shift on search modal open, center modal
1 parent 2baa21a commit 1611bb8

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

sass/_vendor.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* Vendor styles */
22
html {
33
font-size: clamp(16px, 1.2vw + 1px, 18px);
4+
scrollbar-gutter: stable;
45
}
56

67
* {

sass/parts/_search.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,18 @@ body.modal-open {
130130
.search-results {
131131
display: none;
132132
position: fixed;
133+
margin: 0;
134+
padding: 0;
135+
border: 1px solid rgba(255, 255, 255, 0.1);
133136
top: 50%;
134137
left: 50%;
138+
right: auto;
139+
bottom: auto;
135140
transform: translate(-50%, -50%);
136141
width: calc(100% - 2rem);
137142
max-width: 650px;
138143
height: 80vh;
139144
max-height: 500px;
140-
border: 1px solid rgba(255, 255, 255, 0.1);
141145
border-radius: 12px;
142146
background-color: #2a2a2a;
143147
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
@@ -148,7 +152,7 @@ body.modal-open {
148152

149153
.search-results.active {
150154
display: flex;
151-
animation: slideUp 0.3s ease;
155+
animation: slideUp 0.3s ease both;
152156
}
153157

154158
@media (max-width: 768px) {

0 commit comments

Comments
 (0)