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

perf(presentation): Improve presentation rendering performance in Safari #1401

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib/viewers/doc/Presentation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
bottom: 0;
left: 0;
margin: auto;

&.bp-is-invisible {
opacity: 0; // Combine with visibility: hidden to improve large file performance in Safari
}
}

&.overflow-x {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/viewers/doc/_docBase.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ $thumbnail-sidebar-width: 191px; // Extra pixel to account for sidebar border
background-color: $d-eight;
border-radius: $thumbnail-border-radius;
box-shadow: 0 0 0 1px $off-white, 0 1px 4px 0 rgba(0, 0, 0, .08);
transition: box-shadow 50ms ease;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed some jank when mousing quickly over different thumbnails, so I removed this brief transition. It's perf-related, but I can move it to a separate PR if desired.

}

.bp-thumbnail-page-number {
Expand All @@ -101,7 +100,6 @@ $thumbnail-sidebar-width: 191px; // Extra pixel to account for sidebar border
border-radius: $thumbnail-border-radius / 2 0 $thumbnail-border-radius 0;
box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, .2);
opacity: 0;
transition: background 50ms ease, opacity 50ms ease;
}

.bp-thumbnail-image {
Expand Down