Is there a possibility to use a dark theme for google recaptcha 3?
I tried to add data-theme="dark"
in grecaptcha
block but it doesn't work for me
Asked
Active
Viewed 1,368 times
1

Denys Bezuhlyi
- 11
- 2
2 Answers
1
Have you try this?
document.addEventListener('DOMContentLoaded', (event) => {
const recaptcha = document.querySelector('.g-recaptcha');
recaptcha.setAttribute("data-theme", "dark");
});
Or you can change it manually by find the div with class g-recaptcha
and add the attribute data-theme="dark"
.

muhkanda
- 319
- 1
- 9
-
Hm, maybe you can try this tutorial https://ohiwill.com/how-to-edit-css-of-google-recaptcha-re-style-change-position-resize-recaptcha-badge/ – muhkanda Apr 01 '21 at 09:21
-
Ok, so there is only one way to change the style - by adding custom css styles, ok, there is no other choice, thank's – Denys Bezuhlyi Apr 01 '21 at 12:12
-
It doesn't help too, because we cannot change styles in iframe – Denys Bezuhlyi Apr 02 '21 at 09:39
0
I made this way, actually i made some modifications, but i can't made the badge turn black on first load, i'll still make a refresh for that. https://stackoverflow.com/a/72502375/17791142
i wish this can help you.

Santiago Soñora
- 31
- 1
- 2