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

Conversation

javierm
Copy link
Member

@javierm javierm commented Aug 26, 2021

References

Objectives

  • Reduce the time it takes users to download SDG icons when browsing the page
  • Use a vector format for SDG icons which can be scaled and will look properly at any screen resolution
  • Increase the minimum icon size so it's easier to click on an icon on small devices
  • Use a better fallback font for SDG titles when the Oswald font isn't available

@javierm javierm added UX SDG United Nations Sustainable Development Goals labels Aug 26, 2021
@javierm javierm self-assigned this Aug 26, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation Aug 26, 2021
@javierm javierm force-pushed the sdg_svg_en branch 3 times, most recently from 49d72f0 to 5f14606 Compare September 1, 2021 21:20
The method name was a bit confusing because it returned a locale.
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.
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
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
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
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/
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
This way titles look a little less broken during the time the font is
downloaded.
Consul Democracy automation moved this from Reviewing to Testing Sep 30, 2021
@javierm javierm merged commit ead5aa5 into master Sep 30, 2021
Consul Democracy automation moved this from Testing to Release 1.4.0 Sep 30, 2021
@javierm javierm deleted the sdg_svg_en branch September 30, 2021 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDG United Nations Sustainable Development Goals UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants