Styling Square Payment Input Fields
-
It seems that Square uses iframe elements to deliver the credit card input fields. I’m assuming this is for enhanced security which is great, but it leads to a big issue in trying to style those fields.
Because the fields are delivered through iframe, I don’t have direct access to the style via CSS. This is a particular problem for me because the input fields have absurdly large font size making it get cut off on mobile devices.
To be clear, I’m not talking about anything outside the iframe elements such as the labels or the surrounding elements.
I’ve seen this question brought up in two other threads I could find. In both cases it seems like the person gave up and switched to another plugin, which I would like to avoid.
Topic 1: Square credit card number field
Topic 2: Issue customising the css for square payment formIn the first topic, it is suggested to switch to the “Storefront” theme to see if that fixes it, but I don’t see how that could possibly fix the issue as the CSS for the iframe content is determined by the document within the iframe. If there is a way to do this via CSS, please let me know what selector to use and that will take care of it.
In the second topic, the response seemed more what I was expecting. The style cannot be changed by CSS alone because of the iframe document. Unfortunately, the response was vague about what WOULD fix the problem. It just says “It would require custom coding”.
Can anyone elaborate on that? Is there some kind of filter or action hook I can use to manipulate the font size of the payment input field values?
The topic ‘Styling Square Payment Input Fields’ is closed to new replies.