File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -27,19 +27,25 @@ export const buttonVariables = cssVariables(
2727
2828const { vars, v } = buttonVariables
2929
30+ const paddingMap = {
31+ none : 'padding: 0;' ,
32+ normal : 'padding: 12px 16px;' ,
33+ }
34+
3035interface ButtonContainerProps {
3136 circle : boolean
3237 fullWidth : boolean
38+ padding : 'none' | 'normal'
3339}
3440
3541const ButtonContainer = styled . button < ButtonContainerProps > `
3642 ${ cssClickable }
3743 ${ ( { fullWidth } ) => fullWidth && 'width: 100%;' }
44+ ${ ( { padding } ) => paddingMap [ padding ] }
3845 display: inline-block;
3946 vertical-align: middle;
4047 text-align: center;
4148 background: ${ v . backgroundColor } ;
42- padding: 0;
4349 color: ${ v . textColor } ;
4450 transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease,
4551 box-shadow 0.3s ease;
@@ -104,6 +110,7 @@ export const Button = React.forwardRef(
104110 disabled = { disabled }
105111 circle = { circle }
106112 fullWidth = { fullWidth }
113+ padding = { padding }
107114 style = { {
108115 [ vars . backgroundColor ] : computedBackgroundColor ,
109116 [ vars . hoverBackgroundColor ] : computedHoverColor ,
@@ -123,9 +130,7 @@ export const Button = React.forwardRef(
123130 } }
124131 { ...rest }
125132 >
126- < div style = { { padding : padding === 'none' ? 'unset' : '12px 16px' } } >
127- { children }
128- </ div >
133+ < div > { children } </ div >
129134 </ ButtonContainer >
130135 )
131136 }
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export const Card = React.forwardRef(
9696 } }
9797 { ...rest }
9898 >
99- { children }
99+ < div > { children } </ div >
100100 </ CardContainer >
101101 )
102102 }
You can’t perform that action at this time.
0 commit comments