Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Stripe] Add custom Stripe Elements styles using the `wc_stripe_elements_styling` filter. Add this to your custom child theme functions.php
// Stripe provides a filter for you to add custom Stripe Elements Styling
// See full documentation from Stripe on what elements are available to be styled here:
// https://stripe.com/docs/stripe-js/reference#element-options
add_filter( 'wc_stripe_elements_styling', 'woogist_add_stripe_elements_styles' );
function woogist_add_stripe_elements_styles($array) {
$array = array(
'base' => array(
'color' => '#bada55',
'fontFamily' => 'Tahoma',
'fontSize' => '30px'
),
'invalid' => array(
'color' => '#0099e5'
)
);
return $array;
}
@azmatmehmood

This comment has been minimized.

Copy link

azmatmehmood commented Apr 14, 2018

Where this code should be placed? Help me plz.

@H-Gomez

This comment has been minimized.

Copy link

H-Gomez commented Sep 10, 2019

Where this code should be placed? Help me plz.

We placed this in our file that has custom functionality for Woocommerce, for example, themes/my-theme/lib/woocommerce-checkout.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.