Skip to content

Commit 3b4e698

Browse files
committed
Fixed dark/light mode issues
1 parent 43c63a6 commit 3b4e698

36 files changed

Lines changed: 147 additions & 134 deletions

web-ui/src/App.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
a,
99
a:visited {
10-
color: var(--checkins-palette-primary-link);
10+
color: var(--mui-palette-primary-link);
1111
}
1212

1313
a:hover {
14-
color: var(--checkins-palette-primary-link-hover);
14+
color: var(--mui-palette-primary-link-hover);
1515
}
1616
}
1717

web-ui/src/App.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import { DarkMode, LightMode } from '@mui/icons-material';
1414

1515
import {
1616
useColorScheme,
17-
experimental_extendTheme as extendTheme,
18-
Experimental_CssVarsProvider as CssVarsProvider
17+
createTheme,
18+
ThemeProvider
1919
} from '@mui/material/styles';
2020

2121
import './App.css';
@@ -44,8 +44,10 @@ function SchemeToggle() {
4444
);
4545
}
4646

47-
const theme = extendTheme({
48-
cssVarPrefix: 'checkins',
47+
const theme = createTheme({
48+
cssVariables: {
49+
colorSchemeSelector: 'data',
50+
},
4951
colorSchemes: {
5052
light: {
5153
palette: {
@@ -90,7 +92,7 @@ getUserColorScheme();
9092

9193
function App() {
9294
return (
93-
<CssVarsProvider theme={theme}>
95+
<ThemeProvider theme={theme}>
9496
<LocalizationProvider dateAdapter={AdapterDateFns}>
9597
<Router history={customHistory}>
9698
<AppContextProvider>
@@ -108,7 +110,7 @@ function App() {
108110
</AppContextProvider>
109111
</Router>
110112
</LocalizationProvider>
111-
</CssVarsProvider>
113+
</ThemeProvider>
112114
);
113115
}
114116

web-ui/src/components/admin/roles/Roles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
position: absolute;
1616
min-width: 400px;
1717
max-width: 600px;
18-
background-color: var(--checkins-palette-background-default);
18+
background-color: var(--mui-palette-background-default);
1919
top: 50%;
2020
left: 50%;
2121
padding: 0.5rem;
2222
transform: translate(-50%, -50%);
23-
border: 2px solid var(--checkins-palette-background-default);
23+
border: 2px solid var(--mui-palette-background-default);
2424
}
2525

2626
.role-modal h2 {

web-ui/src/components/celebrations/Anniversaries.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ body.open {
3131
min-width: 450px;
3232
}
3333
.anniversaries-card span {
34-
color: var(--checkins-palette-primary-light);
34+
color: var(--mui-palette-primary-light);
3535
font-weight: bold;
3636
}
3737
.anniversary-gift {

web-ui/src/components/celebrations/Birthdays.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ body {
1616
min-width: 450px;
1717
}
1818
.birthdays-card span {
19-
color: var(--checkins-palette-primary-light);
19+
color: var(--mui-palette-primary-light);
2020
font-weight: bold;
2121
}
2222
.birthdays-container {

web-ui/src/components/certifications/EarnedCertificationsTable.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
td,
2222
th {
2323
padding: 0.5rem;
24-
color: var(--checkins-palette-text-primary);
24+
color: var(--mui-palette-text-primary);
2525
}
2626

2727
th {
@@ -34,12 +34,12 @@
3434
}
3535

3636
tr:nth-child(even) {
37-
background-color: var(--checkins-palette-background-default);
38-
background-image: var(--checkins-palette-alternate-row-overlay);
37+
background-color: var(--mui-palette-background-default);
38+
background-image: var(--mui-palette-alternate-row-overlay);
3939
}
4040

4141
tr:nth-child(odd) {
42-
background-color: var(--checkins-palette-background-default);
42+
background-color: var(--mui-palette-background-default);
4343
}
4444

4545
.actions-th {

web-ui/src/components/checkin/CheckinHistory.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ const CheckinsHistory = () => {
9494
fontSize: '1.2em',
9595
fill:
9696
index <= 0
97-
? 'var(--checkins-palette-action-disabled)'
98-
: 'var(--checkins-palette-action)'
97+
? 'var(--mui-palette-action-disabled)'
98+
: 'var(--mui-palette-action)'
9999
}}
100100
/>
101101
</IconButton>
@@ -120,8 +120,8 @@ const CheckinsHistory = () => {
120120
fontSize: '1.2em',
121121
fill:
122122
index <= 0
123-
? 'var(--checkins-palette-action-disabled)'
124-
: 'var(--checkins-palette-action)'
123+
? 'var(--mui-palette-action-disabled)'
124+
: 'var(--mui-palette-action)'
125125
}}
126126
/>
127127
</IconButton>

web-ui/src/components/checkin/__snapshots__/CheckinHistory.test.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`CheckinHistory > renders correctly 1`] = `
1717
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium arrow disabled css-1umw9bq-MuiSvgIcon-root"
1818
data-testid="ArrowBackIcon"
1919
focusable="false"
20-
style="font-size: 1.2em; fill: var(--checkins-palette-action-disabled);"
20+
style="font-size: 1.2em; fill: var(--mui-palette-action-disabled);"
2121
viewBox="0 0 24 24"
2222
>
2323
<path
@@ -77,7 +77,7 @@ exports[`CheckinHistory > renders correctly 1`] = `
7777
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium arrow enabled css-1umw9bq-MuiSvgIcon-root"
7878
data-testid="ArrowForwardIcon"
7979
focusable="false"
80-
style="font-size: 1.2em; fill: var(--checkins-palette-action-disabled);"
80+
style="font-size: 1.2em; fill: var(--mui-palette-action-disabled);"
8181
viewBox="0 0 24 24"
8282
>
8383
<path

web-ui/src/components/edit_skills/EditSkills.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
position: absolute;
33
min-width: 400px;
44
max-width: 600px;
5-
background-color: var(--checkins-palette-background-default);
5+
background-color: var(--mui-palette-background-default);
66
top: 50%;
77
left: 50%;
88
padding: 0.5rem;
@@ -40,7 +40,7 @@
4040
position: absolute;
4141
min-width: 400px;
4242
max-width: 600px;
43-
background-color: var(--checkins-palette-background-default);
43+
background-color: var(--mui-palette-background-default);
4444
top: 50%;
4545
left: 50%;
4646
padding: 0.5rem;

web-ui/src/components/expand-more/ExpandMore.jsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,24 @@ const ExpandMore = styled(props => {
99
{props.children ? props.children : <ExpandMoreIcon />}
1010
</IconButton>
1111
);
12-
})(({ theme, expand }) => ({
13-
transform: !expand ? 'rotate(0deg)' : 'rotate(180deg)',
12+
})(({
13+
theme
14+
}) => ({
15+
transform: 'rotate(180deg)',
1416
marginLeft: 'auto',
1517
transition: theme.transitions.create('transform', {
1618
duration: theme.transitions.duration.shortest
17-
})
19+
}),
20+
variants: [{
21+
props: (
22+
{
23+
expand
24+
}
25+
) => !expand,
26+
style: {
27+
transform: 'rotate(0deg)'
28+
}
29+
}]
1830
}));
1931

2032
export default ExpandMore;

0 commit comments

Comments
 (0)