Enable new notice styles for all themes (https://github.com/woocommerce/woocommerce-blocks/pull/12043)
* Enable new notice styles * Fix Twenty Twenty-One button background color issue
This commit is contained in:
parent
1f410bdd04
commit
69ef1b96e8
|
@ -46,7 +46,7 @@
|
|||
.wc-forward {
|
||||
float: right;
|
||||
color: $gray-800 !important;
|
||||
background: transparent;
|
||||
background: transparent !important; // For transparent notice button in Twenty Twenty-One theme.
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
|
@ -70,6 +70,7 @@
|
|||
background-color: $gray-800;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
> .wc-block-components-button {
|
||||
|
|
|
@ -38,23 +38,12 @@ class Notices {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set all hooks related to adding Checkout Draft order functionality to Woo Core. This is only enabled if the user
|
||||
* is using the new block based cart/checkout.
|
||||
* Initialize notice hooks.
|
||||
*/
|
||||
public function init() {
|
||||
if ( CartCheckoutUtils::is_cart_block_default() || CartCheckoutUtils::is_checkout_block_default() ) {
|
||||
add_filter( 'woocommerce_kses_notice_allowed_tags', [ $this, 'add_kses_notice_allowed_tags' ] );
|
||||
add_filter( 'wc_get_template', [ $this, 'get_notices_template' ], 10, 5 );
|
||||
add_action(
|
||||
'wp_head',
|
||||
function() {
|
||||
// These pages may return notices in ajax responses, so we need the styles to be ready.
|
||||
if ( is_cart() || is_checkout() ) {
|
||||
wp_enqueue_style( 'wc-blocks-style' );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
add_filter( 'woocommerce_kses_notice_allowed_tags', [ $this, 'add_kses_notice_allowed_tags' ] );
|
||||
add_filter( 'wc_get_template', [ $this, 'get_notices_template' ], 10, 5 );
|
||||
add_action( 'wp_head', [ $this, 'enqueue_notice_styles' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,4 +90,13 @@ class Notices {
|
|||
}
|
||||
return $template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces all notices with the new block based notices.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function enqueue_notice_styles() {
|
||||
wp_enqueue_style( 'wc-blocks-style' );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue