Skip to content

[Bug] Dark Theme for <PayPalButtons/> #584

@eriknyk

Description

@eriknyk

Library used

Using react-paypal-js v8.7.0

🐞 Describe the Bug

Using react-paypal-js I cannot find a way (at least documented) to enable dark mode for component.

🔬 Minimal Reproduction

 <PayPalScriptProvider
    options={{
      clientId: PAYPAL_CLIENT_ID,
      components: "buttons",
      currency: "USD",
    }}
  >
  <PayPalButtons
    style={{ layout: "vertical" }}
    createOrder={createOrder}
    onApprove={onApprove}
  />
</PayPalScriptProvider>

😕 Actual Behavior

I couldn't find a way to display checkout buttons and card form in dark mode.

image image

🤔 Expected Behavior

Find a way to display checkout buttons and card form in dark mode. It looks there is a way to display buttons & card checkout form in dark mode, but no idea how. see [Additional Context] images below

🌍 Environment

  • Node.js/npm: - Node v20.13.1 / NPM 10.5.2
  • OS: - MacOS
  • Browser: - Chrome latest

➕ Additional Context

In the storybook, on canvas tab If you set the background color to dark, dark theme for buttons works fine even for one-time checkout form.

image image

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions