Skip to content

Commit b0f1538

Browse files
fix(pages): recouple button theme to colorScheme and fix appearance for some logos in dark mode (#12537)
* recouple button theme to colorScheme * fix appearance for some logos in dark mode --------- Co-authored-by: Thang Vu <hi@thvu.dev>
1 parent 63fdab1 commit b0f1538

File tree

2 files changed

+54
-36
lines changed

2 files changed

+54
-36
lines changed

packages/core/src/lib/pages/signin.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ export default function SigninPage(props: {
126126
type="submit"
127127
className="button"
128128
style={{
129-
"--provider-bg": "#fff",
130-
"--provider-bg-hover": `color-mix(in srgb, ${color} 30%, #fff)`,
131-
"--provider-dark-bg": "#161b22",
132-
"--provider-dark-bg-hover": `color-mix(in srgb, ${color} 30%, #000)`,
129+
"--provider-brand-color": color,
133130
}}
134131
tabIndex={0}
135132
>

packages/core/src/lib/pages/styles.css

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
--color-button-active-background: #f9f9f9;
1919
--color-button-active-border: #aaa;
2020
--color-separator: #ccc;
21+
--provider-bg: #fff;
22+
--provider-bg-hover: color-mix(
23+
in srgb,
24+
var(--provider-brand-color) 30%,
25+
#fff
26+
);
2127
}
2228

2329
.__next-auth-theme-dark {
@@ -30,6 +36,30 @@
3036
--color-button-active-background: #060606;
3137
--color-button-active-border: #666;
3238
--color-separator: #444;
39+
--provider-bg: #161b22;
40+
--provider-bg-hover: color-mix(
41+
in srgb,
42+
var(--provider-brand-color) 30%,
43+
#000
44+
);
45+
img[src$="42-school.svg"],
46+
img[src$="apple.svg"],
47+
img[src$="boxyhq-saml.svg"],
48+
img[src$="eveonline.svg"],
49+
img[src$="github.svg"],
50+
img[src$="mailchimp.svg"],
51+
img[src$="medium.svg"],
52+
img[src$="okta.svg"],
53+
img[src$="patreon.svg"],
54+
img[src$="ping-id.svg"],
55+
img[src$="roblox.svg"],
56+
img[src$="threads.svg"],
57+
img[src$="wikimedia.svg"] {
58+
filter: invert(1);
59+
}
60+
#submitButton {
61+
background-color: var(--provider-bg, var(--color-info));
62+
}
3363
}
3464

3565
@media (prefers-color-scheme: dark) {
@@ -43,40 +73,31 @@
4373
--color-button-active-background: #060606;
4474
--color-button-active-border: #666;
4575
--color-separator: #444;
46-
}
47-
48-
button,
49-
a.button {
50-
color: var(--provider-dark-color, var(--color-primary)) !important;
51-
background-color: var(
52-
--provider-dark-bg,
53-
var(--color-background)
54-
) !important;
55-
56-
&:hover {
57-
background-color: var(
58-
--provider-dark-bg-hover,
59-
var(--color-background-hover)
60-
) !important;
76+
--provider-bg: #161b22;
77+
--provider-bg-hover: color-mix(
78+
in srgb,
79+
var(--provider-brand-color) 30%,
80+
#000
81+
);
82+
img[src$="42-school.svg"],
83+
img[src$="apple.svg"],
84+
img[src$="boxyhq-saml.svg"],
85+
img[src$="eveonline.svg"],
86+
img[src$="github.svg"],
87+
img[src$="mailchimp.svg"],
88+
img[src$="medium.svg"],
89+
img[src$="okta.svg"],
90+
img[src$="patreon.svg"],
91+
img[src$="ping-id.svg"],
92+
img[src$="roblox.svg"],
93+
img[src$="threads.svg"],
94+
img[src$="wikimedia.svg"] {
95+
filter: invert(1);
6196
}
62-
63-
span {
64-
color: var(--provider-dark-bg) !important;
97+
#submitButton {
98+
background-color: var(--provider-bg, var(--color-info));
6599
}
66100
}
67-
68-
img[src$="42-school.svg"],
69-
img[src$="apple.svg"],
70-
img[src$="boxyhq-saml.svg"],
71-
img[src$="eveonline.svg"],
72-
img[src$="github.svg"],
73-
img[src$="mailchimp.svg"],
74-
img[src$="medium.svg"],
75-
img[src$="okta.svg"],
76-
img[src$="threads.svg"],
77-
img[src$="wikimedia.svg"] {
78-
filter: invert(1);
79-
}
80101
}
81102

82103
html {
@@ -196,7 +217,7 @@ a.button {
196217
}
197218

198219
span {
199-
color: #fff;
220+
color: var(--provider-bg);
200221
}
201222
}
202223

0 commit comments

Comments
 (0)