Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 20cf4d2

Browse files
committed
mobile adjustments for lang select and padding
1 parent 642f851 commit 20cf4d2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components/code/CodeSwitcherSelect.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function CodeSwitcherSelect({
6161
>
6262
<SelectTrigger
6363
aria-label="Switch code language"
64-
className="absolute right-20 top-[6.5px] hidden h-8 w-[120px] bg-white/5 text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:flex"
64+
className="absolute right-[68px] top-[6.5px] hidden h-8 w-28 bg-white/5 text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:flex"
6565
>
6666
<SelectValue />
6767
</SelectTrigger>
@@ -78,7 +78,7 @@ export function CodeSwitcherSelect({
7878
onChange={(e) => setCurrentLanguage(e.target.value as LanguageId)}
7979
className={cn(
8080
'flex h-8 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
81-
'absolute right-20 top-[6.5px] w-[120px] bg-white/5 font-sans text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:hidden',
81+
'absolute right-[72px] top-[6.5px] w-24 bg-white/5 font-sans text-2xs font-medium text-zinc-400 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5 md:hidden',
8282
)}
8383
value={selectedLang}
8484
>

src/components/code/Pre.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const Pre: React.FC<Props> = ({
4444
return (
4545
<>
4646
{showFileNamePanel && (
47-
<div className="flex h-12 items-center justify-start border-b border-zinc-300/10 bg-zinc-800/50 pr-12 font-display text-xs font-semibold text-zinc-300">
47+
<div className="flex h-12 items-center justify-start border-b border-zinc-300/10 bg-zinc-800/50 pr-12 font-display text-2xs font-semibold text-zinc-300 sm:text-xs">
4848
{/* one-off breakpoint to hide the filename on extremely narrow screens - to avoid interfering with the lang select */}
4949
<span className="hidden whitespace-nowrap px-4 py-2 min-[320px]:block">
5050
{fileName}

src/components/layout/BaseLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function BaseLayout({ children }: React.PropsWithChildren) {
1919
<Navigation className="hidden lg:block" />
2020
</div>
2121
</header>
22-
<div className="relative px-4 pt-14 sm:px-6 lg:px-8">
22+
<div className="relative px-2 pt-14 sm:px-6 lg:px-8">
2323
{children}
2424
<Footer />
2525
</div>

0 commit comments

Comments
 (0)