Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active November 30, 2021 10:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogists/bcde4824485a720a5ff91be681dd944d to your computer and use it in GitHub Desktop.
Save woogists/bcde4824485a720a5ff91be681dd944d to your computer and use it in GitHub Desktop.
[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
Copy link

Where this code should be placed? Help me plz.

@H-Gomez
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