![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
metalsmith-icons
Advanced tools
Generate an icon font file just for the icons your site uses, using Fontello
A Metalsmith plugin for automatically building font icon sets
Font-based icon sets like Font Awesome are a great way to add icons to your UI, but rely on relatively large (often 50kb+) font files, even if you're only using a few icons across your site.
Fontello is an awesome service that allows you to manually build an icon set from. However, this is annoying to redo manually every time you add or remove icons from your site.
metalsmith-icons
finds all the icons you're using, automates your Fontello build, and automatically adds the generated font files and CSS markup to your build. The result is a tiny font file, meaning your UI loads much faster!
The plugin:
$ npm install --save metalsmith-icons
var Metalsmith = require('metalsmith');
var icons = require('metalsmith-icons')
Metalsmith(__dirname)
.source('./src')
.destination('./dest')
.use(icons({
sets: { fa:'fontawesome'},
fontello: { name: 'icons' },
fontDir: 'fonts'
}))
.build();
var defaults = {
sets : false,
fontello: {
name: 'icons',
css_prefix_text: "icon-",
css_use_suffix: false,
hinting: true,
units_per_em: 1000,
ascent: 850
},
substitutions: loadSubstitutions(),
cache: './.icon_cache',
fontDir: 'font',
CSSDir: 'styles'
};
Any options passed to metalsmith-icons
will be merged with the default configuration object.
sets
[Object / Boolean]A mapping of the CSS class you're using for your icons to the underlying font set.
Available sets:
fontawesome
(more sets coming soon, see below...)
Example:
If you're used to the default Font Awesome markup, you're using something like this to declare your icons:
<p><a href="file.pdf"><i class="fa fa-download"></i> Download</a><p>
So, you want to map the CSS class fa
to the fontawesome
font set.
sets: { fa:'fontawesome'}
fontello
[Object]Options recognised by the Fontello API. The defaults should be fine unless you want to change the name of the font files, or the CSS class that will end up in the markup.
Don't add a glyphs
key, as the plugin does this for you!
cache
[String / Boolean]A path to a folder that will be used to cache font files to save the HTTP lookup for subsequent builds that use the same set of icons. Set to false
to disable caching. Defaults to ./.icon_cache
.
fontDir
[String]Path within your build to put fonts. Defaults to font
(as per Fontello's default)
CSSDir
[String]Path within your build to put the CSS file. Defaults to styles
For some reason, some of the fonts in the Font Awesome set are . There are two options:
a) Use the
A default set of substitutions are read from substitutions.yml
. Ideally,
This is still in very early stages of development, so currently only supports the Font Awesome font set. More to come soon. Feel free to add more
This would also work great as a Gulp plugin — if someone wants to help refactor the source and make it more generic, please get in touch by submitting a pull request.
FAQs
Generate an icon font file just for the icons your site uses, using Fontello
The npm package metalsmith-icons receives a total of 3 weekly downloads. As such, metalsmith-icons popularity was classified as not popular.
We found that metalsmith-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.