I'm not having any luck figuring out how I can style the PayPal input boxes for debit/credit card payments. Unlike the pay with paypal button which creates a popup, when you click the debit card option the input boxes are displayed inline. The default styles of the input boxes screws up my design and I would like to make them smaller so they fit the page better (I read that you can't make them a pop-up like the pay with paypal option. Here is a pic:
From the paypal docs, it sounds like I should be able to style the input boxes directly from my own stylesheet using the input boxes id:
"Change the layout, width, height, and outer styling (for example, border, box-shadow, background) of the card fields. You can modify the elements you supply as containers (for example; #card-number { border: 1px solid #333; }) with your current stylesheets.
Typically, input elements calculate their height from font size and line height (and a few other properties), but advanced credit and debit card payments require explicit configuration of height. Make sure you style the height of your containers in your stylesheets. The text of the field components is configured with JavaScript."
I'm using react, I've tried modifying #card-number in my stylesheet but nothing I add changes the input box (font-size/height/background-color). I also render the buttons to a div called #paypalBtns, I tried styling the input boxes through that div as well but couldn't get anything to work (e.g #paypalBtns * {font-size: xx}). Has anyone had success styling these inputs?
Here is the code where I render the paypal buttons:
window.paypal
.Buttons({
createOrder: (data, actions) => {
return actions.order.create({
purchase_units: [
{
amount: {
value: braceletTotal()
}
}
],
application_context: {
shipping_preference: "NO_SHIPPING",
},
})
},
onApprove: async (data, actions) => {
setPaymentLoading('visible')
const order = await actions.order.capture();
const paypalTotal = order.purchase_units[0].amount
processOrder(paypalTotal, customer)
},
})
.render('#paypalBtns')
EDIT
pic of web html: