Skip to content

feat: add info about where to put SVG assets #37824

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 8 commits into from
Feb 17, 2025
Merged

feat: add info about where to put SVG assets #37824

merged 8 commits into from
Feb 17, 2025

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Jan 27, 2025

Description

Most of the work to remove binary assets is done in the HTTP section.
This PR adds some hints about using SVG for diagrams, where to put them, and how they're included in content.

Motivation

Closing out the discussion with a recommendation for using SVG in shared assets.

@bsmth bsmth requested a review from a team as a code owner January 27, 2025 12:03
@bsmth bsmth requested review from hamishwillee and removed request for a team January 27, 2025 12:03
@github-actions github-actions bot added Content:Meta Content in the meta docs size/s [PR only] 6-50 LoC changed labels Jan 27, 2025
Copy link
Contributor

github-actions bot commented Jan 27, 2025

Preview URLs

Flaws (2)

URL: /en-US/docs/MDN/Writing_guidelines/Howto/Images_media
Title: How to add images, media, and assets
Flaw count: 2

  • broken_links:
    • /en-US/docs/Glossary/aspect_ratio is ill cased
  • macros:
    • Macro produces link /en-US/docs/Glossary/aspect_ratio which is a redirect
External URLs (1)

URL: /en-US/docs/MDN/Writing_guidelines/Howto/Images_media
Title: How to add images, media, and assets

(comment last updated: 2025-02-17 09:28:51)

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -6,6 +6,21 @@ page-type: mdn-writing-guide

{{MDNSidebar}}

## Adding SVGs
Copy link
Collaborator

Choose a reason for hiding this comment

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

The text itself is more or less fine, but it feels structurally odd/out of place:

  • SVG is an image so how does Adding SVGs differ/relate to the following topic on Adding Images
  • Do the rules in Adding images apply to this or not?
  • Do the instructions for shared assets also apply to other types of content? What are the recommendations for shared content - should we have every image in the shared repo, or just those that we intend to be shared.

My thinking on this is that

  • all the image topics should be grouped under an "IMages" heading.
    • The content on SVGs should be image guidelines at the top of that section and we should generally suggest SVG for line/vector images, and PNG or WebP for other image types.
  • The "Adding images" should become "Adding images locally"
  • The Adding to shared assets should appear after adding images locally at the same level.

Structurally that groups like-topics. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good points. I've added something here which partially covers what you mention: 20b286f

  1. Check if you can use something from shared-assets first
  2. Add something to shared-assets instead of the content repos when decorative / secondary
  3. prefer SVG for diagrams, or where it's useful / practical
  4. if you really need to, commit the files to the repo

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Jan 31, 2025
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Feb 3, 2025
bsmth and others added 2 commits February 3, 2025 16:13
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added size/m [PR only] 51-500 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Feb 14, 2025
Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

LGTM. Approving - not merging in case you want to wait on further comments.

@bsmth
Copy link
Member Author

bsmth commented Feb 17, 2025

LGTM. Approving - not merging in case you want to wait on further comments.

I think we're good for now, thanks a lot!

@bsmth bsmth merged commit b750f5f into mdn:main Feb 17, 2025
8 checks passed
@bsmth bsmth deleted the svg-embeds branch February 17, 2025 09:32
cssinate pushed a commit to cssinate/content that referenced this pull request Apr 11, 2025
* feat: add info about where to put SVG assets

* Update files/en-us/mdn/writing_guidelines/howto/images_media/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: restructure sections on images and media

* chore: restructure sections on images and media

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Meta Content in the meta docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants