Closed Bernton closed 10 months ago
Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-coast-028fe6203-265.westeurope.3.azurestaticapps.net
Not sure why the snapshot is different actually, on non-mobile browsers, there shouldn't be a difference.
The snapshot just looks at the outputted HTML, and this change updates some classes in the HTML so the snapshot is not the same anymore.
Shouldn't the snapshot only account for visual changes?
These are just the snapshots from Vitest, in the unit tests. You can see the output of it as they're checked into Git: https://github.com/bcc-code/bcc-design/blob/main/design-library/src/components/BccModal/__snapshots__/BccModal.spec.ts.snap
Their utility in that regard is limited, but I think they still can be nice as changes to the HTML often indicate that there might be some change that needs to be added to the release notes, as they're important for people that use the CSS library. Additionally I ran into it before when updating the button that it also touches components that internally use the button component, reminding me to check them.
Comparing visual snapshots would also be very nice but is on a very different level. There are tools for it (Chromatic is one, from the makers of Storybook) but it's more involved as it essentially requires spinning up a browser. When I review a PR I do this manually by comparing the production Storybook with the output of the PR.
@u12206050 raised the point that dvw
and dvh
might not have wide enough support among browsers, what do you think? @laurensgroeneveld
I thought so as well but according to caniuse the support is great: https://caniuse.com/mdn-css_types_length_viewport_percentage_units_dynamic
Support is good, but it doesn't yet cover the last three versions.
I suggested we use env(safe-area-inset-bottom)
which does have better support, and works fine for the event app.
Probably this time next year we can use dvw
Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-coast-028fe6203-265.westeurope.3.azurestaticapps.net
Change summary
use 100dvw and 100dvh instead of w-screen and h-screen
Without this, the dialog will overflow on mobile browser, because they dynamically display navigation bar when users scroll up/down. "w-screen" and "h-screen" (vw, vh) don't react correctly to this.
Change type