Skip to content

add method to 'scale' SVGs by modifying display size and viewbox #68

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

Merged
merged 10 commits into from
Apr 4, 2025

Conversation

jensens
Copy link
Member

@jensens jensens commented Sep 8, 2022

Needs to be merged before plone/plone.namedfile#133

@mister-roboto
Copy link

@jensens thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@jensens
Copy link
Member Author

jensens commented Sep 13, 2022

@jenkins-plone-org please run jobs

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

Maybe a stupid question (because I should read more about SVG): is it possible to handle this using width/height and the object-fit CSS property on the img tag that references the SVG file, instead of modifying the contents of the SVG?

@jensens
Copy link
Member Author

jensens commented Sep 14, 2022

You can. But it is a workaround only IMO. It would need changes in many places and is orthogonal to our current image handling. We have the infrastructure to modify images, so we can "scale" and "crop" SVGs properly. Also we could then embed those instead of loading them by image tag.

@jensens jensens force-pushed the svg-improvements branch from c6e0f40 to 443fac8 Compare April 2, 2025 12:50
@jensens
Copy link
Member Author

jensens commented Apr 2, 2025

@jenkins-plone-org please run jobs

@jensens jensens force-pushed the svg-improvements branch from 695a8f7 to ac11536 Compare April 3, 2025 15:35
@jensens
Copy link
Member Author

jensens commented Apr 3, 2025

@jenkins-plone-org please run jobs

@jensens jensens merged commit d7fda96 into master Apr 4, 2025
18 checks passed
@jensens jensens deleted the svg-improvements branch April 4, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants