Skip to content

Instantly share code, notes, and snippets.

@mu29
Created July 12, 2021 10:49
Show Gist options
  • Save mu29/1b8267028da2368c4971474acf02cf05 to your computer and use it in GitHub Desktop.
Save mu29/1b8267028da2368c4971474acf02cf05 to your computer and use it in GitHub Desktop.
import type { LayoutProps as SystemLayoutProps } from 'styled-system';
import { compose, layout as systemLayout, system } from 'styled-system';
import type { ResponsiveValue } from './types';
export type LayoutProps = SystemLayoutProps & {
hideScroll?: ResponsiveValue<boolean>;
};
const customLayout = system({
hideScroll: (value: boolean) =>
value
? {
scrollbarWidth: 'none',
msOverflowStyle: 'none',
'&::-webkit-scrollbar': {
display: 'none',
},
}
: {},
});
export const layout = compose(systemLayout, customLayout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment