Closed driespieters closed 1 year ago
Hey @driespieters Didn't know that classes are used :-) I personally never used the classes, instead I suggest to do this:
[data-ajax-cart-error] {
/* Message is active */
}
[data-ajax-cart-error]:empty {
/* Message is off */
}
Let me know if that works for you. Otherwise I'll think about aria-hidden
or even just hidden
attr for that.
That's a good idea. Didn't think of that selector! Thank you.
After upgrading to v2 I noticed the css classes
js-ajax-cart-message
andjs-ajax-cart-message--error
are no longer available. This makes it hard to apply a nice looking error message.Targetting
[data-ajax-cart-errors]
like the demo does is a bit to limited as adding margin, padding, background color is not possible without it being visible.Suggestion: Add aria-hidden attribute to
[data-ajax-cart-errors]
and set false when the error message is active. (There is a aria-errormessage as well, but not sure if it's applicable here) Perhaps also mention removal in migration docs.Thanks again for this repo!