Skip to content

Commit 24dfc14

Browse files
committed
style(misc): improve responsive layouts and use semantic colors
1 parent bba595d commit 24dfc14

5 files changed

Lines changed: 22 additions & 25 deletions

File tree

src/components/DatabaseURLLoader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ function DatabaseURLLoader() {
163163
<div className="mt-4 space-y-4">
164164
<p className="text-sm">
165165
Would you like to try using a CORS proxy?{" "}
166-
<span className="font-medium text-yellow-500 dark:text-yellow-400">
166+
<span className="text-warning font-medium">
167167
Note that this will send your database request through a
168168
third-party service.
169169
</span>
170170
</p>
171171

172172
{fetchError && (
173-
<div className="bg-destructive/10 dark:bg-destructive/20 rounded-md p-3 text-red-400">
173+
<div className="bg-destructive/10 text-destructive rounded-md p-3">
174174
<p className="text-xs">Error details: {fetchError}</p>
175175
</div>
176176
)}

src/components/FileDropHandler.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ function FileDropHandler({ children }: Readonly<FileDropHandlerProps>) {
1212
<>
1313
{children}
1414
{isDragging && (
15-
<section className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm transition-all">
16-
<div className="border-primary/60 bg-background/95 animate-in fade-in zoom-in-95 flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-8 shadow-lg transition-transform duration-200">
15+
<section className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm transition-opacity">
16+
<div className="border-primary/60 bg-background/95 animate-in fade-in zoom-in-95 flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-8 shadow-lg transition-opacity duration-200">
1717
<div className="bg-primary/10 mb-6 flex items-center justify-center rounded-full p-5">
1818
<DatabaseIcon className="text-primary h-12 w-12" />
1919
</div>

src/components/TopBar.tsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ function TopBar() {
99
const { handleFileChange, handleDownload } = useDatabaseWorker();
1010

1111
return (
12-
<header className="flex items-center justify-between gap-2 border-b px-1 py-1.5">
12+
<header className="flex flex-wrap items-center justify-between gap-2 border-b px-1 py-1.5 sm:flex-nowrap">
1313
<section
14-
className="flex items-center gap-1"
14+
className="flex min-w-0 flex-1 flex-wrap items-center gap-1"
1515
aria-label="Database file operations"
1616
>
1717
<label
@@ -32,7 +32,7 @@ function TopBar() {
3232
<Button
3333
size="sm"
3434
variant="outline"
35-
className="border-foreground/25 pointer-events-none h-8 cursor-pointer px-3 text-xs font-medium sm:w-[200px]"
35+
className="border-foreground/25 pointer-events-none w-full cursor-pointer text-xs font-medium sm:w-[200px]"
3636
aria-hidden="true"
3737
tabIndex={-1}
3838
>
@@ -43,7 +43,7 @@ function TopBar() {
4343
<Button
4444
size="sm"
4545
variant="outline"
46-
className="border-foreground/25 h-8 px-3 text-xs font-medium"
46+
className="border-foreground/25 text-xs font-medium"
4747
onClick={handleDownload}
4848
aria-label="Save current database to file"
4949
>
@@ -53,26 +53,24 @@ function TopBar() {
5353
</section>
5454

5555
<section
56-
className="flex items-center gap-1"
56+
className="ml-auto flex items-center gap-1"
5757
aria-label="Application settings and links"
5858
>
59-
<a
60-
href="https://github.com/yzua/sqlite-online"
61-
target="_blank"
62-
rel="noopener noreferrer"
63-
className="focus:ring-ring rounded-md transition-opacity hover:opacity-80 focus:ring-2 focus:ring-offset-2 focus:outline-none"
64-
aria-label="View source code on GitHub (opens in new tab)"
59+
<Button
60+
asChild
61+
size="icon"
62+
variant="ghost"
63+
className="hidden sm:inline-flex"
6564
>
66-
<Button
67-
size="icon"
68-
variant="ghost"
69-
className="hidden h-8 w-8 sm:flex"
70-
tabIndex={-1}
71-
aria-hidden="true"
65+
<a
66+
href="https://github.com/yzua/sqlite-online"
67+
target="_blank"
68+
rel="noopener noreferrer"
69+
aria-label="View source code on GitHub (opens in new tab)"
7270
>
7371
<GitForkIcon className="h-4 w-4" />
74-
</Button>
75-
</a>
72+
</a>
73+
</Button>
7674

7775
<HighContrastToggle />
7876
<ModeToggle />

src/components/accessibility/HighContrastToggle.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function HighContrastToggle() {
2525
<Button
2626
size="icon"
2727
variant="ghost"
28-
className="h-8 w-8"
2928
onClick={toggleHighContrast}
3029
aria-label={`${isHighContrast ? "Disable" : "Enable"} high contrast mode`}
3130
aria-pressed={isHighContrast}

src/components/accessibility/SkipLinks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function SkipLink({ href, children, className }: SkipLinkProps) {
1414
"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 focus:z-50",
1515
"bg-primary text-primary-foreground rounded-md px-4 py-2 font-medium",
1616
"focus:ring-ring focus:ring-2 focus:ring-offset-2 focus:outline-none",
17-
"transition-all duration-200",
17+
"transition-[color,box-shadow] duration-200",
1818
className
1919
)}
2020
>

0 commit comments

Comments
 (0)