pad.css is 1.7 MB because the CSS minifier inlines every font as base64
What happens
On Etherpad 3.3.6 (Docker image, default colibris skin), static/css/pad.css?v=… is 1,733,241 bytes uncompressed and 925,792 bytes compressed. The pad page can't render until it's downloaded, and it has to be downloaded again on every upgrade (new ?v=).
Almost all of it is base64 font data:
$ curl -s https://<host>/static/css/pad.css?v=… | grep -oE 'url\(data:[a-z/+-]+' | sort | uniq -c
8 url(data:font/ttf
5 url(data:font/woff
3 url(data:font/otf
2 url(data:application/vndThese come from pad/fonts.css (Montserrat, OpenDyslexic, Roboto Mono, Quicksand, Roboto, Alegreya: the editor's font choices) and pad/icons.css (the icon font as EOT, WOFF and TTF). Every visitor downloads all of them, even though the browser uses one format of the icon font and the editor fonts are only needed when someone picks one.
Why
compressCSS in src/node/utils/MinifyWorker.ts bundles every CSS file under static/ with esbuild using dataurl loaders for .ttf, .otf, .woff, .woff2, .eot, .svg (and images), so every url() gets inlined.
The same thing happens to skins and custom CSS: a url(background.jpg) in a custom index.css turns a 7 KB stylesheet into 540 KB of render-blocking CSS. That's how we noticed.
Suggestion
Keep font (and larger image) url()s external, e.g. esbuild external for those extensions, or the file loader, so browsers fetch only the fonts they actually use, lazily, and cache them separately from the CSS. If inlining is wanted for tiny icons, a size threshold would keep that benefit without the big fonts.
Source: ether/etherpad