Responsive design and ssr
Unanswered
Sirex woodwasp posted this in #help-forum
Sirex woodwaspOP
Hello friends,
I have a simple question when it comes to dealing with SSR and responsive design. I wouldn't say that I'm not totally adding behavioral features, but also removing and maybe adding some JS based on device width.
I'm at the beginning of this journey. What do you guys prefer?
- Using user agent request (which is mostly not preferred since it's not based on specific width and also not usually accurate).
- Should I suspense my client section that's relying on getting the size of the windows ? (this seems kind I cool but I fear I'm laterally way over reaching)
- Or should I use the CSS approach and add some markups (this is also an option) ?
I have a simple question when it comes to dealing with SSR and responsive design. I wouldn't say that I'm not totally adding behavioral features, but also removing and maybe adding some JS based on device width.
I'm at the beginning of this journey. What do you guys prefer?
- Using user agent request (which is mostly not preferred since it's not based on specific width and also not usually accurate).
- Should I suspense my client section that's relying on getting the size of the windows ? (this seems kind I cool but I fear I'm laterally way over reaching)
- Or should I use the CSS approach and add some markups (this is also an option) ?
2 Replies
@Sirex woodwasp Hello friends,
I have a simple question when it comes to dealing with SSR and responsive design. I wouldn't say that I'm not totally adding behavioral features, but also removing and maybe adding some JS based on device width.
I'm at the beginning of this journey. What do you guys prefer?
- Using user agent request (which is mostly not preferred since it's not based on specific width and also not usually accurate).
- Should I suspense my client section that's relying on getting the size of the windows ? (this seems kind I cool but I fear I'm laterally way over reaching)
- Or should I use the CSS approach and add some markups (this is also an option) ?
if I would be you, I would use tailwind and the breakpoint logic from tailwind: https://tailwindcss.com/docs/responsive-design
Like that I can style server components and they are automatically translated to a responsive design. SSR and responsive isn't a problem then ^^
Like that I can style server components and they are automatically translated to a responsive design. SSR and responsive isn't a problem then ^^
Sirex woodwaspOP
That's amazing the problem that I'm using CSS and for better or worst I might need to add specific JavaScript logic depending on my situation
i'm thinking about us client hints or something like that using them cookies
i'm thinking about us client hints or something like that using them cookies