Skip to content

Commit e2e533f

Browse files
committed
deploy env
1 parent 3bffecb commit e2e533f

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
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

apps/react-starter/src/main.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@ import AnalyticsPage from "./pages/analytics/index.tsx";
1111
import "@siemens/ix/dist/siemens-ix/siemens-ix.css";
1212

1313
function 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

2731
optionalTheme();

0 commit comments

Comments
 (0)