feat: When displaying SVGs, max out their size #684
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SVGs are often constructed to be scaled up and down to various sizes, and since SVGs are a primarily vector format, they can be scaled up and down without quality loss. Many of these SVG files are constructed w/o consideration of the viewbox dimensions. Some are tiny, and some are massive. When they are rendered on a site, these intrinsic dimensions don't matter much, as they are almost always resized for the layout context (e.g. svg { width: 100%; }).
How does this affect Lightbox? When using SVGs with Lightbox, we are seeing some files render very tiny. This is because of their small intrinsic dimensions.
To resolve this issue, when an SVG is loaded in Lightbox, rather than reading the width and height, we max out the image in the viewport.
#681
@davidc Considering this update to resolve your issue.