File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 3232 run : pnpm build
3333 env :
3434 REACT_BASE : /ix-starter/react-starter/
35+ VITE_THEME : 1
3536
3637 - name : Deploy GitHub Pages 🚀
3738 uses : JamesIves/github-pages-deploy-action@v4
Original file line number Diff line number Diff line change @@ -11,17 +11,21 @@ import AnalyticsPage from "./pages/analytics/index.tsx";
1111import "@siemens/ix/dist/siemens-ix/siemens-ix.css" ;
1212
1313function optionalTheme ( ) {
14- const css = `${ import . meta. env . BASE_URL } theme/dist/ix-brand-theme/ix-brand-theme.css` ;
15- const link = document . createElement ( "link" ) ;
16- link . rel = "stylesheet" ;
17- link . href = css ;
18- document . head . appendChild ( link ) ;
14+ if ( import . meta. env . VITE_THEME ) {
15+ const css = `${ import . meta. env . BASE_URL } theme/dist/ix-brand-theme/ix-brand-theme.css` ;
16+ const link = document . createElement ( "link" ) ;
17+ link . rel = "stylesheet" ;
18+ link . href = css ;
19+ document . head . appendChild ( link ) ;
1920
20- const loader = `${ import . meta. env . BASE_URL } theme/dist/esm/ix-brand-theme.js` ;
21- const script = document . createElement ( "script" ) ;
22- script . src = loader ;
23- script . type = "module" ;
24- document . head . appendChild ( script ) ;
21+ const loader = `${ import . meta. env . BASE_URL } theme/dist/esm/ix-brand-theme.js` ;
22+ const script = document . createElement ( "script" ) ;
23+ script . src = loader ;
24+ script . type = "module" ;
25+ document . head . appendChild ( script ) ;
26+
27+ document . body . classList . add ( "theme-brand-dark" ) ;
28+ }
2529}
2630
2731optionalTheme ( ) ;
You can’t perform that action at this time.
0 commit comments