mage2pro/square

Highlight the focused bank card form field (like the Stripe extension does)

Closed this issue · 3 comments

The Stripe extension highlights the focused bank card form field:

04

The Square extension does not highlight the focused bank card form field:

05

«Square Connect API» → «Adjusting exterior styles for input focus and validation errors»:

In certain situations, additional classes are applied to one or more of the form's four iframes:
When a particular input has focus, its iframe is given a class name with the pattern [value of inputClass]--focus.
For example, if you specify card-form as the base inputClass, an iframe with focus is given the additional class card-form--focus.

https://docs.connect.squareup.com/articles/adding-payment-form#adjustingexteriorstyles

«Is there a CSS selector by class prefix?»

It's not doable with CSS2.1, but it is possible with CSS3 attribute substring-matching selectors (which are supported in IE7+):

div[class^="status-"], div[class*=" status-"]

https://stackoverflow.com/a/8588532

Implemented in the 1.3.8 version:
06