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

phosphor-icons

v1.4.2

Published

A clean and friendly icon family for web

Downloads

26,251

Readme

phosphor-icons

Phosphor is a flexible icon family for interfaces, diagrams, presentations — whatever, really. Explore all our icons at phosphoricons.com.

NPM JavaScript Style Guide Travis

GitHub stars GitHub forks GitHub watchers Follow on GitHub

Usage

Getting Started

We use a similar approach as many other icon sets out there, providing icons as a webfont that uses Unicode's Private Use Area character codes to map normally non-rendering characters to icons. But you don't need to know that. All you need to do is add the script to the document <head>, and drop in icons with an <i/> tag and the appropriate class:

<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/phosphor-icons"></script>
  </head>
  <body>
    <i class="ph-smiley"></i>
    <i class="ph-heart-fill" style="color: hotpink"></i>
    <i class="ph-cube-thin"></i>
  </body>
</html>

Note: For stability, you may choose to source a specific version of Phosphor by adding the version to the script URL, for example: https://unpkg.com/[email protected]. The CDN supports version ranges.

Styling

Since the icons are just text under the hood, they can be colored and styled with CSS like any other font, including font-size, color, etc. We include several helper classes to provide easy sizing if you need it:

.ph-xxs {
  font-size: 0.5em;
}
.ph-xs {
  font-size: 0.75em;
}
.ph-sm {
  font-size: 0.875em;
}
.ph-lg {
  font-size: 1.3333em;
  line-height: 0.75em;
  vertical-align: -0.0667em;
}
.ph-xl {
  font-size: 1.5em;
  line-height: 0.6666em;
  vertical-align: -0.075em;
}
.ph-1x {
  font-size: 1em;
}
.ph-2x {
  font-size: 2em;
}
.ph-3x {
  font-size: 3em;
}
.ph-4x {
  font-size: 4em;
}
.ph-5x {
  font-size: 5em;
}
.ph-6x {
  font-size: 6em;
}
.ph-7x {
  font-size: 7em;
}
.ph-8x {
  font-size: 8em;
}
.ph-9x {
  font-size: 9em;
}
.ph-10x {
  font-size: 10em;
}
.ph-fw {
  text-align: center;
  width: 1.25em;
}

Note: Overriding the font-family, font-style, font-weight, font-variant, or text-transform may break the icons and render unprintable characters. Don't do it.

Note: The duotone weight is not yet available for this implementation, as fonts do not support baked-in alpha/opacity. In future we plan to move to an SVG-based approach with full support for all icon weights.

Ligatures

The icon font now supports ligatures, meaning that in any text using font-family: "Phosphor", writing the name of an icon (without the ph- prefix) will convert to the corresponding icon. The largest possible string will be matched, meaning you can use any available weight, and print multiple icons without separating with spaces or other characters if you choose.

<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/phosphor-icons"></script>
  </head>
  <body>
    <!-- Renders as sword and shield icons -->
    <p style="font-family: Phosphor">sword-fill shield</p>
  </body>
</html>

Our Related Projects

Community Projects

If you've made a port of Phosphor and you want to see it here, just open a PR here!

License

MIT © Phosphor Icons