Home Forums WoodMart support forum Unable to apply dark mode styling to Stripe payment form (WooCommerce Stripe Gat

Unable to apply dark mode styling to Stripe payment form (WooCommerce Stripe Gat

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #681794

    vogdex2008
    Participant

    Hi team,

    I’m having trouble customizing the appearance of the Stripe payment form on my checkout page. I’m using the WooCommerce Stripe Gateway plugin and want the form to match my site’s dark theme.

    I’ve tried multiple approaches, including the suggestions in the official documentation, but nothing seems to work. The Stripe form fields (card number, expiration, CVC) are rendered inside iframes, so my CSS and theme PHP hooks don’t affect them.

    Example of the PHP code I’ve tried in my theme’s functions.php:

    add_filter( ‘wc_stripe_upe_params’, function( $params ) {
    if ( ! is_admin() ) {
    $params[‘blocksAppearance’] = [
    ‘variables’ => [
    ‘fontFamily’ => ‘Arial, sans-serif’,
    ‘fontSize’ => ’16px’,
    ‘colorBackground’ => ‘#1e1e1e’,
    ‘colorText’ => ‘#ffffff’,
    ‘colorPlaceholder’ => ‘#aaaaaa’,
    ‘colorBorder’ => ‘#333333’,
    ‘colorDanger’ => ‘#ff6b6b’,
    ],
    ];
    }
    return $params;
    });

    add_action(‘init’, function() {
    if ( ! is_admin() ) {
    delete_transient( ‘wcpay_upe_appearance’ );
    delete_transient( ‘wcpay_upe_appearance_theme’ );
    }
    });

    Despite adding this code and clearing transients, the payment form still shows the default light styling.
    Any help would be greatly appreciated!

    Attachments:
    You must be logged in to view attached files.
    #681804

    mantsve
    Participant

    Just inspect stripe payment block with dev tools and find css classes.. and use custom css to override.. do not forget to use !important

Viewing 2 posts - 1 through 2 (of 2 total)