# btn.css

> a scalable, style-able button.

Latest version **0.4.0** (published 2020-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install btn.css
pnpm add btn.css
yarn add btn.css
bun add btn.css
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2020-01-08 |
| First published | 2014-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Michael Chan |
| Maintainers | chantastic |
| Keywords | style, css, button, btn |

## Links

- npm: https://www.npmjs.com/package/btn.css
- Repository: https://github.com/chantastic/btn.css
- Issues: https://github.com/chantastic/btn.css/issues
- npm.io page: https://npm.io/package/btn.css

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2020-01-08
- 0.3.0 — 2016-11-09
- 0.2.0 — 2016-11-04
- 0.1.0 — 2016-11-04
- 0.0.3 — 2016-10-12
- 0.0.2 — 2015-02-04
- 0.0.1 — 2014-12-11

## README

# btn.css

A scalable, style-able button.

## Installation

Script tag:

    <link rel="stylesheet" href="https://unpkg.com/btn.css@0.3.0" />

Node:

    npm install btn.css@0.3.0

## The code

This is `.btn` all the code.

    /*! btn.css */
    .btn {
      font-size: 1em;
      line-height: 2em;
      display: inline-block;
      padding: 0 1em;
      cursor: pointer;
      white-space: nowrap;
      text-decoration: none;
      border-width: 1px;
      border-style: solid;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
    }

## Usage

### Modifiers

Extend `.btn` with classes of your own.

Creating a new classes that define `color`, `background-color` and `border-color`.

    .my-fancy-outline-btn {
      color: blue;
      background-color: transparent;
      border-color: currentColor;
    }
    .my-fancy-outline-btn:hover {
      color: white;
      background-color: blue;
      border-color: blue;
    }
    .my-fancy-outline-btn:active {
      color: whitesmoke;
      background-color: darkblue;
      border-color: darkblue;
    }

### Adapters

Chances are you're buttons share a common theme.
Make an adapter for `.btn` in your app.

    /* my app's .btn */
    .btn {
      border-radius: 4px;
      box-shadow: 0 4px 3px -2px rgba(0,0,0,0.3);
    }

### Scale

Scale `.btn` by changing `font-size`.

    .my-big-btn { font-size: 2em }

You can also scale one-off buttons right on element.

    <button class="btn" style="font-size: 20em">Super Button</button>

## More examples

[chantastic.org/btn.css](https://chantastic.org/btn.css/)

<3 [@chantastic](http://twitter.com/chantastic)

---
_Source: https://npm.io/package/btn.css · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
