Developers: how to use or add an SVG icon to your plugin or theme Site admins adding icons to the set via the svg icon subset site setting must use the internal naming convention. Plugins, themes, group flair and badges can use the standard FontAwesome 5 naming convention. To allow bundling the three styles into one SVG sprite, icons in the regular and brand styles in Discourse are converted to far-icon-name and fab-icon-name internally. (Solid icons can simply be referenced as before “fa-icon-name”). To use an icon from the regular or brands styles, then, we need to use this new naming convention: "far fa-address-book" or "fab fa-facebook". There are three styles:įor the regular or brands styles, FA 5 introduces new class prefixes, “far” and “fab” respectively. The main change is that icons in FA come in separate styles now. For a full discussion of the changes please see the Font Awesome upgrade documentation. What’s new in Font Awesome 5įont Awesome 5 has introduced many new icons but also some naming changes. breaking change: plugin and theme developers can no longer use or override the :before pseudo selectors to reference/replace icons, these should now be replaced by using Discourse functions that inject SVGs in the pageīelow, you can find instructions on how to update plugins and themes to use icons from the new set.group flair and badge icons will automatically be included in the set, and site administrators can also use a new site setting called svg icon subset to register their chosen icons and add them to their site’s subset.plugins and themes (including theme components) can add additional FA icons to the set.the subset thankfully has a smaller size footprint: it’s already running here in Meta, and it is only 27.5 kb vs the 75.7 kb of the FA 4.7 icon font.since the Font Awesome icon set has grown to 1300+ icons in version 5, we have built an internal API that delivers to clients a subset of all FA icons, that is, only those icons used by that Discourse instance.using SVG icons will provide crisper icons, better for accessibility and easier to customize, see this Github article for more details.This is a substantial change, with lots of benefits, and one significant change for developers. We will shortly merge into master a branch that upgrades Discourse to Font Awesome 5.5.0 (the free version) and switches to using SVG icons instead of an icon font.
0 Comments
Leave a Reply. |