#Mikail - Card Element styling
1 messages · Page 1 of 1 (latest)
Using your own inputs to handle card details is not recommended, and may come with some PCI compliance implication for you: https://stripe.com/docs/security/guide#validating-pci-compliance
We recommend using our Elements for the payment detail collection.
We do support customization of the inputs (with some limitations). Which Element(s) are you using?
CardElement
Is there a way to style the components using css instead of passing props?
Mikail - Card Element styling
You can either leverage the existing StripeElement classes that are added to the element in various states:
https://stripe.com/docs/js/element/the_element_container
Or as noted there, you can specify another classname for Stripe.js to apply for you to the element container:
https://stripe.com/docs/js/elements_object/create_element?type=card#elements_create-options-classes
For the internals, you can pass a style object (using the linked specifications) to the element during creation:
https://stripe.com/docs/js/elements_object/create_element?type=card#elements_create-options-style
NP!