Skip to content

Commit

Permalink
Fix dismiss button in two WC admin notices
Browse files Browse the repository at this point in the history
The dismiss button in the WC admin notices `legacy_shipping` and `no_shipping_methods` was not fully clickable due to a custom CSS applied to them. This custom CSS was used to add a background image to those notices. More specifically, the problem was caused by the use of `position: relative` applied to `<p>` elements. I couldn't find an easy way to fix this problem keeping the custom background image, so I opted to remove it to make the design of all notices identical (besides the background image, the custom CSS also added a few other differences to those to notices like the font size of the notice title).
  • Loading branch information
rodrigoprimo committed Apr 25, 2019
1 parent 5c1936b commit 00128fe
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
31 changes: 0 additions & 31 deletions assets/css/activation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,34 +66,3 @@ p.woocommerce-actions,
.woocommerce-about-text {
margin-bottom: 1em !important;
}

div.woocommerce-legacy-shipping-notice,
div.woocommerce-no-shipping-methods-notice {
overflow: hidden;
padding: 1px 12px;

p {
position: relative;
z-index: 1;
line-height: 1.5em;
margin: 12px 0;

&.main {
font-size: 1.1em;
}
}

&::before {
content: "\e01b";
font-family: "WooCommerce";
text-align: center;
line-height: 1;
color: #f7f1f6;
display: block;
width: 1em;
font-size: 20em;
top: 36px;
right: 12px;
position: absolute;
}
}
2 changes: 1 addition & 1 deletion includes/admin/views/html-notice-legacy-shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
exit;
}
?>
<div id="message" class="updated woocommerce-message woocommerce-legacy-shipping-notice">
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'legacy_shipping' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>">
<?php esc_html_e( 'Dismiss', 'woocommerce' ); ?>
</a>
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/views/html-notice-no-shipping-methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
exit;
}
?>
<div id="message" class="updated woocommerce-message woocommerce-no-shipping-methods-notice">
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'no_shipping_methods' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>">
<?php esc_html_e( 'Dismiss', 'woocommerce' ); ?>
</a>
Expand Down

0 comments on commit 00128fe

Please sign in to comment.