Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CardElement isn't transparent if color-scheme is set in parent page #878

Open
Aycarambo opened this issue Mar 21, 2024 · 2 comments
Open

Comments

@Aycarambo
Copy link

At least using google Chrome, iframes are not transparent if they do not contain the same color-scheme tag value as the parent page.

So when implementing a dark theme on a website, it is impossible to style the background-color of the CardElement to match the user's current theme.

Potential solution : add a new optionnal object key to the CardElement({}) constructor for passing in the value of the color-scheme tag.

@jritterbush
Copy link

jritterbush commented Jul 9, 2024

I think another option could be if Recurly could add <meta name="color-scheme" content="light dark"> to the head of the iframed page so that if the parent page is set to dark or light either should work.

@jritterbush
Copy link

My workaround was to add .recurly-hosted-field-card iframe { color-scheme: light } to my CSS.

That forces the iframe to light mode, which makes the iframe transparent so your site will control the background color at least. The fontColor prop can then be set based on your site's color-scheme/theme. That is working for me until a more permanent fix can be set up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants