Skip to content

Commit ad2b58c

Browse files
authored
fix: documentation theme colors (#125)
1 parent 9e1c95a commit ad2b58c

File tree

8 files changed

+103
-99
lines changed

8 files changed

+103
-99
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"@docusaurus/plugin-client-redirects": "^3.7.0",
2424
"@docusaurus/preset-classic": "3.7.0",
2525
"@mdx-js/react": "^3.0.0",
26-
"@siemens/ix": "~3.2.0",
26+
"@siemens/ix": "0.0.0-pr-2198-20251023082407",
2727
"@siemens/ix-icons": "^3.0.0",
28-
"@siemens/ix-react": "^3.0.0",
28+
"@siemens/ix-react": "0.0.0-pr-2198-20251023082407",
2929
"@stackblitz/sdk": "^1.11.0",
3030
"prism-react-renderer": "^2.3.0",
3131
"prismjs": "^1.30.0",

pnpm-lock.yaml

Lines changed: 63 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/CategoryButton/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ export function CategoryButton(
2222
) {
2323
return (
2424
<IxButton
25-
ghost
2625
className={styles.CategoryButton}
2726
onClick={() => {
2827
window.location.href = props.link;
2928
}}
3029
style={{
3130
width: props.buttonWidth,
3231
}}
32+
variant="tertiary"
3333
>
3434
<div className={styles.CategoryButton__Content}>
3535
<div className={styles.CategoryButton__Title}>{props.title}</div>

src/components/IconsPreview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ const Icons: React.FC = () => {
301301
></IxIcon>
302302
{iconFilter && (
303303
<IxIconButton
304-
ghost
304+
variant="tertiary"
305305
oval
306306
iconColor="color-soft-text"
307307
icon={iconClear}

src/components/theme/UXTEndOfService/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ export default function UXTEndOfService() {
3939
</span>
4040
</div>
4141
<div className={styles.Content}>
42-
<IxButton outline onClick={redirectToBlog}>
42+
<IxButton variant="secondary" onClick={redirectToBlog}>
4343
Read more
4444
</IxButton>
4545
<IxIconButton
4646
icon={iconClose}
47-
ghost
47+
variant="tertiary"
4848
onClick={closeAnnouncement}
4949
></IxIconButton>
5050
</div>

src/scss/components/_input.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* This source code is licensed under the MIT license found in the
77
* LICENSE file in the root directory of this source tree.
88
*/
9-
@import '@siemens/ix/scss/mixins/input';
9+
@use '@siemens/ix/scss/mixins/input';
1010

11-
@include label('');
12-
@include form('');
13-
@include element-form('');
11+
@include input.label('');
12+
@include input.form('');
13+
@include input.element-form('');

src/scss/custom.scss

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ body {
4444
--ifm-navbar-link-hover-color: var(--theme-color-dynamic);
4545
--ifm-menu-color-active: var(--theme-color-dynamic);
4646

47-
--ifm-background-color: var(--theme-color-2, red);
47+
--ifm-background-color: var(--theme-color-2);
4848
}
4949

5050
:root {
@@ -80,9 +80,7 @@ p {
8080
margin-top: 0;
8181
}
8282

83-
:root[data-ix-theme],
84-
#__docusaurus.theme-classic-dark,
85-
#__docusaurus.theme-classic-light {
83+
[data-ix-theme] {
8684
--ifm-color-primary: var(--theme-color-dynamic);
8785
--ifm-code-font-size: 95%;
8886
--ifm-toc-border-color: var(--theme-color-x-weak-bdr);
@@ -92,24 +90,35 @@ p {
9290
--ifm-menu-color-active: var(--theme-color-dynamic);
9391
--ifm-menu-color: var(--theme-color-std-text);
9492
--ifm-background-color: var(--theme-color-1);
95-
9693
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
9794
--ifm-link-color: var(--theme-color-dynamic);
9895
}
9996

100-
[data-ix-theme='brand'][data-ix-color-schema='dark'],
101-
#__docusaurus.theme-classic-dark {
102-
--ix-docs-hero-background: var(--ifm-background-color);
103-
--ix-docs-hero-tab-active: var(--ifm-background-color);
97+
[data-ix-theme='classic'][data-ix-color-schema='dark'] {
98+
--ix-docs-hero-background: var(--theme-color-1);
99+
--ix-docs-hero-tab-active: transparent;
100+
}
101+
102+
[data-ix-theme='classic'][data-ix-color-schema='light'] {
103+
--ix-docs-hero-background: #fff;
104+
--ix-docs-hero-tab-active: transparent;
105+
}
106+
107+
[data-ix-theme='brand'][data-ix-color-schema='dark'] {
108+
--ix-docs-hero-background: var(--theme-color-1);
109+
--ix-docs-hero-tab-active: var(--theme-color-1);
104110
}
105111

106-
[data-ix-theme='brand'][data-ix-color-schema='light'],
107-
#__docusaurus.theme-classic-light {
108-
--ix-docs-hero-background: var(--ifm-background-color);
109-
--ix-docs-hero-tab-active: var(--ifm-background-color);
112+
[data-ix-theme='brand'][data-ix-color-schema='light'] {
113+
--ix-docs-hero-background: #fff;
114+
--ix-docs-hero-tab-active: #fff;
110115
--ifm-menu-color-active: var(--theme-color-primary);
111116
}
112117

118+
#__docusaurus {
119+
background: var(--ix-docs-hero-background);
120+
}
121+
113122
.anchor {
114123
scroll-margin-top: 15rem !important;
115124
}

src/theme/SiteMetadata/index.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ export default function SiteMetadataWrapper(props: Props): JSX.Element {
1111
!context.siteConfig.customFields.withBrandTheme;
1212

1313
useEffect(() => {
14-
const initialVariant = document.documentElement.getAttribute('data-theme') || 'dark';
15-
14+
const initialVariant =
15+
document.documentElement.getAttribute('data-theme') || 'dark';
16+
1617
const theme = isDevelopedWithoutBrandTheme ? 'classic' : 'brand';
1718
document.documentElement.setAttribute('data-ix-theme', theme);
18-
document.documentElement.setAttribute('data-ix-color-schema', initialVariant);
19+
document.documentElement.setAttribute(
20+
'data-ix-color-schema',
21+
initialVariant
22+
);
1923

2024
const observer = new MutationObserver(() => {
2125
const variant = document.documentElement.getAttribute('data-theme');
@@ -27,19 +31,8 @@ export default function SiteMetadataWrapper(props: Props): JSX.Element {
2731

2832
document.documentElement.setAttribute('data-ix-theme', theme);
2933
document.documentElement.setAttribute('data-ix-color-schema', variant);
30-
31-
if (isDevelopedWithoutBrandTheme) {
32-
document
33-
.getElementById('__docusaurus')
34-
.classList.remove('theme-classic-dark');
35-
document
36-
.getElementById('__docusaurus')
37-
.classList.remove('theme-classic-light');
38-
document
39-
.getElementById('__docusaurus')
40-
.classList.add(`theme-classic-${variant}`);
41-
}
4234
});
35+
4336
observer.observe(document.documentElement, {
4437
attributes: true,
4538
attributeFilter: ['data-theme'],

0 commit comments

Comments
 (0)