Skip to content

Commit 14ea535

Browse files
jprochazkshepmaster
authored andcommitted
Add dark mode using media query
1 parent f927b08 commit 14ea535

14 files changed

+188
-47
lines changed

ui/frontend/BuildMenu.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.code {
2-
background: #eee;
2+
background: var(--code-background-color);
33
padding: 0 0.25em;
44
}

ui/frontend/ButtonSet.module.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ $radius: 4px;
7676

7777
.secondary {
7878
composes: -border -button;
79-
background: linear-gradient(
80-
to bottom,
81-
var(--button-secondary-bg-color-top),
82-
var(--button-secondary-bg-color-bottom)
83-
);
79+
background: var(--button-secondary-bg-color);
8480
border-color: var(--button-secondary-border-color);
8581
color: var(--button-secondary-color);
8682

@@ -122,3 +118,8 @@ $radius: 4px;
122118
aspect-ratio: 1/1;
123119
justify-items: center;
124120
}
121+
122+
a.iconLink svg,
123+
a.iconLink:visited svg {
124+
fill: var(--font-color) !important;
125+
}

ui/frontend/ButtonSet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ IconButton.displayName = 'IconButton';
7979

8080
export const IconLink = React.forwardRef<HTMLAnchorElement, LinkProps>(
8181
({ children, ...props }, ref) => (
82-
<Link ref={ref} className={styles.icon} {...props}>
82+
<Link ref={ref} className={`${styles.icon} ${styles.iconLink}`} {...props}>
8383
{children}
8484
</Link>
8585
),

ui/frontend/ConfigElement.module.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020

2121
.select {
2222
width: 100%;
23+
background: var(--button-secondary-bg-color);
24+
border-color: var(--button-secondary-border-color);
25+
color: var(--button-secondary-color);
26+
27+
& option {
28+
background-color: var(--button-secondary-bg-color-top);
29+
border-color: var(--button-secondary-border-color);
30+
color: var(--button-secondary-color);
31+
}
2332
}
2433

2534
.toggle {

ui/frontend/Help.module.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
.container {
22
margin: 1em auto;
3-
background-color: #fff;
3+
color: var(--font-color-high-contrast);
4+
background-color: var(--background-color-high-contrast);
45
padding: 1em;
56
max-width: 800px;
67
line-height: 1.5;
78
}
89

910
.code {
10-
background: #eee;
11+
background: var(--code-background-color);
1112
padding: 0 0.25em;
1213
}
1314

@@ -22,7 +23,7 @@
2223
}
2324

2425
.headerLink {
25-
color: black;
26+
color: var(--header-link-color);
2627
text-decoration: none;
2728

2829
&:hover {

ui/frontend/Notifications.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $space: 0.25em;
1010
margin-right: auto;
1111
margin-left: auto;
1212
border: 2px solid #428bca;
13-
background: white;
13+
background: var(--background-color);
1414
max-width: 50em;
1515
}
1616

@@ -25,7 +25,6 @@ $space: 0.25em;
2525
.close {
2626
composes: -buttonReset from './shared.module.css';
2727
cursor: pointer;
28-
background: #e1e1db;
2928
padding: $space;
3029
}
3130

ui/frontend/Output.module.css

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
$current-tab: #f9ffff;
2-
$background-tab: #fcfcfc; /* desaturate($current-tab, 100%); */
3-
41
.container {
52
display: flex;
63
flex-direction: column;
@@ -13,11 +10,12 @@ $background-tab: #fcfcfc; /* desaturate($current-tab, 100%); */
1310
}
1411

1512
.tab {
13+
color: var(--font-color);
1614
flex: 1 1 auto;
1715
cursor: pointer;
1816
border: var(--border);
1917
border-right: none;
20-
background-color: $background-tab;
18+
background-color: var(--output-background-tab);
2119
line-height: 1.5em;
2220

2321
&:last-of-type {
@@ -29,7 +27,7 @@ $background-tab: #fcfcfc; /* desaturate($current-tab, 100%); */
2927
composes: tab;
3028
cursor: default;
3129
border-bottom: none;
32-
background-color: $current-tab;
30+
background-color: var(--output-current-tab);
3331

3432
&:focus {
3533
outline: none;
@@ -44,7 +42,7 @@ $background-tab: #fcfcfc; /* desaturate($current-tab, 100%); */
4442
.body {
4543
border: var(--border);
4644
border-top: none;
47-
background-color: $current-tab;
45+
background-color: var(--output-current-tab);
4846
padding: 0.5em;
4947
height: 100%;
5048
overflow: scroll;

ui/frontend/Output/Header.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.container {
22
display: flex;
3-
color: var(--border-color);
3+
color: var(--font-color);
44
white-space: nowrap;
55

66
&::before,

ui/frontend/PopButton.module.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
$fg-color: #222;
2-
$bg-color: white;
3-
$vertical-border-color: #cacaca;
41
$arrow-height: 10px;
52
$arrow-width: 20px;
63

@@ -13,14 +10,18 @@ $arrow-width: 20px;
1310
}
1411
}
1512

13+
.arrow {
14+
fill: var(--background-color-high-contrast);
15+
}
16+
1617
.-content {
1718
margin: $arrow-height;
1819
box-shadow:
1920
5px 5px 20px -3px rgb(0 0 0 / 25%),
2021
0 0 5px -2px rgb(0 0 0 / 90%);
2122
border-radius: var(--header-border-radius);
22-
background: $bg-color;
23-
color: $fg-color;
23+
background: var(--background-color-high-contrast);
24+
color: var(--font-color);
2425
}
2526

2627
.contentBottom {

ui/frontend/PopButton.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ const PopButton: React.FC<NewPopProps> = ({ Button, Menu, menuContainer }) => {
7272
}}
7373
{...getFloatingProps()}
7474
>
75-
<FloatingArrow ref={arrowRef} context={context} height={10} width={20} fill="white" />
75+
<FloatingArrow
76+
ref={arrowRef}
77+
context={context}
78+
height={10}
79+
width={20}
80+
className={styles.arrow}
81+
/>
7682
<div className={containerClass}>
7783
<Menu close={close} />
7884
</div>

0 commit comments

Comments
 (0)