Skip to content

Commit

Permalink
fixed fullwidth and changed how buttons collapse.
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed May 18, 2024
1 parent 7ae311c commit 615d812
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/block-components/button/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Styles = props => {
attrName="fullWidth"
attrNameTemplate={ attrNameTemplate }
key="buttonFullWidth-save"
valueCallback={ () => '1 1 0' }
valueCallback={ () => '1 0 var(--stk-button-group-flex-wrap, 0)' }
enabledCallback={ getAttribute => getAttribute( 'fullWidth' ) }
/>
<BlockCss
Expand All @@ -56,7 +56,7 @@ const Styles = props => {
attrName="fullWidth"
attrNameTemplate={ attrNameTemplate }
key="buttonFullWidth-flex"
valueCallback={ () => '1 1 0' }
valueCallback={ () => '1 0 var(--stk-button-group-flex-wrap, 0)' }
enabledCallback={ getAttribute => getAttribute( 'fullWidth' ) }
/>
<BlockCss
Expand Down
24 changes: 24 additions & 0 deletions src/block/button-group/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,30 @@ const Styles = props => {
} }
dependencies={ [ 'flexWrap' ] }
/>
<BlockCss
{ ...propsToPass }
renderIn="save"
selector=".stk-button-group"
styleRule="--stk-button-group-flex-wrap"
attrName="flexWrap"
key="flexWrap-save-button-group"
responsive="all"
valueCallback={ value => {
return value ? 'auto' : undefined
} }
/>
<BlockCss
{ ...propsToPass }
renderIn="save"
selector=".stk-button-group .stk-block-button"
styleRule="width"
attrName="flexWrap"
key="flexWrap-save-button-group-unset-width"
responsive="all"
valueCallback={ value => {
return value ? 'unset' : undefined
} }
/>
</>
)
}
Expand Down

0 comments on commit 615d812

Please sign in to comment.