Skip to content

Commit 121a18d

Browse files
authored
Merge pull request #66 from fzzv/fix-in-dark-theme
fix: Color issues with some components in dark theme
2 parents 68097bd + e364db3 commit 121a18d

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

components/retroui/Select.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const SelectTrigger = ({
1515
return (
1616
<SelectPrimitive.Trigger
1717
className={cn(
18-
"flex h-10 min-w-40 items-center shadow-md justify-between border-2 border-input border-black bg-transparent px-4 py-2 ring-offset-background placeholder:text-muted-foreground focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
18+
"flex h-10 min-w-40 items-center shadow-md justify-between border-2 border-input border-border bg-transparent px-4 py-2 ring-offset-background placeholder:text-muted-foreground focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
1919
className,
2020
)}
2121
{...props}
@@ -42,7 +42,7 @@ const SelectContent = ({
4242
<SelectPrimitive.Portal>
4343
<SelectPrimitive.Content
4444
className={cn(
45-
"relative z-50 min-w-[8rem] overflow-hidden border border-black bg-white text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
45+
"relative z-50 min-w-[8rem] overflow-hidden border border-border bg-background text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
4646
position === "popper" &&
4747
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
4848
className,

components/retroui/Tab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const TabsTrigger = ({ children, className, ...props }: ITabsTrigger) => {
3535
return (
3636
<Tab
3737
className={cn(
38-
"px-4 py-1 border-2 border-transparent data-selected:border-black data-selected:bg-primary data-selected:font-semibold focus:outline-hidden",
38+
"px-4 py-1 border-2 border-transparent data-selected:border-border data-selected:bg-primary data-selected:font-semibold focus:outline-hidden",
3939
className,
4040
)}
4141
{...props}
@@ -51,7 +51,7 @@ interface ITabsContent extends TabPanelProps {
5151
const TabsContent = ({ children, className, ...props }: ITabsContent) => {
5252
return (
5353
<TabPanel
54-
className={cn("border-2 border-black mt-2 p-4", className)}
54+
className={cn("border-2 border-border mt-2 p-4", className)}
5555
{...props}
5656
>
5757
{children}

components/retroui/Textarea.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import { cn } from "@/lib/utils";
23

34
export function Textarea({
45
type = "text",
@@ -10,7 +11,10 @@ export function Textarea({
1011
<textarea
1112
placeholder={placeholder}
1213
rows={4}
13-
className={`px-4 py-2 w-full border-2 border-black shadow-md transition focus:outline-hidden focus:shadow-xs ${className}`}
14+
className={cn(
15+
"px-4 py-2 w-full border-2 border-border shadow-md transition focus:outline-hidden focus:shadow-xs placeholder:text-muted-foreground",
16+
className
17+
)}
1418
{...props}
1519
/>
1620
);

components/retroui/Toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const toggleVariants = cva(
1515
"bg-transparent hover:bg-muted/70 hover:text-muted-foreground data-[state=on]:bg-muted",
1616
outlined:
1717
"border-2 border-input bg-transparent hover:bg-accent hover:text-accent-foreground/80 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
18-
solid: "border-2 border-input bg-transparent hover:bg-black hover:text-white/90 hover:border-black data-[state=on]:bg-black data-[state=on]:text-white data-[state=on]:border-black",
18+
solid: "border-2 border-input bg-transparent hover:bg-secondary hover:text-secondary-foreground hover:border-secondary data-[state=on]:bg-secondary data-[state=on]:text-secondary-foreground data-[state=on]:border-secondary",
1919
"outline-muted":
2020
"border-2 border-input bg-transparent hover:hover:bg-muted/70 hover:hover:text-muted-foreground data-[state=on]:bg-muted",
2121
},
Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
import { Tab, TabGroup, TabList, TabPanel, TabPanels } from "@headlessui/react";
1+
import { Tabs, TabsPanels, TabsTrigger, TabsContent, TabsTriggerList } from "@/components/retroui/Tab";
22

33
export default function TabStyleDefault() {
44
return (
5-
<TabGroup>
6-
<TabList>
7-
<Tab className="px-4 py-1 border-2 border-transparent data-selected:border-black data-selected:bg-primary data-selected:font-semibold focus:outline-hidden">
8-
Home
9-
</Tab>
10-
<Tab className="px-4 py-1 border-2 border-transparent data-selected:border-black data-selected:bg-primary data-selected:font-semibold focus:outline-hidden">
11-
About
12-
</Tab>
13-
<Tab className="px-4 py-1 border-2 border-transparent data-selected:border-black data-selected:bg-primary data-selected:font-semibold focus:outline-hidden">
14-
Contact
15-
</Tab>
16-
</TabList>
17-
<TabPanels className="border-2 border-black mt-2 p-4">
18-
<TabPanel>
5+
<Tabs>
6+
<TabsTriggerList>
7+
<TabsTrigger>Home</TabsTrigger>
8+
<TabsTrigger>About</TabsTrigger>
9+
<TabsTrigger>Contact</TabsTrigger>
10+
</TabsTriggerList>
11+
<TabsPanels>
12+
<TabsContent>
1913
Welcome to RetroUI, a retro styled UI library built with React,
2014
Tailwind CSS & Headless UI.
21-
</TabPanel>
22-
<TabPanel>This is the about section!</TabPanel>
23-
<TabPanel>And, this is the contact section!</TabPanel>
24-
</TabPanels>
25-
</TabGroup>
15+
</TabsContent>
16+
<TabsContent>This is the about section!</TabsContent>
17+
<TabsContent>And, this is the contact section!</TabsContent>
18+
</TabsPanels>
19+
</Tabs>
2620
);
2721
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { Textarea } from "@/components/retroui/Textarea";
2+
13
export default function TextareaStyleDefault() {
24
return (
3-
<textarea
5+
<Textarea
46
rows={4}
57
placeholder="type something..."
6-
className="px-4 py-2 w-full border-2 border-black shadow-md transition focus:outline-hidden focus:shadow-xs"
8+
className="px-4 py-2 w-full border-2 shadow-md transition focus:outline-hidden focus:shadow-xs"
79
/>
810
);
911
}

0 commit comments

Comments
 (0)