Skip to content

Commit 86039a8

Browse files
ashimokawaGusted
authored andcommitted
fix(a11y): unreadable image captcha with dark themes (go-gitea#7390)
- When the user has a dark theme selected, image captchas are sometimes unreadable. - Make sure the image captcha always has a white background color. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7390 Reviewed-by: 0ko <[email protected]> Reviewed-by: Beowulf <[email protected]> Reviewed-by: Gusted <[email protected]> Co-authored-by: Andreas Shimokawa <[email protected]> Co-committed-by: Andreas Shimokawa <[email protected]>
1 parent 2348955 commit 86039a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/user/auth/captcha.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{if .EnableCaptcha}}{{if eq .CaptchaType "image"}}
22
<div class="inline field tw-text-center">
33
<input type="hidden" name="img-captcha-id" value="{{.Captcha}}">
4-
<img style="transform: scaleX(-1)" onclick="this.src=`{{AppSubUrl}}/captcha/{{.Captcha}}.png?reload=${Date.now()}`" class="captcha-img" src="{{AppSubUrl}}/captcha/{{.Captcha}}.png" alt="{{ctx.Locale.Tr "captcha"}}">
4+
<img style="transform: scaleX(-1);background-color: white" onclick="this.src=`{{AppSubUrl}}/captcha/{{.Captcha}}.png?reload=${Date.now()}`" class="captcha-img" src="{{AppSubUrl}}/captcha/{{.Captcha}}.png" alt="{{ctx.Locale.Tr "captcha"}}">
55
</div>
66
<div class="required field {{if .Err_Captcha}}error{{end}}">
77
<label for="captcha">{{ctx.Locale.Tr "captcha"}}</label>

0 commit comments

Comments
 (0)