diff --git a/assets/base.css b/assets/base.css index 6ad490f..e8c5834 100644 --- a/assets/base.css +++ b/assets/base.css @@ -1352,9 +1352,17 @@ shopify-accelerated-checkout-cart { .button.disabled, .customer button:disabled, .customer button[aria-disabled='true'], -.customer button.disabled, +.customer button.disabled { + cursor: not-allowed; + opacity: 0.5; +} + +/* Dim the icon only. Opacity on the button would also dim its focus ring. */ .quantity__button.disabled { cursor: not-allowed; +} + +.quantity__button.disabled svg { opacity: 0.5; } diff --git a/assets/global.js b/assets/global.js index bde1d32..a5535b6 100644 --- a/assets/global.js +++ b/assets/global.js @@ -267,12 +267,16 @@ class QuantityInput extends HTMLElement { const value = parseInt(this.input.value); if (this.input.min) { const buttonMinus = this.querySelector(".quantity__button[name='minus']"); - buttonMinus.classList.toggle('disabled', parseInt(value) <= parseInt(this.input.min)); + const atMin = parseInt(value) <= parseInt(this.input.min); + buttonMinus.classList.toggle('disabled', atMin); + buttonMinus.setAttribute('aria-disabled', atMin); } if (this.input.max) { const max = parseInt(this.input.max); const buttonPlus = this.querySelector(".quantity__button[name='plus']"); - buttonPlus.classList.toggle('disabled', value >= max); + const atMax = value >= max; + buttonPlus.classList.toggle('disabled', atMax); + buttonPlus.setAttribute('aria-disabled', atMax); } } }