Skip to content

fix #300, extract language icon and remove stray copyright#661

Open
0xDevNinja wants to merge 1 commit intotc39:mainfrom
0xDevNinja:fix/300-svg-cleanup
Open

fix #300, extract language icon and remove stray copyright#661
0xDevNinja wants to merge 1 commit intotc39:mainfrom
0xDevNinja:fix/300-svg-cleanup

Conversation

@0xDevNinja
Copy link
Copy Markdown

Summary

Addresses parts of #300:

  • Extract the inlined language-picker SVG out of _layouts/menu.html into a new file assets/img/language.svg, matching the existing <img src="/assets/img/..."> pattern used by logo.svg / ecma-logo.svg. Drops the inline role="button" (the new <img> carries its own role and gets a localized alt).
  • Remove the stray <!-- Copyright © 2015 Apple Inc. All rights reserved. --> comment and redundant <?xml version="1.0" encoding="utf-8"?> preamble / version="1.1" attribute from assets/img/menu-down.svg.
  • Update _sass/_page-menu.scss to target .menu-link__language img instead of the now-removed inline svg.

Left for follow-up

  • The logo.svg viewBox concern raised in inconsistent use of language selector icon & other SVG asset problems #300 — a quick eyeball of the rendered logo before/after didn't show an obvious problem, so I didn't change it. Worth a separate PR with a clear visual diff.
  • Deeper SVG minification (e.g. SVGO pass over ecma-logo.svg, logo.svg) — left as a follow-up to keep this PR focused.
  • Most locales' site.json files don't define navigation.language.title, so the <img alt> ends up empty for them. That mirrors the prior behavior of the .menu-link__language-text span and is a translation-data gap, not an asset issue.

Test plan

  • npm run lint passes
  • npm run build succeeds; rendered _site/index.html, _site/en/index.html, _site/zh-Hans/index.html all reference /assets/img/language.svg via <img>
  • Did not commit unrelated assets/css/style.css regen (sass version bump produced unrelated diffs)
  • Visual check on a deploy preview that the language icon still renders at 24px in the desktop menu and that the menu-down chevron is unchanged

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