[fix] simple client: jinja_svg_catalog addClassesToSVGElement

Starting with ionicons-8.0.8 the SVG already contains a class attribute and
instaed of using SVGO plugin ``addAttributesToSVGElement`` we habve to use
``addClassesToSVGElement`` to add out ``__jinja_class_placeholder__``.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2025-05-09 12:08:44 +02:00
parent 3becb066e7
commit 23d2097800

View File

@ -51,11 +51,13 @@ function jinja_svg_catalog(dest, macros, items) {
(item) => { (item) => {
/** @type {import("svgo").Config} */ /** @type {import("svgo").Config} */
// JSON.stringify & JSON.parse are used to create a deep copy of the
// item.svgo_opts object
const svgo_opts = JSON.parse(JSON.stringify(item.svgo_opts)); const svgo_opts = JSON.parse(JSON.stringify(item.svgo_opts));
svgo_opts.plugins.push({ svgo_opts.plugins.push({
name: "addAttributesToSVGElement", name: "addClassesToSVGElement",
params: { params: {
attributes: [{ "class": __jinja_class_placeholder__, }] classNames: [__jinja_class_placeholder__]
}} }}
); );