Skip to content

Commit

Permalink
Define variables through arbitrary properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslan-sed committed Oct 3, 2024
1 parent a678317 commit 50fc199
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
18 changes: 7 additions & 11 deletions packages/base/Page/src/Page/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@ export const Page = forwardRef<HTMLDivElement, Props>(function Page(
<div
{...rest}
ref={ref}
className={cx(classes.root, className)}
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
}
className={cx(
classes.root,
className,
'[--content-padding-horizontal:1em] md:[--content-padding-horizontal:2em]',
'[--header-height:3.5rem] [--content-width-wide:90em] [--content-width:75em]'
)}
style={{ ...style } as React.CSSProperties}
>
<PageContext.Provider value={{ width, fullWidth }}>
<PageHamburgerContextProvider hamburgerId={hamburgerId}>
Expand Down
3 changes: 1 addition & 2 deletions packages/base/Page/src/Page/__snapshots__/test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ exports[`Page renders 1`] = `
class="Picasso-root"
>
<div
class="Page-root"
style="--header-height: 3.5rem; --content-width-wide: 90em; --content-width: 75em; --content-padding-horizontal: 2em; --content-mobile-padding-horizontal: 1em;"
class="Page-root [--content-padding md:[--content-padding [--header [--content-width [--content"
>
<div>
Test
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-[--content-mobile-padding-horizontal] md:px-[--content-padding-horizontal]'
'mx-auto pt-2 pb-6 px-[--content-padding-horizontal]'
)

return (
Expand Down

0 comments on commit 50fc199

Please sign in to comment.