Skip to content

Commit

Permalink
Revert "chore: Do not hide scrollbars in dev pages in Mac OS (#3168)"
Browse files Browse the repository at this point in the history
This reverts commit f9aeff8.
  • Loading branch information
jperals committed Feb 19, 2025
1 parent 20e6a83 commit 3c8b40b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pages/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import StrictModeWrapper from './components/strict-mode-wrapper';
// import font-size reset and Ember font
import '@cloudscape-design/global-styles/index.css';
// screenshot test overrides
import './styles.scss';
import styles from './styles.scss';

interface GlobalFlags {
appLayoutWidget?: boolean;
Expand Down Expand Up @@ -57,6 +57,7 @@ function App() {
// Also, AppLayout pages should resemble the ConsoleNav 2.0 styles
const isAppLayout = isAppLayoutPage(pageId);
const ContentTag = isAppLayout ? 'div' : 'main';
const isMacOS = navigator.userAgent.toLowerCase().indexOf('macintosh') > -1;

useEffect(() => {
applyMode(mode ?? null);
Expand All @@ -70,6 +71,14 @@ function App() {
disableMotion(motionDisabled);
}, [motionDisabled]);

useEffect(() => {
if (isMacOS) {
document.body.classList.add(styles.macos);
} else {
document.body.classList.remove(styles.macos);
}
}, [isMacOS]);

if (!mode) {
return <Redirect to="/light/" />;
}
Expand Down
9 changes: 9 additions & 0 deletions pages/app/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ body {
caret-color: transparent !important;
}
// stylelint-enable @cloudscape-design/no-implicit-descendant, selector-max-type

&.macos {
// override scrollbars in macos for stable screenshot tests
// stylelint-disable-next-line @cloudscape-design/no-implicit-descendant
::-webkit-scrollbar {
inline-size: 0;
block-size: 0;
}
}
}

/*
Expand Down

0 comments on commit 3c8b40b

Please sign in to comment.