From f873cae5446ec40e50afa2b708aadb1aa52f7622 Mon Sep 17 00:00:00 2001 From: KoloMl Date: Sun, 30 Aug 2026 05:27:20 +0200 Subject: [PATCH] Support creating favicon items of different types I need that for brand icons. Without specified subtype, will point to regular solid icons. --- src/lib/dom-utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/dom-utils.ts b/src/lib/dom-utils.ts index bfef56b..9b2164f 100644 --- a/src/lib/dom-utils.ts +++ b/src/lib/dom-utils.ts @@ -2,10 +2,11 @@ * Reusable function to create icons from FontAwesome. Usable only for website, since extension doesn't host its own * copy of FA styles. Extension should use imports of SVGs inside CSS instead. * @param iconSlug Slug of the icon to be added. + * @param [subtype="solid"] Subtype of the icon. Some icons only exist in specific subtypes. * @return Element with classes for FontAwesome icon added. */ -export function createFontAwesomeIcon(iconSlug: string): HTMLElement { +export function createFontAwesomeIcon(iconSlug: string, subtype: string = 'solid'): HTMLElement { const iconElement = document.createElement('i'); - iconElement.classList.add('fa-solid', `fa-${iconSlug}`); + iconElement.classList.add(`fa-${subtype}`, `fa-${iconSlug}`); return iconElement; }