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

Add SDG icons in SVG format #4675

Merged
merged 8 commits into from
Sep 30, 2021
Merged

Add SDG icons in SVG format #4675

merged 8 commits into from
Sep 30, 2021

Commits on Sep 30, 2021

  1. Rename folder method in SDG icon component

    The method name was a bit confusing because it returned a locale.
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    5de9054 View commit details
    Browse the repository at this point in the history
  2. Load SDG icons in SVG when available

    SVG files are smaller than PNG files, can be compressed, and are
    scalable.
    
    We're choosing to render SVG files as images instead of inline because
    inline SVGs aren't cached nor compressed, and they might appear several
    times on the same page, making the generated HTML much larger.
    
    We could also load them with an SVG sprite, using `<use>`, which would
    reduce the number of HTTP requests when several icons are present on the
    page (like in the index of most sections). However, using SVG inside an
    `<img>` tag is universally supported, while the `<use>` tag doesn't
    work in Internet Explorer when using an external URI and support in
    Opera Mini and UC Browser is unknown.
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    78811f5 View commit details
    Browse the repository at this point in the history
  3. Add SDG English icons in SVG format

    These icons have been downloaded from The Global Goals page [1]. English
    is the official language of this page and the only one containing all
    the information.
    
    Since SVG icons are smaller and can be compressed, users browsing the
    page in English will have to download about 45KB for the SDG icons,
    instead of the 250KB they needed to download when using PNGs.
    
    [1] https://globalgoals.org
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    3a2fb1a View commit details
    Browse the repository at this point in the history
  4. Add SDG Spanish icons in SVG format

    Based on an EPS file downloaded from The Global Goals page [1].
    
    Although in that page there are icons for other languages we support and
    that we've only got in PNG format, the Spanish ones are the only ones
    which are similar to the official PNG ones provided by the UN or
    UN-related organizations like UNRIC. Icons in other languages (like
    Chinese, French or Russian) are not that similar to the official PNG
    icons and their quality is (in my humble opinion) lower.
    
    Since SVG icons are smaller and can be compressed, users browsing the
    page in Spanish will have to download about 80KB for the SDG icons,
    instead of the 240KB they needed to download when using PNGs.
    
    [1] https://www.globalgoals.org/resources
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    8f2150d View commit details
    Browse the repository at this point in the history
  5. Add Indonesian SDG icons

    Based on an EPS file downloaded from The Global Goals page [1].
    
    We didn't have Indonesian SDG icons in any format.
    
    [1] https://www.globalgoals.org/resources
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    16e48e7 View commit details
    Browse the repository at this point in the history
  6. Add SDG Italian, Greek and Dutch SVG icons

    These icons have been converted from EPS pages found at their respective
    language UNRIC sites [1, 2, 3].
    
    Since SVG icons are smaller and can be compressed, users browsing the
    page in these languages will have to download way less data for the SDG
    icons than when using PNGs. Users browsing the web in Italian will have
    to download about 70KB for the SDG icons instead of the 575KB. Users
    browsing the page in Greek will have to download about 75KB for the SDG
    icons instead of 720KB. And users browsing the web in Dutch will have to
    download about 115KB for the SDG icons instead of 230KB.
    
    [1] https://unric.org/it/agenda-2030/
    [2] https://unric.org/el/17-στοχοι-βιωσιμησ-αναπτυξησ/
    [3] https://unric.org/nl/duurzame-ontwikkelingsdoelstellingen/
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    159a17f View commit details
    Browse the repository at this point in the history
  7. Increase minimum size for SDG icons

    The icons were a bit hard to click on small screens, even for people
    without any motion disabilities.
    
    We might increase the size or the space between icons again in the
    future; right now it's hard for users with certain motion disabilities
    to click on the right icon.
    
    Coincidentally, the minimum size of the icon is now barely over the 44px
    established as minimum required size by the WCAG guideline 2.5.5 (level
    AAA) [1].
    
    Also coincidentally, at a screen 320px wide (the minimum screen size we
    support), six icons appear on each row, just like in the UN logo.
    
    [1] https://www.w3.org/TR/WCAG21/#target-size
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    c42c8e3 View commit details
    Browse the repository at this point in the history
  8. Use sans-serif fonts as fallbacks for SDG titles

    This way titles look a little less broken during the time the font is
    downloaded.
    javierm committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    e20e468 View commit details
    Browse the repository at this point in the history