varabyte / kobweb

A modern framework for full stack web apps in Kotlin, built upon Compose HTML
https://kobweb.varabyte.com
Apache License 2.0
1.53k stars 68 forks source link

Investigate / document issues with `rememberBreakpoint` and exporting #318

Open bitspittle opened 1 year ago

bitspittle commented 1 year ago

If you use ComponentStyle + breakpoints in your Kobweb project, you should get a clean responsive design when you open your page either using mobile or desktop.

Instead, if you rely on rememberBreakpoints too much, what can happen is your site exports with a desktop-sized width, generates such a layout, and then if you load the site on mobile, you'll get a "desktop" snapshot until the JS finishes loading, kicking in, and rerendering the site.

I need to look into this to 1) verify this is happening and 2) find a better way to communicate this to users (maybe via the README and code docs?)

bitspittle commented 1 year ago

Possibly we should let people configure the export width. See https://www.lambdatest.com/support/docs/playwright-test-execution-setup/#:~:text=The%20default%20viewport%20size%20for,shown%20in%20the%20code%20below.