]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Rework] WebUI: drop Font Awesome framework 6145/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 10 Jul 2026 10:41:57 +0000 (13:41 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Wed, 22 Jul 2026 09:32:28 +0000 (12:32 +0300)
commit123b72eaf8155bd438b65b74d43113041b0baf19
tree5159f5fbd187f472f3146df10e0c48c600f6a936
parent9e7006548cb81082c86046d96189c18c5e37bb79
[Rework] WebUI: drop Font Awesome framework

Replace Font Awesome's "SVG with JS" framework with a local subset SVG
sprite. Delete fontawesome.min.js and solid.min.js (~900 KB of JS) and
svg-with-js.min.css, and drop the fontawesome/fontawesome_solid RequireJS
paths and shim.

app/icons.js renders the glyphs: an initial sweep plus a MutationObserver
replace <i class="fas fa-<name>"> with inline <svg class="svg-inline--fa">
<use href="img/icons.svg#fa-<name>"/></svg>, carrying over non-class
attributes (id) and modifier classes (fa-spin, spacing). setIcon() swaps
an icon in place; the theme toggle (rspamd.js) and the map-modal header
(config.js) move off class toggling and [data-fa-i2svg] selectors. Each
icon keeps its natural aspect ratio: rspamd.css sizes the box at 1em
square by default, and icons.css (generated) overrides the width of
non-square glyphs. rspamd.css also adds the fa-spin keyframes
svg-with-js.min.css used to provide.

The sprite (img/icons.svg, 35 glyphs) and icons.css are generated by
icons-build.mjs (repo root) from icons-manifest.txt; v5 aliases (e.g.
times -> xmark) resolve at build time. Font Awesome
(@fortawesome/fontawesome-free, pinned 6.6.0) is a devDependency; CI
(ci_eslint) runs "npm run check:icons" - icons-check.mjs verifies every
fa-<name> in the markup is listed in the manifest, then rebuilds and
fails on any diff (stale files or Font Awesome version drift).
18 files changed:
.github/workflows/ci_eslint.yml
icons-build.mjs [new file with mode: 0644]
icons-check.mjs [new file with mode: 0644]
icons-manifest.txt [new file with mode: 0644]
interface/ARCHITECTURE.md
interface/css/icons.css [new file with mode: 0644]
interface/css/rspamd.css
interface/css/svg-with-js.min.css [deleted file]
interface/img/icons.svg [new file with mode: 0644]
interface/index.html
interface/js/app/config.js
interface/js/app/icons.js [new file with mode: 0644]
interface/js/app/rspamd.js
interface/js/lib/fontawesome.min.js [deleted file]
interface/js/lib/solid.min.js [deleted file]
interface/js/main.js
package-lock.json
package.json