Skip to content
New issue

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

How can we avoid CLS? #35

Open
Conceptiks opened this issue Apr 30, 2024 · 1 comment
Open

How can we avoid CLS? #35

Conceptiks opened this issue Apr 30, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Conceptiks
Copy link

Hey, I am trying to create a masonry grid without any (or very little) layout shift. Is this possible with svelte-bricks. My current attempts always load a one-column layout which then shifts to adjust for the viewport width. Any tips?

@janosh
Copy link
Owner

janosh commented Apr 30, 2024

yeah, the layout shift in svelte-bricks is admittedly terrible. it needs JS to compute the number of columns based on the container width. i may be wrong but i think the only way to avoid that is a CSS-only solution (maybe this has become slightly easier now with CSS container queries). or delay rendering altogether until JS is ready. PRs for either of those would be welcome

@janosh janosh added enhancement New feature or request help wanted Extra attention is needed labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants