Skip to content

Commit

Permalink
Refactor Container component styles to use object syntax for improved…
Browse files Browse the repository at this point in the history
… readability and maintainability
  • Loading branch information
jasonrundell committed Jan 16, 2025
1 parent d554643 commit 367bb76
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/stories/atoms/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ interface ContainerProps {
children: React.ReactNode
}

const StyledContainer = styled('div')<ContainerProps>`
margin: 0 auto;
padding: 0 2rem;
@media (min-width: ${Tokens.sizes.breakpoints.medium}rem) {
max-width: ${Tokens.sizes.breakpoints.medium}rem;
const StyledContainer = styled('div')<ContainerProps>({
margin: '0 auto',
padding: `0 ${Tokens.sizes.padding.large}rem`,
'@media (min-width: 48rem)': {
maxWidth: `${Tokens.sizes.breakpoints.medium}rem`
}
`
})

const Container = ({ children, ...props }: ContainerProps) => {
return <StyledContainer {...props}>{children}</StyledContainer>
Expand Down

0 comments on commit 367bb76

Please sign in to comment.