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

@illinois-toolkit/ilw-icon

v1.0.0

Published

A wrapper class to pull the icons from https://cdn.brand.illinois.edu/icons.html

Downloads

20

Readme

ilw-icon

Links: ilw-icon in Builder | Illinois Web Theme | Toolkit Development

Overview

This is a wrapper class to pull the icons from https://cdn.brand.illinois.edu/icons.html. It requires the icon name, and will default to solid, with the color being of the surrounding text.

Attributes include:

  • icon: the icon name. If there is no icon, it will display nothing. If there is an icon name that does not have a corresponding icon in the design list, it will throw a 404 error.
  • type: the icon type: consists of solid, line, and duo. Defaults to solid. See notes below about using duo.
  • alt: the alternate text used for the image. Defaults to the icon name plus the word 'icon', used for accessible technology.
  • size: the width and height of the icon, defaults to 48px.

There should be no child tags or text.

There is one CSS variable, --ilw-icon--color, that defaults to the current color. Use this if you need to change the color of the icon to a fixed color.

Code Examples

<ilw-icon icon="twitter" aria-hidden="true"></ilw-icon>

<ilw-icon icon="admissions" type="line" alt="Access admissions records"></ilw-icon>

Accessibility Notes and Use

If you are using an icon with text, then you can use the aria-hidden attribute on the ilw-icon, and it will propogate that value to the icon below and remove the label. If you are not using an icon with text, then the icon is conveying information and should not be hidden.

There is a possible issue with Chrome where it caches the image and then the cached version CORS does not contain the proper CORS information. See the hacksoft.io article below for details, but it requires a global fix on either our side or the CDN.

This uses a mask technique to handle the color, so the icons will not necessarily reflect the icon image itself. Be cautious of using the duo tone images, as the two colors will merge into the primary color.

If you are using the icons as navigation, consider adding the text next to the icon. What may look obvious (a diploma) may be confusing for someone outside the University. Also ensure that your target size (what the user is clicking on) is 44 by 44 CSS pixels to meet accessibility requirements.

External References

  • https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA24
  • https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentcolor_keyword
  • https://lit.dev/docs/api/templates/#nothing
  • https://www.hacksoft.io/blog/handle-images-cors-error-in-chrome
  • https://developer.mozilla.org/en-US/docs/Web/CSS/mask
  • https://en.wikipedia.org/wiki/Mystery_meat_navigation#Iconographic_navigation