Skip to content

Instantly share code, notes, and snippets.

@amberhinds
Created January 15, 2024 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amberhinds/1433c2c6ec2e0b3a65e632bb784e7c1b to your computer and use it in GitHub Desktop.
Save amberhinds/1433c2c6ec2e0b3a65e632bb784e7c1b to your computer and use it in GitHub Desktop.
CSS Fixes to make WooCommerce more accessible
/** Fix focus indicators **/
.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image a:focus,
.wc-block-components-product-image a:focus,
.wp-element-button:focus,
.wp-block-button__link:focus {
outline-style: solid;
outline-width: 2px;
outline-offset: 2px;
}
.editor-styles-wrapper .wc-block-grid__products .wc-block-grid__product .wc-block-components-product-image a, .wc-block-components-product-image a {
display: block;
}
/** Color contrast fixes **/
.wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward {
opacity: .9;
}
.wc-block-components-form .wc-block-components-text-input label, .wc-block-components-text-input label {
color: hsl(0deg 0% 7% / 76%);
}
.woocommerce form .form-row .required,
.wc-block-components-form .wc-block-components-text-input.has-error label, .wc-block-components-text-input.has-error label,
.wc-block-components-validation-error {
color: #ae1414 !important;
}
/** No color alone fixes **/
.wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward:hover {
text-decoration: none;
}
.wc-block-components-checkout-return-to-cart-button:hover,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
text-decoration: underline;
}
/** Revert visual layout after fixing focus order on checkout page **/
.order-corrected .wc-block-components-sidebar-layout {
flex-direction: row-reverse;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment