Skip to content

Commit 6a84859

Browse files
committed
fix: search modal&&menu list on mobile
1 parent 93168fd commit 6a84859

File tree

11 files changed

+29
-17
lines changed

11 files changed

+29
-17
lines changed

src/components/Header/Header.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const section = frontmatter?.section ?? ""
7676
</div>
7777
)
7878
}
79-
<ThemeModeToggle client:only="preact" dark={dark} />
79+
<!-- <ThemeModeToggle client:only="preact" dark={dark} /> -->
8080
<LanguageSelector class="language-selector" />
8181
<a href="https://github.com/scroll-tech/scroll-documentation" class="github-url" target="_blank" rel="nofollow">
8282
<span
@@ -156,7 +156,7 @@ const section = frontmatter?.section ?? ""
156156

157157
.nav-wrapper {
158158
display: grid;
159-
grid-template-columns: 4fr 5fr;
159+
grid-template-columns: max-content 1fr;
160160
gap: 1.5em;
161161
width: 100%;
162162
margin: 0 1.25rem;

src/components/Header/Search/Search.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116

117117
.closeButtonMobile {
118118
display: block;
119-
/* background-color: #ffffff; */
120119
border: 3px solid #ffffff;
121120
padding: 0;
122121
font-size: 16px;
@@ -202,10 +201,10 @@
202201
top: 0;
203202
height: fit-content;
204203
max-height: 80vh;
205-
background: #f6f6f6;
206204
position: absolute;
207205
border-radius: 17.5px;
208206
padding-top: 0;
207+
@apply bg-[#f6f6f6];
209208
}
210209

211210
#searchModal.large {

src/components/Header/Search/Search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default function Search() {
6262
height="18"
6363
viewBox="0 0 18 18"
6464
fill="none"
65-
className={clsx(styles.closeButtonMobile, "dark:bg-dark-normal")}
65+
className={clsx(styles.closeButtonMobile, "dark:border-black dark:bg-black")}
6666
onClick={onClose}
6767
>
6868
<path
@@ -76,7 +76,7 @@ export default function Search() {
7676
</>
7777
) : (
7878
<button onClick={onOpen} className={styles.searchInputMobile}>
79-
<img src="/assets/search.svg" alt="search" aria-label="Search" width={20} height={20} />
79+
<span className="inline-block w-[22px] h-[22px] bg-[url(/assets/search.svg)] dark:bg-[url(/assets/search-white.svg)] bg-contain bg-no-repeat bg-center"></span>
8080
</button>
8181
)}
8282
</div>

src/components/Header/Search/SearchInput.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
overflow: hidden;
1010
padding: 0 20px;
1111
border-radius: 0;
12-
@apply bg-pure-white;
1312
}
1413

1514
.wrapper.large {
@@ -78,7 +77,7 @@
7877
.input {
7978
font-size: 16px;
8079
line-height: 15px;
81-
background: #f6f6f6 url(/assets/search.svg) left 12px top 50% / 17px no-repeat;
80+
background: url(/assets/search.svg) left 12px top 50% / 17px no-repeat;
8281
border: none;
8382
height: 35px;
8483
line-height: 35px;

src/components/Header/Search/SearchInput.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,23 @@ export const SearchInput = ({ size, onClose }: { onClose: () => void }) => {
2424
}, [debouncedValue])
2525

2626
return (
27-
<div className={clsx(styles.wrapper, styles[size], "dark:!bg-dark-normal")}>
27+
<div
28+
className={clsx(
29+
styles.wrapper,
30+
styles[size],
31+
"bg-pure-white",
32+
size === "mini" && "lg:bg-[#f6f6f6]",
33+
size === "mini" ? "dark:bg-black lg:dark:!bg-dark-normal" : "dark:bg-dark-normal"
34+
)}
35+
>
2836
<input
2937
className={clsx(
3038
styles.input,
3139
styles[size],
3240
".focus-visible",
3341
"dark:text-white",
3442
"dark:border-white",
35-
"dark:!bg-[url(/assets/search-white.svg)]",
36-
"dark:bg-dark-normal"
43+
"dark:!bg-[url(/assets/search-white.svg)]"
3744
)}
3845
onBlur={onClose}
3946
onChange={handleChange}

src/components/Header/Search/SearchModal.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,14 @@ export function SearchModal({ size = "mini", isOpen, onClose }: { size: Size; is
148148
}
149149

150150
return (
151-
<div id={styles.searchModal} className={clsx(styles[size], "bg-pure-white", "dark:!bg-dark-normal")}>
151+
<div
152+
id={styles.searchModal}
153+
className={clsx(
154+
styles[size],
155+
"bg-pure-white",
156+
size === "mini" ? "dark:bg-black lg:dark:!bg-dark-normal" : "dark:bg-dark-normal"
157+
)}
158+
>
152159
<InstantSearch indexName={getIndexName()} searchClient={searchClient}>
153160
<SearchInput size={size} onClose={onClose} />
154161
<div className={styles.resultsWrapper}>

src/components/Header/ThemeModeToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const ThemeModeToggle = (props) => {
4444
return (
4545
<button
4646
className={clsx(
47-
"w-[35px] h-[35px] rounded-[5px] bg-transparent border border-black dark:border-white text-black dark:text-white",
47+
"w-[35px] h-[35px] rounded-[5px] border-solid bg-transparent border border-black dark:border-white text-black dark:text-white",
4848
dark && "border-white text-white"
4949
)}
5050
onClick={handleToggleThemeMode}

src/components/LeftSidebar/LeftSidebar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const currentPageMatch = removeSlashes(currentPage.slice(1))
135135
.menu-separator {
136136
width: calc(100vw - 40px);
137137

138-
@apply border-0 border-t-[1px] border-t-divider border-solid;
138+
@apply border-0 border-t-[1px] border-solid border-black dark:border-white;
139139
}
140140
.sidebar-nav-groups.nav-groups > :first-child {
141141
@apply pt-[15px];

src/layouts/HomeLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site)
2929

3030
#grid-left {
3131
position: fixed;
32-
background-color: var(--theme-bg);
3332
z-index: 10;
3433
display: none;
34+
@apply bg-pure-white dark:bg-black;
3535
}
3636

3737
@media (min-width: 50em) {

src/layouts/LandingLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site)
4545
position: fixed;
4646
z-index: 10;
4747
display: none;
48-
@apply bg-bg;
48+
@apply bg-pure-white dark:bg-black;
4949
}
5050
#grid-main {
5151
padding: 0 var(--gutter);

0 commit comments

Comments
 (0)