MomenSherif / react-oauth

Google OAuth2 using the new Google Identity Services SDK for React 🚀
https://www.npmjs.com/package/@react-oauth/google
MIT License
1.05k stars 133 forks source link

The dark theme is terrible #322

Open ptahchiev opened 8 months ago

ptahchiev commented 8 months ago

I was hoping to create a dark version of the button by setting theme to "filled_black", but the result is this:

login-google

As you can see there's a white background in the iframe and it looks terrible. I was unable to overrride it with CSS because it is an iframe

MomenSherif commented 8 months ago

Can you try adding color-scheme dark to your project IDK if it will make google's iframe to render in dark https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme

ptahchiev commented 8 months ago

Hello, thank you for your reply. Where do I need to put this CSS property?

MomenSherif commented 8 months ago

:root similar to mdn example

ptahchiev commented 8 months ago

I tried - no effect.

AxelothLeohryn commented 5 months ago

I removed the color-scheme altogether from my css, and the button now renders correctly in both dark and light themes (I have a switch that changes data-theme="light" / "dark" in my application.

ptahchiev commented 5 months ago

How did you remove the color-scheme?

AxelothLeohryn commented 5 months ago

I just had :root { color-scheme: light dark; } in my index.css and removed that line, for some reason this made it work.

mannakub11 commented 3 months ago

I just had :root { color-scheme: light dark; } in my index.css and removed that line, for some reason this made it work.

Thank you