We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While ssr you can't get user system color theme. It not saved in cookie and browser don't send Sec-CH-Prefers-Color-Scheme
Sec-CH-Prefers-Color-Scheme
Like this #209, #204, #100
Send Accept-CH: Sec-CH-Prefers-Color-Scheme on every request, and read Sec-CH-Prefers-Color-Scheme if it exist
Accept-CH: Sec-CH-Prefers-Color-Scheme
Alternative you can save color-theme in cookie or combine this techniques
We use code like this
const themeHeader = 'Sec-CH-Prefers-Color-Scheme'; serverInit(req: IncomingMessage, res: ServerResponse) { const cookies = Cookie(req, res); const systemTheme = req.headers[ themeHeader.toLowerCase() ] as SystemThemeName; const userTheme = cookies.get(storeName) as ThemeName; if (systemTheme) this.systemTheme = systemTheme; if (userTheme) this.userTheme = userTheme; res.setHeader('Accept-CH', themeHeader); },
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
While ssr you can't get user system color theme. It not saved in cookie and browser don't send
Sec-CH-Prefers-Color-Scheme
Like this #209, #204, #100
Describe the solution you'd like
Send
Accept-CH: Sec-CH-Prefers-Color-Scheme
on every request, and readSec-CH-Prefers-Color-Scheme
if it existDescribe alternatives you've considered
Alternative you can save color-theme in cookie or combine this techniques
Additional context
We use code like this
The text was updated successfully, but these errors were encountered: