11---
22import SearchComponent from " astro-pagefind/components/Search" ;
33import Button from " @ui/Button.astro" ;
4+
45---
56
67<div class =" search-wrapper hidden" style =" display: none;" >
78
8- <div class =" w-full flex items-center justify-between z-40 h-0 md:h-[85px] m-auto " >
9+ <div class =" search-header flex items-center justify-between z-40 h-0 md:h-[85px] m-auto " >
910 <h2 class =" text-black text-4xl ml-10 top-[46px] md:top-[85px]" >Search<h2 />
1011 <Button
12+ id =" search-close"
1113 icon =" close"
1214 iconSize =" fa-xl"
13- class =" search-close w-[3em] h-[3em] top-[46px] md:top-[85px]"
15+ class =" w-[3em] h-[3em] top-[46px] md:top-[85px]"
1416 />
1517 </div >
16-
1718 <div class =" modal__overlay" ></div >
1819
1920 <SearchComponent
@@ -33,7 +34,7 @@ document.addEventListener("DOMContentLoaded", function () {
3334 const searchWrapper = document.querySelector(".search-wrapper") as HTMLElement | null;
3435 const searchContainer = document.querySelector(".pagefind-ui") as HTMLElement | null;
3536 const searchInput = searchContainer?.querySelector("input") as HTMLInputElement | null;
36- const closeButton = document.querySelector(". search-close") as HTMLElement | null;
37+ const closeButton = document.querySelector("# search-close") as HTMLElement | null;
3738 const searchButton = document.getElementById("searchButton") as HTMLElement | null;
3839
3940 let selectedIndex = -1;
@@ -151,11 +152,12 @@ document.addEventListener("DOMContentLoaded", function () {
151152});
152153</script >
153154
154- <style is:global >
155- .search-wrapper div{
156- max-width: calc(48rem + 8vw);
155+ <style >
156+ .search-header {
157+ max-width: 48rem;
158+ margin:auto;
157159 }
158- .search-wrapper h2 {
160+ .search-header h2 {
159161 position: relative;
160162 left: -12px;
161163 z-index:100;
@@ -186,13 +188,15 @@ document.addEventListener("DOMContentLoaded", function () {
186188 z-index: 100;
187189 }
188190
189- .search-wrapper :global(.search-close) {
191+
192+ </style >
193+ <style is:global >
194+ #search-close {
190195 position: relative;
191196 left: -12px;
192197 margin: 0;
193198 border: 0;
194199 transition: opacity ease-out 0.2s;
195200 z-index: 10;
196201 }
197-
198202</style >
0 commit comments