# postcss-input-style

> Adds new pseudo-elements to inputs for easy cross-browser styling of their inner elements

Latest version **1.0.0** (published 2017-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-input-style
pnpm add postcss-input-style
yarn add postcss-input-style
bun add postcss-input-style
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-07-26 |
| First published | 2015-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Sean King |
| Maintainers | seaneking |
| Keywords | postcss, css, postcss-plugin, inputs, shadow dom,, psuedo |

## Links

- npm: https://www.npmjs.com/package/postcss-input-style
- Repository: https://github.com/seaneking/postcss-input-style
- Issues: https://github.com/seaneking/postcss-input-style/issues
- npm.io page: https://npm.io/package/postcss-input-style

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^6.0.7

## 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

- 1.0.0 (latest) — 2017-07-26
- 0.3.0 — 2015-09-06
- 0.2.4 — 2015-08-18
- 0.2.3 — 2015-08-17
- 0.2.2 — 2015-08-17
- 0.2.1 — 2015-08-15
- 0.2.0 — 2015-08-15
- 0.1.0 — 2015-08-15

## README

# PostCSS Input Style
[![NPM version][npm-badge]][npm-url] [![Build Status][travis-badge]][travis-url] [![Dependency Status][daviddm-badge]][daviddm-url]

[PostCSS][PostCSS] plugin that adds new pseudo elements to inputs for easy cross-browser styling of their inner elements. Currently the only input supported is Range, more will be added as more vendor-specific pseudo selectors are made available.

_Part of [Rucksack - CSS Superpowers](http://simplaio.github.io/rucksack)_

**Input**

```css
input[type="range"]::track {
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::thumb {
  background: #4286be;
  width: 16px;
  height: 8px;
}
```

**Output**

```css
input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::-moz-range-track  {
  -moz-appearance: none;
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::-ms-track  {
  background: #9d9d9d;
  height: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: #4286be;
  width: 16px;
  height: 8px;
}

input[type="range"]::-moz-range-thumb {
  -moz-appearance: none;
  background: #4286be;
  width: 16px;
  height: 8px;
}

input[type="range"]::-ms-thumb {
  background: #4286be;
  width: 16px;
  height: 8px;
}

input[type="range"] {
  -webkit-appearance: none;
}

input[type=range]::-moz-focus-outer {
    border: 0;
}
```

Notes on output:

- Selectors are not grouped because if a browser finds a single selector it doesn't understand in a group, the whole group is ignored (see [Selectors Level 3][selectors])

- `-[vendor]-appearance: none;` is added so your custom styles apply. On Chrome and Safari this means you must style *both* `::track` and `::thumb`, since the appearance must be set on the root element as well

- The additional `::-moz-focus-outer` rule removes the inconsistent dotted focus outline on firefox.

## Usage

```js
postcss([ require('postcss-input-style') ])
```

See [PostCSS][PostCSS] docs for examples for your environment.

***

MIT © [Sean King](https://twitter.com/seaneking)

[npm-badge]: https://badge.fury.io/js/postcss-input-style.svg
[npm-url]: https://npmjs.org/package/postcss-input-style
[travis-badge]: https://travis-ci.org/seaneking/postcss-input-style.svg?branch=master
[travis-url]: https://travis-ci.org/seaneking/postcss-input-style
[daviddm-badge]: https://david-dm.org/seaneking/postcss-input-style.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/seaneking/postcss-input-style
[PostCSS]: https://github.com/postcss/postcss
[selectors]: http://www.w3.org/TR/selectors/#Conformance

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