Created
July 12, 2021 10:49
-
-
Save mu29/1b8267028da2368c4971474acf02cf05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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