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

Fix document viewer sizing up to 200% zoom #886

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Conversation

chriswilty
Copy link
Member

Description

Document viewer was not useable at higher zoom levels due to a fixed aspect ratio.

These changes address that, and also optimise spacing at higher zoom breakpoints.

Screenshots

110% Zoom (before first breakpoint)
image

150% Zoom (between first and second breakpoints)
image

200% Zoom (after second breakpoint)
image

Checklist

Have you done the following?

  • Linked the relevant Issue no issue, quick win
  • Added tests
  • Ensured the workflow steps are passing

@chriswilty chriswilty force-pushed the doc-viewer-breakpoint branch from bfd87da to e573bd8 Compare March 28, 2024 16:58
}

.document-viewer-container {
flex-grow: 1;
overflow-y: auto;
width: 32.5rem;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is to keep the paragraph width consistent in terms of characters per line, regardless of zoom / font size. There could be other approaches, but in any case the fixed aspect ratio wasn't working well.

@@ -21,8 +27,23 @@
align-self: stretch;
}

.view-documents-nav .button-container > * {
flex: 1 0 0;
Copy link
Member Author

Choose a reason for hiding this comment

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

This makes the buttons the same size, rather than fit-to-text.

Copy link
Contributor

@dhinrichs-scottlogic dhinrichs-scottlogic left a comment

Choose a reason for hiding this comment

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

checked out the branch and it all works nicely! Thanks for fixing that!

}

.view-documents-nav .button-container .themed-button-wrapper {
flex-grow: 2;
Copy link
Member Author

Choose a reason for hiding this comment

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

This gives the buttons twice as much "extra space" as the page number text.

@chriswilty chriswilty merged commit 2e69def into dev Apr 2, 2024
2 checks passed
@chriswilty chriswilty deleted the doc-viewer-breakpoint branch April 2, 2024 09:24
@chriswilty chriswilty linked an issue Apr 11, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correct docviewer zooming up to 200%
2 participants