From 3e6ce9ce2bfdbabff42732647d1f6cf20a5a397f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 16 May 2023 16:45:28 +0200 Subject: [PATCH] Add a remark about the conversion of CSS based icons Closes #336 --- docs/migration/wsc55/icons.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/migration/wsc55/icons.md b/docs/migration/wsc55/icons.md index 185bd816..511d9024 100644 --- a/docs/migration/wsc55/icons.md +++ b/docs/migration/wsc55/icons.md @@ -148,6 +148,15 @@ This can be replaced using a proper button element which also provides proper ac ``` +### Replacing Icons in CSS + +Icons created through CSS properties are generally not supported. +It was often used as a convenient way to introduce a new icon with little hassle, but has way too many downsides, including but not limited to accessibility. + +Existing icons injected through CSS properties are dysfunctional and must be converted into regular icons that are injected into the DOM. +If you cannot embed them directly in the template, you should inject those using JavaScript on runtime. +It is possible to inject icons using JavaScript on page load by relying entierly on native JavaScript, because the icon component is eagerly loaded ahead of time, preventing any flicker or layout shifts. + ### Migrating Admin-Configurable Icons If admin-configurable icon names (e.g. created by [`IconFormField`](../../php/api/form_builder/form_fields.md#iconformfield)) are stored within the database, these need to be migrated with an [upgrade script](../../package/pip/script.md). -- 2.20.1