MODULES
...
eCommerce
FAQ - eCommerce
How to style the Card Fields in any Payment Form using the Stripe Payment Gateway?
5min
the stripe payment gateway provides its own iframe to accept card details securely so direct styling isn't possible instead use javascript introduction the stripe payment gateway provides its own iframe to accept card details securely so it's not possible to have full access to the html structure so you can apply your own styles instead, you can use javascript to pass your styles safely to stripe this method will work on any kind of payment form which uses stripe this includes basic payment form checkout subscription sign up setting styles setting up the javascript variable styles are passed securely to stripe using javascript, rather than your traditional method of applying styles directly with a css file to do this, create a global javascript variable stripe style at the top of your form layout or page its value should be an object like the following \<script> var stripe style = { base { color '#dda0dd', //sets css property "color" of "base" variant ' placeholder' { color '#dda0dd' // sets css property of placeholders within the "base" variant } } } \</script> available selectors and css properties as in the example above the stripe style variable is passed a javascript object you can see stripe's full definition of how this object should be structured using their documentation here https //stripe com/docs/js/appendix/style the first set of keys e g base represents a "variant" or state the elements might be in nested within this, certain allowed css properties may be set renaming the classes advanced you can ask stripe to rename some of the available classes by redefining the classes object to do this in siteglide, create a global variable stripe classes \<script> var stripe classes = { classes { base "my custom container class" //renames the base class from the default "stripeelement" to "my custom container class" } } \</script> any styles you set in the stripe styles object to base will still apply after changing the class, unless you specifically override them you can see a full reference for the available properties for this object in the stripe documentation here https //stripe com/docs/js/elements object/create element?type=card#elements create options classes