Skip to content

Commit

Permalink
fix: prevent buttons from shrinking when used in a flex container
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed Jun 29, 2023
1 parent c1fd160 commit a6cbc00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Fixed

- Set `flexShrink` to `0` for `Button` variants to prevent it from shrinking when used in a flex container.

## [0.7.0] - 2023-06-29

### Added
Expand Down Expand Up @@ -201,5 +205,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.4.0]: https://github.com/chakra-ui/pro-theme/releases/tag/0.4.0
[0.5.0]: https://github.com/chakra-ui/pro-theme/releases/tag/0.5.0
[0.6.0]: https://github.com/chakra-ui/pro-theme/releases/tag/0.6.0

[0.7.0]: https://github.com/chakra-ui/pro-theme/releases/tag/0.7.0
3 changes: 3 additions & 0 deletions src/components/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const variants = {
const { colorScheme } = props
return {
borderRadius: 'lg',
flexShrink: 0,
bg: vars.bg.reference,
color: vars.color.reference,

Expand Down Expand Up @@ -116,6 +117,7 @@ const variants = {
borderWidth: '1px',
borderColor: 'border.emphasized',
borderRadius: 'lg',
flexShrink: 0,
bg: vars.bg.reference,
color: vars.color.reference,
[vars.color.variable]: `colors.gray.700`,
Expand Down Expand Up @@ -173,6 +175,7 @@ const variants = {

tertiary: defineStyle({
borderRadius: 'lg',
flexShrink: 0,
bg: vars.bg.reference,
color: vars.color.reference,
[vars.color.variable]: `colors.gray.600`,
Expand Down

1 comment on commit a6cbc00

@vercel
Copy link

@vercel vercel bot commented on a6cbc00 Jun 29, 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.