npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@db-ui/gif

v0.0.3

Published

'gif' or 'generate icon fonts' uses svgs to generate woff2 files

Downloads

135

Readme

GIF - Generate Icon Fonts

If you have custom icons and want to use them for foundations and/or in components, you need to generate a woff2 file.

Generate

For this run:

npx @db-ui/gif --src ./my-path-to/icons --fontName my-name

We search for all **/*.svg files inside the src directory and create a new icon font with the provided name. You can preview all generated icons here: ./my-path-to/icons/fonts/all/index.html.

NOTE: We use four different sizes for components (16, 20, 24, 32) to show more or less details. You can do the same by providing another file with a size suffix for example "icon_file_name_16.svg".

For more information run:

npx @db-ui/gif --help

How to use

In your app you need to include some of the generated files:

./my-path-to/icons/fonts/my-name.woff2 ./my-path-to/icons/fonts/font-face.css

NOTE: In case you put the files in a separate folder of your public directory be aware to adopt the path in your generated font-face.css file: url("/{YOUR_FOLDER}}/my-name.woff2?t=1698750286189") format("woff2");

Now you can use your icons with your font-family: my-name, e.g.:

<!--example.html-->
<i class="my-name">icon_file_name</i>

SCSS

When using scss you can also use @forward to include the generated files:

@forward "public/font-face";

data-icon

If you like to use a custom icon in one of our components you can do it by overwriting the default font-family like this:

<!--example.html-->
<p class="icon-family-my-name" data-icon="icon_file_name">Test</p>

<!-- or -->
<p data-icon-family="my-name" data-icon="icon_file_name">Test</p>

CSS

You can overwrite custom-icons for our components with CSS as well:

.db-button {
	--db-icon-font-family: "my-name";
}