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

Keep viewBox attribute on optimized SVGs #1760

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

fturmel
Copy link
Collaborator

@fturmel fturmel commented Nov 6, 2024

Closes #1759

This was introduced with #1745, svgo defaults strip-out the viewBox attribute, which is functional and not a safe optimization to blindly apply.

For reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox

When an SVG contains a viewBox attribute (often in combination with a preserveAspectRatio attribute), a transform stretches or resizes the SVG viewport to fit a particular container element.

Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for codingtrain ready!

Name Link
🔨 Latest commit 0116ef7
🔍 Latest deploy log https://app.netlify.com/sites/codingtrain/deploys/672bff7902f2290008b3f7d5
😎 Deploy Preview https://deploy-preview-1760--codingtrain.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@fturmel fturmel requested a review from shiffman November 6, 2024 23:51
@coderpro1234-2
Copy link

Preview fixes issue #1759

Copy link
Member

@shiffman shiffman left a comment

Choose a reason for hiding this comment

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

Thank you @fturmel apologies it took me so long to review this. The fix looks great to me, really appreciate you taking the time!

@shiffman shiffman merged commit b339b74 into CodingTrain:main Nov 12, 2024
5 checks passed
@fturmel fturmel deleted the PR/fix-svg-viewbox branch November 12, 2024 12:32
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.

"The Coding Train" Footer Logo Being Cut Off.
3 participants