From ad47d664de4345641a0c7cf1256e510d2846c562 Mon Sep 17 00:00:00 2001 From: Harsh Date: Mon, 6 Oct 2025 13:36:39 +0530 Subject: [PATCH 1/2] fix: update button font size and padding to prevent overlap --- src/components/Dropdown/styles.module.scss | 8 +++- src/components/PageHeader/HomePage.astro | 4 +- .../ReferenceDirectoryWithFilter/index.tsx | 40 ++++++++++--------- styles/global.scss | 18 +++++---- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/src/components/Dropdown/styles.module.scss b/src/components/Dropdown/styles.module.scss index b2a1612608..05ea8cdf23 100644 --- a/src/components/Dropdown/styles.module.scss +++ b/src/components/Dropdown/styles.module.scss @@ -113,7 +113,13 @@ button.chevron { .option > button > span { text-align: left; padding-left: 44px; - padding-right: 10px; + padding-right: 38px; display: inline-block; width: 100%; + font-size: 0.75rem; + + @media (min-width: $breakpoint-tablet) { + font-size: 1rem; + padding-right: 10px; + } } diff --git a/src/components/PageHeader/HomePage.astro b/src/components/PageHeader/HomePage.astro index cd81ec7883..80784886ee 100644 --- a/src/components/PageHeader/HomePage.astro +++ b/src/components/PageHeader/HomePage.astro @@ -12,13 +12,13 @@ const { config } = Astro.props;
-
+

{config.data.heroText}

{ diff --git a/src/components/ReferenceDirectoryWithFilter/index.tsx b/src/components/ReferenceDirectoryWithFilter/index.tsx index a339859b42..5ce59bcd73 100644 --- a/src/components/ReferenceDirectoryWithFilter/index.tsx +++ b/src/components/ReferenceDirectoryWithFilter/index.tsx @@ -2,8 +2,8 @@ import type { ReferenceDocContentItem } from "@/src/content/types"; import { useMemo, useRef, useState } from "preact/hooks"; import { type JSX } from "preact"; import { Icon } from "../Icon"; -import flask from "@src/content/ui/images/icons/flask.svg?raw"; -import warning from "@src/content/ui/images/icons/warning.svg?raw"; +import flask from "@src/content/ui/images/icons/flask.svg?raw"; +import warning from "@src/content/ui/images/icons/warning.svg?raw"; type ReferenceDirectoryEntry = ReferenceDocContentItem & { data: { @@ -41,14 +41,14 @@ type ReferenceDirectoryWithFilterProps = { const getOneLineDescription = (description: string): string => { // Matches first paragraph tag, remove HTML tags, then trim to first fullstop const firstParagraphRegex = /^

(.*?)<\/p>/; - let [oneLineDescription] = description.replace(/\n/g, " ").trim() - .match(firstParagraphRegex) ?? []; + let [oneLineDescription] = + description.replace(/\n/g, " ").trim().match(firstParagraphRegex) ?? []; if (!oneLineDescription && description) { oneLineDescription = description; } - if(oneLineDescription){ + if (oneLineDescription) { oneLineDescription = oneLineDescription .replace(/^

|<\/p>$/g, "") .replace(/<\/?code>/g, "") @@ -80,11 +80,13 @@ export const ReferenceDirectoryWithFilter = ({ ); if ( subcat.entry && - subcat.entry.data.title.toLowerCase().includes(searchKeyword.toLowerCase()) + subcat.entry.data.title + .toLowerCase() + .includes(searchKeyword.toLowerCase()) ) { filteredEntries.push(subcat.entry); } - + if (filteredEntries.length > 0) { subAcc.push({ ...subcat, entries: filteredEntries }); } @@ -111,18 +113,16 @@ export const ReferenceDirectoryWithFilter = ({ aria-label={entry.data.title} aria-describedby={`${entry.data.title}-description`} > - + {entry.data.beta && (

)} {entry.data.deprecated && (
)} @@ -143,7 +143,7 @@ export const ReferenceDirectoryWithFilter = ({ category: { name: string }, ) => { return !(!subcat.name || !category.name); - } + }; const getSubcatHeading = ( subcat: { name: string; entry?: any }, @@ -207,7 +207,7 @@ export const ReferenceDirectoryWithFilter = ({ return (