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 🙏

© 2025 – Pkg Stats / Ryan Hefner

html-material-css

v0.2.4

Published

Material Design for native html components using only CSS

Readme

html-material-css

Material Design for native html components using only CSS

https://elisherer.github.io/html-material-css

Usage

Installation

npm i -S html-material-css

Import in your code

@import '~html-material-css/less/material.less';

// Possibly use the dark theme
@color-theme: dark;

Colors

Using less variables you can use any of the material design colors:

@import '~html-material-css/less/colors.less';

.some-element {
  color: @color-grey500;
}

Icons with CSS-Modules

Use some material design icons by:

import menu from 'html-material-css/less/icons/menu.less';

...

<i className={menu._} />
  • Icons are detected by <i> tags having the class attribute.

Available icons:

import add from 'html-material-css/less/icons/add.less';
import chevron_left from 'html-material-css/less/icons/chevron_left.less';
import chevron_right from 'html-material-css/less/icons/chevron_right.less';
import close from 'html-material-css/less/icons/close.less';
import create from 'html-material-css/less/icons/create.less';
import delete from 'html-material-css/less/icons/delete.less';
import info from 'html-material-css/less/icons/info.less';
import keyboard_arrow_down from 'html-material-css/less/icons/keyboard_arrow_down.less';
import keyboard_arrow_up from 'html-material-css/less/icons/keyboard_arrow_up.less';
import menu from 'html-material-css/less/icons/menu.less';
import print from 'html-material-css/less/icons/print.less';
import refresh from 'html-material-css/less/icons/refresh.less';
import share from 'html-material-css/less/icons/share.less';
import tag_faces from 'html-material-css/less/icons/tag_faces.less';
import undo from 'html-material-css/less/icons/undo.less';
import update from 'html-material-css/less/icons/update.less';

Floating label

In order to enable the floating label on an input, you need to specify when the input has content by adding the data-fixed attribute.

<label>
  <input type="text" data-fixed="true"/>
  <span>Hint text</span>
</label>

Or you can ...

Automatic value attribute setting

You can automatically set all inputs' values attributes on change by running this script on application startup. This will let you not use the data-fixed attribute to enable floating labels.

/* This is a fix for detecting when an input field has a value filled */
document.addEventListener('input', function(e) {
e.target.setAttribute('value', e.target.value);
});
document.querySelectorAll('input').forEach(function(el) {
el.setAttribute('value', el.value || '');
});

You can also use common-js (which will include the script above):

import 'html-material-css';

Errors

Errors are automatically shown when inputs are invalid (Native html5 behavior: required with an empty value, value not matching a pattern, ...)

To mark errors expilicitly on inputs, you can add the attribute data-error.