Skip to content

Commit

Permalink
Add CSS variables to replace values
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslan-sed committed Oct 2, 2024
1 parent 289e1f4 commit 08902c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion packages/base/Page/src/Page/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ export const Page = forwardRef<HTMLDivElement, Props>(function Page(
{...rest}
ref={ref}
className={cx(classes.root, className)}
style={{ ...style, '--header-height': '3.5rem' } as React.CSSProperties}
style={
{
...style,
'--header-height': '3.5rem',
'--content-width-wide': '90em',
'--content-width': '75em',
'--content-padding-horizontal': '2em',
'--content-mobile-padding-horizontal': '1em',
} as React.CSSProperties
}
>
<PageContext.Provider value={{ width, fullWidth }}>
<PageHamburgerContextProvider hamburgerId={hamburgerId}>
Expand Down
2 changes: 1 addition & 1 deletion packages/base/Page/src/PageFooter/PageFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const PageFooter = forwardRef<HTMLElement, Props>(function PageFooter(
'box-border',
'flex justify-between xs:max-lg:flex-col',
'text-white text-md leading-[1em]',
'mx-auto pt-2 pb-6 px-[1em] md:px-[2em]'
'mx-auto pt-2 pb-6 px-[--content-mobile-padding-horizontal] md:px-[--content-padding-horizontal]'
)

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/base/Page/src/PageFooter/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const getMaxWidthClass = ({ fullWidth, width }: PageContextProps) => {
}

if (width === 'wide') {
return 'max-w-[90em]'
return 'max-w-[--content-width-wide]'
}

return 'max-w-[75em]'
return 'max-w-[--content-width]'
}

0 comments on commit 08902c5

Please sign in to comment.