Created
January 15, 2024 20:55
-
-
Save amberhinds/1433c2c6ec2e0b3a65e632bb784e7c1b to your computer and use it in GitHub Desktop.
CSS Fixes to make WooCommerce more accessible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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