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 same-origin issues when referencing SVG symbols #4407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

montalvomiguelo
Copy link
Contributor

@montalvomiguelo montalvomiguelo commented Aug 31, 2024

WHY are these changes introduced?

These changes are made to resolve same-origin issues when referencing symbols with the use tag from SVG files in themes during development.
Screenshot 2024-08-31 at 11 53 33 AM

WHAT is this pull request doing?

Adds SVGs to the local assets middleware.

How to test your changes?

  • Serve a theme with an SVG asset containing icons/<symbol>s.
  • Reference an icon from the SVG asset using the <use> tag and the asset_url filter.
    <svg><use href="{{ 'icons.svg' | asset_url }}#icon-login"/></svg>
  • The icon should load as expected.
Screenshot 2024-08-31 at 11 51 33 AM

cc @karreiro (:

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

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.

1 participant