Skip to content

Commit

Permalink
content-visibility issue fix/hax
Browse files Browse the repository at this point in the history
  • Loading branch information
schlosser committed Dec 21, 2020
1 parent e941e68 commit 04f30f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions _js/progressive-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
function () {
if (document.body.className.indexOf(this.id) == -1) {
this.viewerOpen = false;
this.figure.closest("section").style.contentVisibility = "auto";
this.figure.className = this.figure.className
.replace("is-open", "")
.replace(/^\s+|\s+$/g, "");
Expand Down Expand Up @@ -183,6 +184,12 @@
translateX = figureBoundingRect.left * -1;
}

try {
this.figure.closest("section").style.contentVisibility = "visible";
} catch (error) {
console.error(error);
}

// Apply DOM transformations
document.body.className += " " + this.id;
this.figure.className += " is-open";
Expand Down
2 changes: 1 addition & 1 deletion _scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ footer .footer-wrapper {

.path {
@extend %h2;
margin-bottom: 4rem;
padding-left: 3.6rem;
text-indent: -3.6rem;
margin-bottom: 4rem;
user-select: none;

.component {
Expand Down
4 changes: 2 additions & 2 deletions _scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ $text-width: 44rem;
}

section {
margin: 6rem 0;
content-visibility: auto;
contain-intrinsic-size: 1000px; // Total estimate
content-visibility: auto;
margin: 6rem 0;

&.collection {
padding: 4.5rem 0;
Expand Down

0 comments on commit 04f30f4

Please sign in to comment.