Use css variables.

This commit is contained in:
Mike Cao 2020-08-05 19:04:02 -07:00
parent 5d4ff5cfa4
commit a5930f1772
29 changed files with 131 additions and 85 deletions

View file

@ -41,7 +41,7 @@ export default function StickyHeader({
ref={ref}
data-sticky={sticky}
className={classNames(className, { [stickyClassName]: sticky })}
{...(sticky && { style: stickyStyle })}
style={sticky ? { ...stickyStyle, width: ref?.current?.clientWidth } : null}
>
{children}
</div>