detect mode and device #1232
amitu
started this conversation in
Ideas & RFCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using
fastn
in dynamic mode (runningfastn serve
on a server instead of usingfastn build
), we generate default HTML with assumptions about the device. If the assumption is incorrect we nuke the DOM after page load and recreate the page.We can do better by better guessing the device by looking at user agent for the first page load scenario. For dark mode preferences we can use Sec-CH-Prefers-Color-Scheme.
We can further set cookie by detecting these properties on client side, and rely on the cookie to send the right HTML.
Beta Was this translation helpful? Give feedback.
All reactions