Problem/Motivation

Move from inlining SVGs to CSS to use fragments. This would save around 100kb in size of CSS.
The reason why we inline SVGs is that FF did not support it until recently. It's now supported from FF 84+

Steps to reproduce

1. enable format: 'fragment', in webpack.config.js
2. build frontend: npm run build

Proposed resolution

Use fragments instead of inlining SVGs

Remaining tasks

Decide to use fragments or not

User interface changes

No icons will be displayed in FF < 84

API changes

Data model changes

CommentFileSizeAuthor
#3 build-without-fragment.png540.14 KBsqndr
#3 build-with-fragment.png541.42 KBsqndr

Issue fork gin-3205375

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

saschaeggi created an issue. See original summary.

sqndr made their first commit to this issue’s fork.

sqndr’s picture

StatusFileSize
new541.42 KB
new540.14 KB

It does save about 100kb. Attached are two screenshots of the builds.

sqndr’s picture

Status: Active » Needs review
saschaeggi’s picture

Status: Needs review » Postponed

This was initially blocked by an Firefox issue:
https://bugzilla.mozilla.org/show_bug.cgi?id=1535822
https://bugzilla.mozilla.org/show_bug.cgi?id=1486252

Looking at Firefox 78.11.0esr today, it looks like this has not landed in Firefox ESR yet. So moving this to Postponed until Firefox has released an ESR which addresses this issue.

saschaeggi’s picture

Title: [Plan] Move to SVG fragments » [Plan] Move to SVG fragments (blocked by FF esr)

Revisiting this today again in 78.14.0esr we're still not able to switch to fragments, as Firefox still hasn't pushed this fix to the ESR release.

saschaeggi’s picture

Status: Postponed » Needs review

Update: Firefox 91esr+ now supports SVG fragments!
I'd vote to move this forward ASAP – but this is a breaking change for sure – as it will break the hole site for Firefox ESR users below Version 91 (no icons will be shown at all). But on the other hand we'd save a whopping 114kb of CSS.
So I'd like to hear other voices on this.

deg’s picture

Sounds good! Browser support is wide enough that I think the file savings is worth it.

volkerk’s picture

Status: Needs review » Reviewed & tested by the community

Very nice!
I did a quick test in firefox 91.3.0esr, looks good to me.
Since firefox 78 esr is eol, I think we should move forward.

saschaeggi’s picture

Assigned: Unassigned » saschaeggi
saschaeggi’s picture

Status: Reviewed & tested by the community » Fixed
saschaeggi’s picture

Assigned: saschaeggi » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.