File tree Expand file tree Collapse file tree 5 files changed +36
-4
lines changed Expand file tree Collapse file tree 5 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 44
44
font-weight : 400 ;
45
45
font-style : normal;
46
46
}
47
+
48
+ .splash-screen {
49
+ background-color : # 4a423b !important ;
50
+ }
Original file line number Diff line number Diff line change
1
+ var isDark = window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ;
2
+
3
+ var body = document . querySelector ( 'body' ) ;
4
+ var html = document . querySelector ( 'html' ) ;
5
+ var defClassName = 'splash-screen' ;
6
+
7
+ if ( ! isDark ) {
8
+ body ?. classList . remove ( defClassName ) ;
9
+ html . classList . remove ( defClassName ) ;
10
+ }
Original file line number Diff line number Diff line change 1
1
<!doctype html>
2
- < html class ="mode__full-page light ">
2
+ < html class ="mode__full-page light splash-screen ">
3
3
<!--
4
4
Hello! Thanks for showing interest in our code.
5
5
Interested in joining our team? To learn more, email us:
31
31
type ="font/woff2 "
32
32
/>
33
33
</ head >
34
- < body >
34
+ < body class =" splash-screen " >
35
35
< div id ="app "> </ div >
36
+ < script src ="/assets/splash-screen.js "> </ script >
36
37
< script src ="browser-polyfill.js "> </ script >
37
38
</ body >
38
39
</ html >
Original file line number Diff line number Diff line change 1
1
<!doctype html>
2
- < html class ="mode__popup light ">
2
+ < html class ="mode__popup light splash-screen ">
3
3
< head >
4
4
< meta charset ="UTF-8 " />
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1 " />
6
6
< link href ="/assets/base.css " rel ="stylesheet " />
7
7
</ head >
8
- < body >
8
+ < body class =" splash-screen " >
9
9
< div id ="app "> </ div >
10
+ < script src ="/assets/splash-screen.js "> </ script >
10
11
< script src ="browser-polyfill.js "> </ script >
11
12
</ body >
12
13
</ html >
Original file line number Diff line number Diff line change @@ -47,10 +47,26 @@ function setUserSelectedTheme(theme: UserSelectedTheme) {
47
47
interface ThemeSwitcherProviderProps {
48
48
children : React . JSX . Element | React . JSX . Element [ ] ;
49
49
}
50
+
51
+ function removeDefaultBg ( ) {
52
+ const body = document . querySelector ( 'body' ) ;
53
+ const html = document . querySelector ( 'html' ) ;
54
+ const defClassName = 'splash-screen' ;
55
+
56
+ if ( ! body || ! html ) return ;
57
+
58
+ body . classList . remove ( defClassName ) ;
59
+ html . classList . remove ( defClassName ) ;
60
+ }
61
+
50
62
export function ThemeSwitcherProvider ( { children } : ThemeSwitcherProviderProps ) {
51
63
const userSelectedTheme = useUserSelectedTheme ( ) ;
52
64
const [ theme , setTheme ] = useState < ComputedTheme > ( ( ) => getComputedTheme ( userSelectedTheme ) ) ;
53
65
66
+ useEffect ( ( ) => {
67
+ removeDefaultBg ( ) ;
68
+ } , [ ] ) ;
69
+
54
70
useEffect ( ( ) => {
55
71
switch ( userSelectedTheme ) {
56
72
case 'system' : {
You can’t perform that action at this time.
0 commit comments