Skip to content

Commit

Permalink
fix full width on column wrap desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae committed Jul 10, 2024
1 parent 467cbb7 commit a34f9cf
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/block/feature-grid/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ import {
*/
import { addFilter } from '@wordpress/hooks'

// Version 3.13.3 Deprecations
addFilter( 'stackable.feature-grid.save.blockClassNames', 'stackable/3.13.3', ( output, props ) => {
if ( compareVersions( props.version, '3.13.3' ) === 1 ) {
return output
}

const separatorClass = getSeparatorClasses( props.attributes )
const responsiveClass = getResponsiveClasses( props.attributes )

const classnames = [
props.className,
'stk-block-feature-grid',
responsiveClass,
separatorClass,
]

if ( props.attributes.columnWrapDesktop ) {
classnames.push( 'stk--column-wrap-desktop' )
}
return classnames
} )

// Version 3.1.0 Deprecations
addFilter( 'stackable.feature-grid.save.blockClassNames', 'stackable/3.1.0', ( output, props ) => {
if ( compareVersions( props.version, '3.1.0' ) === 1 ) {
Expand Down
4 changes: 3 additions & 1 deletion src/block/feature-grid/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const Edit = props => {
rowClass,
separatorClass,
columnTooltipClass,
] )
], {
'stk--column-wrap-desktop': props.attributes.columnWrapDesktop,
} )

const contentClassNames = classnames( [
'stk-inner-blocks',
Expand Down
3 changes: 3 additions & 0 deletions src/block/feature-grid/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const Save = props => {
'stk-block-columns', // We need to add the columns class to make fit all and column gap to work properly.
responsiveClass,
separatorClass,
{
'stk--column-wrap-desktop': attributes.columnWrapDesktop,
},
],
], props )
)
Expand Down
5 changes: 5 additions & 0 deletions src/block/feature-grid/style.scss
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
@import "common";

.stk-block-feature-grid.stk--column-wrap-desktop .stk--flex > .stk-block-column,
.stk-block-feature-grid.stk--column-wrap-desktop .stk--flex > * > * > [data-type="stackable/column"] {
flex: var(--stk-flex-grow, 1) 1 calc(100% - var(--stk-column-gap, 0px) * 0 / 1) !important;
}

0 comments on commit a34f9cf

Please sign in to comment.