Skip to content

Commit

Permalink
fix(atomic): hide unhydrated results (#4900)
Browse files Browse the repository at this point in the history
https://coveord.atlassian.net/browse/KIT-3775
Inspired by https://bbellmyers.github.io/2020/09/27/fouc-stencil.html.

Not a definitive fix: When Lit migration is done for the atomic-result,
we should validate for regression on that front, and also try to improve
the behavior even so slightly.
It might also be preferable to migrate all result components first, so
that we can "cut" this behavior neatly. (would likely not happen because
I _think_ we scan documentFragment from template element, so we should
have all the element defined by then (tho maybe not because of race
conditions, in which case
https://www.abeautifulsite.net/posts/flash-of-undefined-custom-elements
might be adapted for our needs)
  • Loading branch information
louis-bompart authored Feb 4, 2025
1 parent 3ba383c commit 5bb6b51
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@
}
}
}

atomic-product:not(.hydrated) {
visibility: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
font-size: var(--atomic-text-2xl);
font-weight: var(--atomic-font-bold);
}

atomic-product:not(.hydrated) {
visibility: hidden;
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
@import '../../../common/item-list/styles/placeholders.pcss';
@import '../styles/list-display.pcss';
atomic-result:not(.hydrated) {
visibility: hidden;
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
@import '../../../common/item-list/styles/placeholders.pcss';
@import '../styles/list-display.pcss';
atomic-result:not(.hydrated) {
visibility: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
font-size: var(--atomic-text-2xl);
font-weight: var(--atomic-font-bold);
}

atomic-result:not(.hydrated) {
visibility: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
font-size: var(--atomic-text-2xl);
font-weight: var(--atomic-font-bold);
}

atomic-result:not(.hydrated) {
visibility: hidden;
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
@import '../../../common/item-list/styles/placeholders.pcss';
@import '../../../common/item-list/styles/list-display.pcss';
atomic-result:not(.hydrated) {
visibility: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
@import '../../../common/item-list/styles/table-display.pcss';
@import '../../../common/item-list/styles/list-display.pcss';
@import '../../../common/item-list/styles/grid-display.pcss';
atomic-result:not(.hydrated) {
visibility: hidden;
}

0 comments on commit 5bb6b51

Please sign in to comment.