Custom Form Styling for Bootstrap Form
-
Hi,
I’ve been using the following code (https://ww.wp.xz.cn/support/topic/assistance-needed-for-customizing-add-payment-method-ui/) to successfully style the “Stripe payment form”:
add_filter(‘wc_stripe_get_element_options’, function($options, $gateway){
if($gateway->id === ‘stripe_cc’){
$options[‘appearance’] = [
‘variables’ => [
‘fontFamily’ => ‘Inter, sans-serif’,
‘fontSizeBase’ => ’16px’,
‘colorText’ => ‘#fff’
],
‘rules’ => [
‘.Tab’ => [
‘border’ => ‘1px solid #fff’
],
‘.Input’ => [
‘borderRadius’ => ’16px’
]
]
];
}
return $options;
}, 10, 2);
However, when using the “Custom form“ options (such as Bootstrap or other layouts), these styles do not apply. Despite the Stripe iframe loading correctly, the custom styles have no effect. Currently, the issue is that the text appears dark against a dark background, making it unreadable.
I have a few questions:
- Is there a different filter or hook specifically for styling the custom form layouts?
- Are there any known limitations when applying custom styles in this mode?
- Could you provide an example of how to style the input fields when using the Bootstrap layout?
I appreciate your guidance on this. Thanks in advance for your help!
The page I need help with: [log in to see the link]
The topic ‘Custom Form Styling for Bootstrap Form’ is closed to new replies.