-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Commits on Sep 30, 2021
-
Rename folder method in SDG icon component
The method name was a bit confusing because it returned a locale.
Configuration menu - View commit details
-
Copy full SHA for 5de9054 - Browse repository at this point
Copy the full SHA 5de9054View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 78811f5 - Browse repository at this point
Copy the full SHA 78811f5View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 3a2fb1a - Browse repository at this point
Copy the full SHA 3a2fb1aView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 8f2150d - Browse repository at this point
Copy the full SHA 8f2150dView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 16e48e7 - Browse repository at this point
Copy the full SHA 16e48e7View commit details -
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/
Configuration menu - View commit details
-
Copy full SHA for 159a17f - Browse repository at this point
Copy the full SHA 159a17fView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for c42c8e3 - Browse repository at this point
Copy the full SHA c42c8e3View commit details -
Use sans-serif fonts as fallbacks for SDG titles
This way titles look a little less broken during the time the font is downloaded.
Configuration menu - View commit details
-
Copy full SHA for e20e468 - Browse repository at this point
Copy the full SHA e20e468View commit details