Skip to content

Commit 2c6c3d8

Browse files
authored
Merge pull request #61 from rtCamp/fix/dark-components
Fix: UI/UX in dark mode
2 parents c1ea3f2 + 2453fc1 commit 2c6c3d8

File tree

8 files changed

+16
-12
lines changed

8 files changed

+16
-12
lines changed

.storybook/preview-styles.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@
1818
#storybook-docs .sbdocs-content h2 {
1919
font-weight: 800;
2020
font-size: 24px;
21-
}
21+
}
22+
23+
.dark body {
24+
background-color: #171717 !important;
25+
}

packages/frappe-ui-react/src/components/circularProgressBar/circularProgressBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ const CircularProgressBar: React.FC<CircularProgressBarProps> = ({
176176

177177
return (
178178
<div
179-
className={`progressbar ${completedClass} ${variantClass}`}
179+
className={`progressbar ${completedClass} ${variantClass} text-ink-gray-3`}
180180
role="progressbar"
181181
aria-valuenow={progress}
182182
aria-valuemin={0}

packages/frappe-ui-react/src/components/dropdown/dropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ const Dropdown: React.FC<DropdownProps> = ({
4848
const getBackgroundColor = (item: DropdownOption) =>
4949
item.theme === "red"
5050
? "focus:bg-surface-red-3 data-[highlighted]:bg-surface-red-3 data-[state=open]:bg-surface-red-3"
51-
: "focus:bg-surface-gray-3 data-[highlighted]:bg-surface-gray-3 data-[state=open]:bg-surface-gray-3";
51+
: "focus:bg-surface-gray-4 data-[highlighted]:bg-surface-gray-4 data-[state=open]:bg-surface-gray-4";
5252

5353
const getSubmenuBackgroundColor = (item: DropdownOption) =>
5454
getBackgroundColor(item) +
5555
" data-[state=open]:bg-surface-" +
56-
(item.theme === "red" ? "red-3" : "gray-3");
56+
(item.theme === "red" ? "red-3" : "gray-4");
5757

5858
const normalizeDropdownItem = useCallback(
5959
(option: DropdownOption): DropdownOption => {

packages/frappe-ui-react/src/components/rating/rating.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Rating: React.FC<RatingProps> = ({
3535
size === "xl" ? "size-7" : "",
3636
index <= hoveredRating && index > rating ? "!fill-yellow-200" : "",
3737
index <= rating ? "!fill-yellow-500" : "",
38-
index > rating && index > hoveredRating ? "fill-gray-300" : "",
38+
index > rating && index > hoveredRating ? "fill-gray-300 dark:fill-gray-900" : "",
3939
!readonly ? "cursor-pointer" : "",
4040
"text-transparent",
4141
"mr-0.5",

packages/frappe-ui-react/src/components/switch/switch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Switch: React.FC<SwitchProps> = ({
3636
"disabled:cursor-not-allowed disabled:bg-surface-gray-3",
3737
value
3838
? "bg-surface-gray-7 enabled:hover:bg-surface-gray-6 active:bg-surface-gray-5 group-hover:enabled:bg-surface-gray-6"
39-
: "bg-surface-gray-4 enabled:hover:bg-gray-400 active:bg-gray-500 group-hover:enabled:bg-gray-400",
39+
: "bg-surface-gray-4 enabled:hover:bg-gray-800 active:bg-gray-500 group-hover:enabled:bg-gray-800",
4040
size === "md" ? "h-5 w-8 border-[3px]" : "h-4 w-[26px] border-2",
4141
].join(" ");
4242

@@ -75,7 +75,7 @@ const Switch: React.FC<SwitchProps> = ({
7575
);
7676
classes.push(size === "md" ? "px-3 py-1.5" : "px-2.5 py-1.5");
7777
} else if (switchType === SwitchVariant.WITH_LABEL_AND_DESCRIPTION) {
78-
classes.push("items-start");
78+
classes.push("group items-start");
7979
classes.push(size === "md" ? "space-x-3.5" : "space-x-2.5");
8080
}
8181
return classes.join(" ");

packages/frappe-ui-react/src/components/tabButtons/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const TabButtons = ({
2727
}: TabButtonsProps) => {
2828
return (
2929
<RadioGroup value={value} onChange={onChange} className={className}>
30-
<div className="flex space-x-0.5 rounded-md bg-surface-gray-2 h-7 items-center px-[1px] text-sm">
30+
<div className="flex space-x-0.5 rounded-md bg-surface-gray-2 h-7 items-center px-[1px] text-sm border border-gray-200">
3131
{buttons.map((button) => (
3232
<Radio
3333
key={button.value || button.label}

packages/frappe-ui-react/src/components/toast/toast.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ const ToastComponent: React.FC<ToastProps> = ({
1919
switch (type) {
2020
case "success":
2121
return (
22-
<CircleCheck className="flex-shrink-0 size-4 text-ink-green-2" />
22+
<CircleCheck className="flex-shrink-0 size-4 text-ink-green-3" />
2323
);
2424
case "warning":
2525
return (
26-
<AlertTriangle className="flex-shrink-0 size-4 text-ink-amber-2" />
26+
<AlertTriangle className="flex-shrink-0 size-4 text-ink-amber-3" />
2727
);
2828
case "error":
29-
return <Info className="flex-shrink-0 size-4 text-ink-red-2" />;
29+
return <Info className="flex-shrink-0 size-4 text-ink-red-4" />;
3030
default:
3131
return null;
3232
}

packages/frappe-ui-react/src/theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ p,
1212
span,
1313
div {
1414
-webkit-font-smoothing: antialiased;
15-
font-variation-settings: 'opsz';
15+
font-variation-settings: 'opsz' 24;
1616
}
1717

1818
button,

0 commit comments

Comments
 (0)