Skip to content

Commit

Permalink
feat: use defineStyleConfig where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed Jun 11, 2023
1 parent 9d141bf commit 3f99cd8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Changed

- Renamed and re-designed `Tabs` variant `with-line` to `underline`.
- Changed the default `colorScheme` for `Badge` from `gray` to `brand`.

### Removed

Expand Down
15 changes: 7 additions & 8 deletions src/components/badge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineCssVars, defineStyle } from '@chakra-ui/styled-system'
import { defineCssVars, defineStyle, defineStyleConfig } from '@chakra-ui/styled-system'
import { transparentize } from '@chakra-ui/theme-tools'

const sizes = {
Expand Down Expand Up @@ -41,12 +41,11 @@ const variants = {
}),
}

const defaultProps = {
size: 'md',
}

export default {
defaultProps,
export default defineStyleConfig({
defaultProps: {
size: 'md',
colorScheme: 'brand',
},
variants,
sizes,
}
})
12 changes: 7 additions & 5 deletions src/components/container.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const baseStyle = {
maxW: '7xl',
px: { base: '4', md: '8' },
}
import { defineStyleConfig } from '@chakra-ui/styled-system'

export default { baseStyle }
export default defineStyleConfig({
baseStyle: {
maxW: '7xl',
px: { base: '4', md: '8' },
},
})
10 changes: 4 additions & 6 deletions src/components/divider.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { defineStyle, defineStyleConfig } from '@chakra-ui/styled-system'

const baseStyle = defineStyle({
opacity: 1.0,
})
import { defineStyleConfig } from '@chakra-ui/styled-system'

export default defineStyleConfig({
baseStyle,
baseStyle: {
opacity: 1.0,
},
})

1 comment on commit 3f99cd8

@vercel
Copy link

@vercel vercel bot commented on 3f99cd8 Jun 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.