# @csstools/postcss-text-decoration-shorthand

> Use text-decoration in it's shorthand form in CSS

Latest version **5.0.5** (published 2026-08-15) · MIT-0 license · 0 weekly downloads

## Install

```sh
npm install @csstools/postcss-text-decoration-shorthand
pnpm add @csstools/postcss-text-decoration-shorthand
yarn add @csstools/postcss-text-decoration-shorthand
bun add @csstools/postcss-text-decoration-shorthand
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 5.0.5 |
| Published | 2026-08-15 |
| First published | 2022-08-15 |
| Weekly downloads | 0 |
| License | MIT-0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 |
| Dependencies | 2 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1053 |
| Maintainers | jonathantneal, alaguna, romainmenke |
| Keywords | css, postcss-plugin, shorthand, text-decoration, text-decoration-thickness |

## Links

- npm: https://www.npmjs.com/package/@csstools/postcss-text-decoration-shorthand
- Repository: https://github.com/csstools/postcss-plugins
- Homepage: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand#readme
- Issues: https://github.com/csstools/postcss-plugins/issues
- Funding: https://github.com/sponsors/csstools
- npm.io page: https://npm.io/package/@csstools/postcss-text-decoration-shorthand

## Dependencies (2)

- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^4.2.0
- [@csstools/color-helpers](https://npm.io/package/@csstools/color-helpers.md) ^6.1.1

## 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.5 (latest) — 2026-08-15
- 5.0.4 — 2026-06-25
- 5.0.3 — 2026-02-21
- 5.0.2 — 2026-02-06
- 5.0.1 — 2026-01-25
- 5.0.0 — 2026-01-14
- 4.0.3 — 2025-08-22
- 4.0.2 — 2025-02-23
- 4.0.1 — 2024-08-14
- 4.0.0 — 2024-08-03
- 3.0.7 — 2024-06-29
- 3.0.6 — 2024-04-21
- 3.0.5 — 2024-03-31
- 3.0.4 — 2023-12-15
- 3.0.3 — 2023-09-18
- … 12 more at https://npm.io/package/@csstools/postcss-text-decoration-shorthand/versions

## README

# PostCSS Text Decoration Shorthand [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]

`npm install @csstools/postcss-text-decoration-shorthand --save-dev`

[PostCSS Text Decoration Shorthand] lets you use `text-decoration` as a shorthand following the [Text Decoration Specification].

```css
.example {
	text-decoration: wavy underline purple 25%;
}

/* becomes */

.example {
	text-decoration: underline;
	text-decoration: underline wavy purple;
	text-decoration-thickness: calc(0.01em * 25);
	text-decoration: wavy underline purple 25%;
}
```

## Usage

Add [PostCSS Text Decoration Shorthand] to your project:

```bash
npm install postcss @csstools/postcss-text-decoration-shorthand --save-dev
```

Use it as a [PostCSS] plugin:

```js
const postcss = require('postcss');
const postcssTextDecorationShorthand = require('@csstools/postcss-text-decoration-shorthand');

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



## Options

### preserve

The `preserve` option determines whether the original notation
is preserved. By default, it is preserved.

```js
postcssTextDecorationShorthand({ preserve: false })
```

```css
.example {
	text-decoration: wavy underline purple 25%;
}

/* becomes */

.example {
	text-decoration: underline;
	text-decoration: underline wavy purple;
	text-decoration-thickness: calc(0.01em * 25);
}
```

[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[css-url]: https://cssdb.org/#text-decoration-shorthand
[discord]: https://discord.gg/bUadyRwkJS
[npm-url]: https://www.npmjs.com/package/@csstools/postcss-text-decoration-shorthand

[PostCSS]: https://github.com/postcss/postcss
[PostCSS Text Decoration Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand
[Text Decoration Specification]: https://drafts.csswg.org/css-text-decor-4/#text-decoration-property

---
_Source: https://npm.io/package/@csstools/postcss-text-decoration-shorthand · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
