Skip to content

Commit d9821e8

Browse files
committed
style: update component styles for dark mode compatibility
1 parent e653185 commit d9821e8

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

client/components/Button.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
.button {
2-
background: #fff;
3-
border: 1px solid #aaa;
2+
background: var(--bg-primary);
3+
border: 1px solid var(--border-color);
44
border-radius: 4px;
55
cursor: pointer;
66
display: inline-block;
77
font: var(--main-font);
88
outline: none;
99
padding: 5px 7px;
10-
transition: background .3s ease;
10+
transition: background .3s ease, border-color .3s ease, color .3s ease;
1111
white-space: nowrap;
12+
color: var(--text-primary);
1213
}
1314

1415
.button:focus,
1516
.button:hover {
16-
background: #ffefd7;
17+
background: var(--hover-bg);
1718
}
1819

1920
.button.active {

client/components/Dropdown.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
}
1111

1212
.input {
13-
border: 1px solid #aaa;
13+
border: 1px solid var(--border-color);
1414
border-radius: 4px;
1515
display: block;
1616
width: 100%;
17-
color: #7f7f7f;
17+
color: var(--text-secondary);
1818
height: 27px;
19+
background: var(--bg-primary);
20+
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
1921
}
2022

2123
.option {

client/components/Icon.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
.icon {
22
background: no-repeat center/contain;
33
display: inline-block;
4+
filter: invert(0);
5+
}
6+
7+
[data-theme="dark"] .icon {
8+
filter: invert(1);
49
}

client/components/Icon.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import PureComponent from '../lib/PureComponent';
44

55
import iconArrowRight from '../assets/icon-arrow-right.svg';
66
import iconPin from '../assets/icon-pin.svg';
7+
import iconMoon from '../assets/icon-moon.svg';
8+
import iconSun from '../assets/icon-sun.svg';
79

810
const ICONS = {
911
'arrow-right': {
@@ -13,6 +15,14 @@ const ICONS = {
1315
'pin': {
1416
src: iconPin,
1517
size: [12, 18]
18+
},
19+
'moon': {
20+
src: iconMoon,
21+
size: [24, 24]
22+
},
23+
'sun': {
24+
src: iconSun,
25+
size: [24, 24]
1626
}
1727
};
1828

client/components/Search.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@
1313
}
1414

1515
.input {
16-
border: 1px solid #aaa;
16+
border: 1px solid var(--border-color);
1717
border-radius: 4px;
1818
display: block;
1919
flex: 1;
2020
padding: 5px;
21+
background: var(--bg-primary);
22+
color: var(--text-primary);
23+
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
24+
}
25+
26+
.input:focus {
27+
outline: none;
28+
border-color: var(--text-secondary);
2129
}
2230

2331
.clear {

0 commit comments

Comments
 (0)