# postcss-short-font-size

> Define line-height within the font-size property in CSS

Latest version **5.0.0** (published 2018-10-09) · CC0-1.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install postcss-short-font-size
pnpm add postcss-short-font-size
yarn add postcss-short-font-size
bun add postcss-short-font-size
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2018-10-09 |
| First published | 2015-09-21 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=6.0.0 |
| Dependencies | 1 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Jonathan Neal |
| Maintainers | jonathantneal |
| Keywords | postcss, css, postcss-plugin, color, background, background-color, shorthand, short |

## Links

- npm: https://www.npmjs.com/package/postcss-short-font-size
- Repository: https://github.com/jonathantneal/postcss-short-font-size
- Homepage: https://github.com/jonathantneal/postcss-short-font-size#readme
- Issues: https://github.com/jonathantneal/postcss-short-font-size/issues
- npm.io page: https://npm.io/package/postcss-short-font-size

## Dependencies (1)

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

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

- 5.0.0 (latest) — 2018-10-09
- 4.0.0 — 2017-05-25
- 3.0.1 — 2016-12-14
- 3.0.0 — 2016-12-06
- 2.0.0 — 2016-06-09
- 1.0.1 — 2015-09-29
- 1.0.0 — 2015-09-21

## README

# PostCSS Short Font Size [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]

[![NPM Version][npm-img]][npm-url]
[![Build Status][cli-img]][cli-url]
[![Support Chat][git-img]][git-url]

[PostCSS Short Font Size] lets you define `line-height` within the `font-size`
property in CSS.

```pcss
body {
  font-size: 125%/1.5;
}

/* becomes */

body {
  line-height: 1.5;
  font-size: 125%;
}
```

## Usage

Add [PostCSS Short Font Size] to your project:

```bash
npm install postcss-short-font-size --save-dev
```

Use [PostCSS Short Font Size] to process your CSS:

```js
const postcssShortFontSize = require('postcss-short-font-size');

postcssShortFontSize.process(YOUR_CSS /*, processOptions, pluginOptions */);
```

Or use it as a [PostCSS] plugin:

```js
const postcss = require('postcss');
const postcssShortFontSize = require('postcss-short-font-size');

postcss([
  postcssShortFontSize(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```

[PostCSS Short Font Size] runs in all Node environments, with special
instructions for:

| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
| --- | --- | --- | --- | --- | --- |

## Options

#### prefix

The `prefix` option defines a prefix required by properties being transformed.
Wrapping dashes are automatically applied, so that `x` would transform
`-x-font-size`.

```js
postcssShortFontSize({ prefix: 'x' });
```

```pcss
body {
  -x-font-size: 125%/1.5;
}

/* becomes */

body {
  line-height: 1.5;
  font-size: 125%;
}
```

#### skip

The `skip` option defines the skip token used to ignore portions of the
shorthand.

```js
postcssShortFontSize({ skip: '-' });
```

```pcss
body {
  color: -/125%;
}

/* becomes */

body {
  font-size: 125%;
}
```

Note: If the skip token is made to be a space then certain values with
`!important` may not work properly, such as `font-size: 200% !important 1.5`.

[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-short-font-size.svg
[cli-url]: https://travis-ci.org/jonathantneal/postcss-short-font-size
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
[git-url]: https://gitter.im/postcss/postcss
[npm-img]: https://img.shields.io/npm/v/postcss-short-font-size.svg
[npm-url]: https://www.npmjs.com/package/postcss-short-font-size

[PostCSS]: https://github.com/postcss/postcss
[PostCSS Short Font Size]: https://github.com/jonathantneal/postcss-short-font-size

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