Skip to content

Commit

Permalink
chore: remove custom scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
v-gevak committed Oct 31, 2023
1 parent 4c4aaad commit 196469c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
7 changes: 0 additions & 7 deletions .storybook/addons/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { setMetricConfig, setManagerObserveConnection } from '../metrics';
import { browser } from '@alfalab/core-components-shared';

export const MODE_COLORS_TAG_ID = 'mode-colors';

Expand Down Expand Up @@ -32,12 +31,6 @@ export function setGuidelinesStyles(styles) {
getOrCreateStyleTag('guidelines', null, document).innerHTML = styles;
}

export function setScrollbarStyles(styles) {
if (browser.getScrollbarSize() > 0 && !('safari' in window)) {
getOrCreateStyleTag('scrollbar', null, document).innerHTML = styles;
}
}

export const extractMixinContent = (css) => css.trim().split('\n').slice(1, -1).join('\n');

export const setManagerMetricsConnection = () => {
Expand Down
4 changes: 4 additions & 0 deletions .storybook/pages/components-overview/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
}

@media screen and (min-width: 1024px) {
html:has(div[id='components-overview']) {
scrollbar-gutter: stable both-edges;
}

.cardContainer {
grid-template-columns: repeat(4, 1fr);
}
Expand Down
4 changes: 1 addition & 3 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { addons } from '@storybook/manager-api';
import { setThemeStylesInIframeHtmlPage, themeChangeListen } from './addons/theme-switcher/utils';
import { modeChangeListen, setModeVarsInIframeHtmlPage } from './addons/mode-switcher/utils';
import { ModeChecker } from './components/mode-checker';
import { rmCommentsFromCss, setGuidelinesStyles, setScrollbarStyles } from './addons/utils';
import { rmCommentsFromCss, setGuidelinesStyles } from './addons/utils';
import { LIVE_EXAMPLES_ADDON_ID } from 'storybook-addon-live-examples';
import guidelinesStyles from '!css-loader!!postcss-loader!./public/guidelines.css';
import scrollbarStyles from '!css-loader!!postcss-loader!./scrollbar.css';
import './blocks/code-editor/github-light-theme.css';

import alfaTheme from './theme';
Expand All @@ -17,7 +16,6 @@ setThemeStylesInIframeHtmlPage();
setModeVarsInIframeHtmlPage();
modeChangeListen();
themeChangeListen();
setScrollbarStyles(scrollbarStyles.toString());

if (window.location.href.includes('guidelines')) {
setGuidelinesStyles(rmCommentsFromCss(guidelinesStyles.toString()));
Expand Down
3 changes: 0 additions & 3 deletions .storybook/scrollbar.css

This file was deleted.

0 comments on commit 196469c

Please sign in to comment.