Fix Cart sidebar styles after font size changes (https://github.com/woocommerce/woocommerce-blocks/pull/2593)

* Fix Cart sidebar styles after font size changes

* Margin/padding cleanup
This commit is contained in:
Albert Juhé Lluveras 2020-06-02 09:33:10 +02:00 committed by GitHub
parent 31b5f4e00c
commit a6da13920d
4 changed files with 46 additions and 49 deletions

View File

@ -3,10 +3,9 @@
}
.wc-block-shipping-calculator-address__button {
margin-top: $gap;
width: 100%;
}
.wc-block-cart__shipping-calculator {
padding-top: $gap-large;
padding: em($gap-smaller) 0 em($gap-small);
}

View File

@ -1,7 +1,7 @@
.wc-block-totals-table-item {
display: flex;
flex-wrap: wrap;
padding: 0.625em 0;
padding: em($gap-small) 0;
width: 100%;
}

View File

@ -48,45 +48,43 @@ const TotalsShippingItem = ( {
// If we have no rates, and an address is needed.
if ( ! hasRates && ! hasShippingAddress && ! isCheckout ) {
return (
<TotalsItem
className="wc-block-shipping-totals"
label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
value={
showCalculator ? (
<button
className="wc-block-shipping-totals__change-address-button"
onClick={ () => {
setIsShippingCalculatorOpen(
! isShippingCalculatorOpen
);
} }
>
{ __(
'Calculate',
'woo-gutenberg-products-block'
) }
</button>
) : (
<em>
{ __(
'Calculated during checkout',
'woo-gutenberg-products-block'
) }
</em>
)
}
description={
<>
{ showCalculator && isShippingCalculatorOpen && (
<ShippingCalculator
onUpdate={ () => {
setIsShippingCalculatorOpen( false );
<>
<TotalsItem
className="wc-block-shipping-totals"
label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
value={
showCalculator ? (
<button
className="wc-block-shipping-totals__change-address-button"
onClick={ () => {
setIsShippingCalculatorOpen(
! isShippingCalculatorOpen
);
} }
/>
) }
</>
}
/>
>
{ __(
'Calculate',
'woo-gutenberg-products-block'
) }
</button>
) : (
<em>
{ __(
'Calculated during checkout',
'woo-gutenberg-products-block'
) }
</em>
)
}
/>
{ showCalculator && isShippingCalculatorOpen && (
<ShippingCalculator
onUpdate={ () => {
setIsShippingCalculatorOpen( false );
} }
/>
) }
</>
);
}
@ -113,17 +111,17 @@ const TotalsShippingItem = ( {
) }
</button>
) }
{ showCalculator && isShippingCalculatorOpen && (
<ShippingCalculator
onUpdate={ () => {
setIsShippingCalculatorOpen( false );
} }
/>
) }
</>
}
currency={ currency }
/>
{ showCalculator && isShippingCalculatorOpen && (
<ShippingCalculator
onUpdate={ () => {
setIsShippingCalculatorOpen( false );
} }
/>
) }
{ ! isCheckout && showingRates && (
<ShippingRateSelector
hasRates={ hasRates }

View File

@ -1,7 +1,7 @@
.wc-block-select {
height: 3em;
position: relative;
margin-bottom: rem($gap-large);
margin-bottom: em($gap-large);
label {
@include reset-typography();