Rename the "Align Buttons" option for the All Products Block (https://github.com/woocommerce/woocommerce-blocks/pull/1659)

* Allow css to work for any element

* Rename option to specific last block rather than button
This commit is contained in:
Mike Jolley 2020-01-29 10:28:40 +00:00 committed by GitHub
parent e1538395be
commit b65b93e7e7
2 changed files with 13 additions and 6 deletions

View File

@ -264,7 +264,8 @@
.wc-block-grid__product-image, .wc-block-grid__product-image,
.wc-block-grid__product-title, .wc-block-grid__product-title,
.wc-block-grid__product-price, .wc-block-grid__product-price,
.wc-block-grid__product-rating { .wc-block-grid__product-rating,
.wc-block-grid__product-add-to-cart {
margin-top: 0; margin-top: 0;
margin-bottom: $gap-small; margin-bottom: $gap-small;
} }
@ -276,8 +277,11 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.wc-block-grid__product-add-to-cart { .wc-block-grid__product > .wc-block-grid__product-title:last-child,
margin-top: auto !important; .wc-block-grid__product > div:last-child {
margin-top: auto;
margin-bottom: 0;
padding-bottom: $gap-small;
} }
} }
@for $i from 1 to 9 { @for $i from 1 to 9 {

View File

@ -49,15 +49,18 @@ const GridLayoutControl = ( {
max={ MAX_ROWS } max={ MAX_ROWS }
/> />
<ToggleControl <ToggleControl
label={ __( 'Align Buttons', 'woo-gutenberg-products-block' ) } label={ __(
'Align Last Block',
'woo-gutenberg-products-block'
) }
help={ help={
alignButtons alignButtons
? __( ? __(
'Buttons are aligned vertically.', 'The last inner block will be aligned vertically.',
'woo-gutenberg-products-block' 'woo-gutenberg-products-block'
) )
: __( : __(
'Buttons follow content.', 'The last inner block will follow other content.',
'woo-gutenberg-products-block' 'woo-gutenberg-products-block'
) )
} }