Skip to content

Commit d3209ab

Browse files
authored
Merge pull request #985 from hxrshxz/fix-overlap
fix: update button font size and padding to prevent overlap
2 parents 3346bea + 82ec2a6 commit d3209ab

File tree

6 files changed

+46
-33
lines changed

6 files changed

+46
-33
lines changed

src/components/Dropdown/styles.module.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ button.chevron {
118118
.option > button > span {
119119
text-align: left;
120120
padding-left: 44px;
121-
padding-right: 10px;
121+
// 38px padding-right holds the chevron icon on mobile for better touch targets
122+
padding-right: 38px;
122123
display: inline-block;
123124
width: 100%;
125+
126+
127+
@media (min-width: $breakpoint-tablet) {
128+
font-size: 1rem;
129+
padding-right: 10px;
130+
}
124131
}

src/components/PageHeader/HomePage.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ const { config } = Astro.props;
1010
1111
---
1212

13-
<div class="px-lg pt-5xl lg:pt-3xl pb-0 h-full">
13+
<div class="px-lg pt-[11.25rem] lg:pt-3xl pb-0 h-full">
1414
<div class="homepage-header-top">
15-
<div class="grid grid-cols-3 lg:grid-cols-4 gap-md overflow-hidden h-min">
15+
<div class="grid grid-cols-3 lg:grid-cols-4 gap-md overflow-visible h-min">
1616
<p class="col-span-2 lg:col-span-3 mt-0 text-md md:text-xl lg:text-3xl">
1717
{config.data.heroText}
1818
</p>
1919
<Icon
2020
kind="asterisk-thick"
21-
className="col-span-1 motion-safe:animate-spin-slow text-logo-color h-full max-w-full max-h-[200px]"
21+
className="col-span-1 motion-safe:animate-spin-slow text-logo-color h-full max-w-full max-h-[80px] md:max-h-[120px] lg:max-h-[200px]"
2222
/>
2323
</div>
2424
{

src/components/PageHeader/RootPage.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const borderStyle = isFilterRoute ? "" : "border-b border-sidebar-type-color";
1212
---
1313

1414
<div
15-
class=`content-grid-simple min-h-[350px] h-[50vh] pt-5xl lg:pt-4xl bg-accent-color text-accent-type-color pb-md px-5 md:px-lg ${borderStyle}`
15+
class=`content-grid-simple min-h-[350px] h-[50vh] pt-[11.25rem] lg:pt-4xl bg-accent-color text-accent-type-color pb-md px-5 md:px-lg ${borderStyle}`
1616
>
1717
<h1 class="whitespace-pre-line col-span-full mb-5">{title}</h1>
1818
<p class="text-h3 !mt-0 mb-3xl col-span-2">{subtitle}</p>

src/components/ReferenceDirectoryWithFilter/index.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { ReferenceDocContentItem } from "@/src/content/types";
22
import { useMemo, useRef, useState } from "preact/hooks";
33
import { type JSX } from "preact";
44
import { Icon } from "../Icon";
5-
import flask from "@src/content/ui/images/icons/flask.svg?raw";
6-
import warning from "@src/content/ui/images/icons/warning.svg?raw";
5+
import flask from "@src/content/ui/images/icons/flask.svg?raw";
6+
import warning from "@src/content/ui/images/icons/warning.svg?raw";
77

88
type ReferenceDirectoryEntry = ReferenceDocContentItem & {
99
data: {
@@ -41,14 +41,14 @@ type ReferenceDirectoryWithFilterProps = {
4141
const getOneLineDescription = (description: string): string => {
4242
// Matches first paragraph tag, remove HTML tags, then trim to first fullstop
4343
const firstParagraphRegex = /^<p>(.*?)<\/p>/;
44-
let [oneLineDescription] = description.replace(/\n/g, " ").trim()
45-
.match(firstParagraphRegex) ?? [];
44+
let [oneLineDescription] =
45+
description.replace(/\n/g, " ").trim().match(firstParagraphRegex) ?? [];
4646

4747
if (!oneLineDescription && description) {
4848
oneLineDescription = description;
4949
}
5050

51-
if(oneLineDescription){
51+
if (oneLineDescription) {
5252
oneLineDescription = oneLineDescription
5353
.replace(/^<p>|<\/p>$/g, "")
5454
.replace(/<\/?code>/g, "")
@@ -80,11 +80,13 @@ export const ReferenceDirectoryWithFilter = ({
8080
);
8181
if (
8282
subcat.entry &&
83-
subcat.entry.data.title.toLowerCase().includes(searchKeyword.toLowerCase())
83+
subcat.entry.data.title
84+
.toLowerCase()
85+
.includes(searchKeyword.toLowerCase())
8486
) {
8587
filteredEntries.push(subcat.entry);
8688
}
87-
89+
8890
if (filteredEntries.length > 0) {
8991
subAcc.push({ ...subcat, entries: filteredEntries });
9092
}
@@ -111,18 +113,16 @@ export const ReferenceDirectoryWithFilter = ({
111113
aria-label={entry.data.title}
112114
aria-describedby={`${entry.data.title}-description`}
113115
>
114-
<span
115-
class="text-body-mono group-hover:underline"
116-
>
116+
<span class="text-body-mono group-hover:underline">
117117
{entry.data.beta && (
118118
<div
119-
className="inline-block mr-2 w-[16px] h-[16px] mb-[-2px]"
119+
className="mb-[-2px] mr-2 inline-block h-[16px] w-[16px]"
120120
dangerouslySetInnerHTML={{ __html: flask }}
121121
/>
122122
)}
123123
{entry.data.deprecated && (
124124
<div
125-
className="inline-block mr-2 w-[16px] h-[16px] mb-[-2px]"
125+
className="mb-[-2px] mr-2 inline-block h-[16px] w-[16px]"
126126
dangerouslySetInnerHTML={{ __html: warning }}
127127
/>
128128
)}
@@ -143,7 +143,7 @@ export const ReferenceDirectoryWithFilter = ({
143143
category: { name: string },
144144
) => {
145145
return !(!subcat.name || !category.name);
146-
}
146+
};
147147

148148
const getSubcatHeading = (
149149
subcat: { name: string; entry?: any },
@@ -207,7 +207,7 @@ export const ReferenceDirectoryWithFilter = ({
207207
return (
208208
<div>
209209
<div class="h-0 overflow-visible">
210-
<div class="content-grid-simple absolute -top-[75px] -left-0 -right-0 h-[75px] border-b border-sidebar-type-color bg-accent-color px-5 pb-lg md:px-lg ">
210+
<div class="content-grid-simple absolute -left-0 -right-0 -top-[60px] h-[75px] border-b border-sidebar-type-color bg-accent-color px-5 pb-lg md:px-lg ">
211211
<div class="text-body col-span-2 flex w-full max-w-[750px] border-b border-accent-type-color text-accent-type-color">
212212
<input
213213
type="text"
@@ -221,10 +221,14 @@ export const ReferenceDirectoryWithFilter = ({
221221
}}
222222
/>
223223
{searchKeyword.length > 0 && (
224-
<button type="reset" class="" onClick={clearInput} aria-label="Clear search input">
225-
<Icon kind="close" className="h-4 w-4" />
226-
</button>
227-
224+
<button
225+
type="reset"
226+
class=""
227+
onClick={clearInput}
228+
aria-label="Clear search input"
229+
>
230+
<Icon kind="close" className="h-4 w-4" />
231+
</button>
228232
)}
229233
</div>
230234
</div>

src/components/Settings/styles.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
padding: var(--spacing-sm) 1.25rem;
1717
grid-template-columns: repeat(6, minmax(0, 1fr));
18-
grid-template-rows: repeat(2, var(--settings-container-height-touch));
18+
grid-auto-rows: var(--settings-container-height-touch);
1919
row-gap: 20px;
2020
column-gap: 40px;
2121

@@ -43,7 +43,7 @@
4343

4444
.localeselect,
4545
.a11yselect {
46-
grid-column: span 3;
46+
grid-column: span 6;
4747
@media (min-width: $breakpoint-tablet) {
4848
grid-column: span 3;
4949
}

styles/global.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ h4 {
126126
font-size: 1.5rem;
127127
line-height: 1.1333;
128128
-webkit-text-stroke-width: 0.15px;
129-
}
129+
}
130130
}
131131

132132
.text-body-large {
@@ -291,7 +291,9 @@ pre.code-box,
291291
white-space: break-spaces;
292292
}
293293

294-
.callout, .experimental, .deprecated {
294+
.callout,
295+
.experimental,
296+
.deprecated {
295297
padding: var(--spacing-sm);
296298
border-radius: 20px;
297299
background-color: var(--bg-magenta-20);
@@ -308,7 +310,8 @@ pre.code-box,
308310
}
309311
}
310312

311-
.experimental, .deprecated {
313+
.experimental,
314+
.deprecated {
312315
background-color: var(--bg-yellow);
313316
}
314317

@@ -382,8 +385,7 @@ pre.code-box,
382385
justify-content: space-between;
383386

384387
// 43px is the height of the top mobile bar menu
385-
height: calc(50vh - var(--spacing-5xl) - 43px);
386-
max-height: calc(50vh - var(--spacing-5xl) - 43px);
388+
min-height: calc(50vh - var(--spacing-5xl) - 43px);
387389

388390
@media (min-width: $breakpoint-tablet) {
389391
height: calc(50vh - var(--spacing-5xl));
@@ -515,8 +517,8 @@ input[type="search"]::-webkit-search-results-decoration {
515517
display: -webkit-box; // Needs webkit box to support line-clamp
516518
}
517519

518-
.dark-theme.monochrome-theme .renderable-alt{
519-
color: var(--type-black);
520+
.dark-theme.monochrome-theme .renderable-alt {
521+
color: var(--type-black);
520522
}
521523

522524
.skip-to-main {
@@ -548,4 +550,4 @@ body {
548550

549551
.dark-theme pre.mermaid svg {
550552
filter: invert(100%);
551-
}
553+
}

0 commit comments

Comments
 (0)