The package (or in version 8+) can resolve over 1000 different icons, and will download from the 10+ font partitions, minimizing download overhead. When the Icon component renders the Upload icon, we determine if the font-face has yet been registered, an if not, we add it to the page, causing the subset containing the Upload icon to be downloaded. We define a map of icon codes which map to a font-face. What we're trying to optimize here is download size. The icon code will register the font-face definition only when a given icon from a subset is referenced. Icons can be rendered either through JSX components, or as a font character. It registers a map of icon names, which define how to render icons. Note that if you use the Fabric icons tool to create your own icon subset, you will also need to host those assets on your own CDN. You can see detailed docs for the tool at. In addition, the Fabric Icons tool is updated with new icons several times a month, whereas the default Fluent UI React set is updated only occasionally. You can also use it to create and maintain subsets of the icon font to use in your web apps, which are drop-in replacements for the default Fabric Core and Fluent UI React icon sets. The Fabric Icons tool,, lets you search and browse all of Fabric/Fluent UI's MDL2 icons. (If you're using custom icons as described under "Registering custom icons" below, you don't need to modify the CDN setting.) Creating an icon subset ![]() ![]() Note that it will require a trailing slash. Then, in initializeIcons, provide the base URL to access those fonts. A build step is recommended to automate this. If you would like the icons to be served from your own CDN, simply copy the files from (or in version 8+) to your CDN. The default endpoint is, but if you run into access/security issues from the Akamai domain, you can also pass in as the baseUrl. Also available from (7 and earlier) and (8+) import from initializeIcons ( /* optional base url */ ) Alternative CDN optionsīy default, the icon fonts for the default set of icons will be pulled from the SharePoint CDN. Build command changes made in early 2020. ![]() Using local (unpublished) version of the lib with a local React app.Server-side rendering and browserless testing.Planning and development process (for work by the core team).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |