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

press-css

v2.1.1

Published

A flat, material, no bullshit CSS button library.

Downloads

8

Readme

Press.css

Press.css is a flat, lightweight, scalable, no bullshit button library for your projects that is heavily influenced by Google's Material Design guidelines. It's markup is simple, easy to use, predictable, and helps ensure a uniform button experience across all pages of your site or app.

Ways to Use

Link It Up

Download Press.css and add a link to the stylesheet in the head of your document.

<link rel="stylesheet" href="press.css" />

NPM

Press.css was just added to the NPM registry.

npm install press-css
yarn add press-css

The Markup

At the very minimum, press requires two classes, press and press-[color], to create a working button.

<button class="press press-red">Square Button</button>

Want more features? You can have more fun with it as well:

<button class="press press-bluegrey press-round press-ghost press-xl">Round Button</button>

You can even use anchor elements to make a link look like a Press.css button:

<a href="#" class="press press-green press-circle">21</a>

Features

Check out the Press.css to see these features in action.

Button Shapes

(default) - If you do not specify a shape, Press.css will create a squared button.

.press-round - A button with rounded corners.

.press-pill - A button that looks like a pill.

.press-circle - Perfect for glyphicons or numbers. Too much content will be hidden.

Button Sizes

.press-sm - Equivalent of font-size:.8em;

(default) - Equivalent of font-size:1em;

.press-lg - Equivalent of font-size:1.25em;

.press-xl - Equivalent of font-size:1.5em;

Button Effects

.press-raised - Adds a slight border-shadow to the button

.press-ghost - Inverts the button so background is transparent, and button border/text are the specified color.

:disabled - Press.css uses the disabled attribute on button elements.

Button Colors

Press.css borrows heavily from the design specs of Google's Material Design. All the color names in their style guide are used by default in Press.css.

Note: There is a .press-yellow and a .press-white class that defaults to color: #FFF. Overwrite this class anywhere below where you add Press.css to give the text a contrasting color.

Adding/Removing Colors

Press.css is now extendable without the need for using or compiling with Sass! In addition to the default colors, you can create your own custom classes with the press-[class] format and a special CSS custom property. (CodePen Demo)

.press-love {
	--p: pink;
        color: red;
}

As long as the button has the base .press class, you can use any CSS selector to extend Press.css and customize a button. (CodePen Demo)

.btn-main {
	--p: #6967AB;
	color: #FFF;
}

Accessibility First

I wanted to ensure that Press.css adheres as close as possible to web accessibility standards. My goal was to keep all 21 colors from version 1, but ensure color contrast guidelines are met. In order to do that, I evaluate each color as a background with white text, and if the color ratio falls below a 4.5 (AA), then the text color will be black. You can learn more about color contrast in this handy introductory guide.

Fear not! If you would like for all colors to default to white, use this handy class in your CSS to override that assumption.

.press:not(.press-ghost) {
    color: #FFF;
}

Browser Support

I have tested the library as is in modern Chrome, Safari, and Firefox.