Skip to content

Commit e0a99b9

Browse files
Merge pull request #423 from thatblindgeye/bumpDocsHC
chore(docs): bump docs framework
2 parents f6222d3 + 103b2bd commit e0a99b9

File tree

4 files changed

+1781
-1580
lines changed

4 files changed

+1781
-1580
lines changed

packages/dev/src/common/Page.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { SettingsModal } from '../SettingsModal';
3131
const AppToolbar = () => {
3232
const [isModalOpen, setModalOpen] = React.useState(false);
3333
const [isDarkTheme, setDarkTheme] = React.useState(false);
34+
const [isHighContrast, setHighContrast] = React.useState(false);
3435
const onModalClose = () => setModalOpen(!isModalOpen);
3536

3637
const qsContext = React.useContext(QuickStartContext);
@@ -45,6 +46,15 @@ const AppToolbar = () => {
4546
}
4647
};
4748

49+
const handleHighContrastChange = (isChecked: boolean) => {
50+
setHighContrast(isChecked);
51+
if (isChecked) {
52+
document.documentElement.classList.add('pf-v6-theme-high-contrast');
53+
} else {
54+
document.documentElement.classList.remove('pf-v6-theme-high-contrast');
55+
}
56+
};
57+
4858
return (
4959
<Toolbar id="toolbar">
5060
<ToolbarContent>
@@ -58,6 +68,15 @@ const AppToolbar = () => {
5868
onChange={(_event, isChecked: boolean) => handleDarkThemeChange(isChecked)}
5969
/>
6070
</ToolbarItem>
71+
<ToolbarItem>
72+
<Switch
73+
id="high-contrast-theme-switch"
74+
aria-label="Toggle high contrast"
75+
label="High contrast theme"
76+
isChecked={isHighContrast}
77+
onChange={(_event, isChecked: boolean) => handleHighContrastChange(isChecked)}
78+
/>
79+
</ToolbarItem>
6180
<ToolbarItem>
6281
<Button
6382
aria-label="Toggle quick start"

packages/module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"history": "^5.0.0"
5656
},
5757
"devDependencies": {
58-
"@patternfly/documentation-framework": "^6.0.6",
58+
"@patternfly/documentation-framework": "^6.28.8",
5959
"@patternfly/patternfly": "^6.0.0",
6060
"@patternfly/react-code-editor": "^6.0.0",
6161
"@patternfly/react-core": "^6.0.0",

packages/module/patternfly-docs/patternfly-docs.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ module.exports = {
44
topNavItems: [],
55
port: 8006,
66
hasThemeSwitcher: true,
7+
hasHighContrastSwitcher: true,
78
};

0 commit comments

Comments
 (0)