#baris-paymentelement
1 messages · Page 1 of 1 (latest)
let me look into this but I think it just uses the style of the DOM element you are mounting the PaymentElement to, so that's where you'd set the background
Oh I see, I have set color-scheme: dark; on the root <html>, just found out that was caused by that. By removing it the white background disappeared.
now it looks like this, is there any workaround for the css property color-scheme?
My application has light and dark mode themes and by toggling the darkmode Im setting color-scheme: dark at the root level of the DOM. This seems to break the background of the PaymentElement.
a better visualization of it.
can you clarify if you actually intend to change the color scheme dynamically?
but I agree this seems like a bug
I'll work with the relevant team on trying to fix this or find a workaround
Oh thank you! Should I open a github issue in the react-stripe-jsjs for that?
you could do that, but let me keep this thread open for a bit and see if my colleagues have any input first
one thing that at least works for me is
<div id="payment-element" class="element-container">
+
color-scheme: dark;
}
.element-container{
background-color: black;
color-scheme: normal;
}
const appearance = {
theme: 'night',
};
elements = stripe.elements({ appearance, clientSecret });
(not React but you get my meaning I'm sure). i..e applying the normal scheme to the containing div for the PaymentElement and then manually setting background color.
It's really not ideal though.