@csstools/postcss-text-decoration-shorthand (1.0.0)

Published 2026-02-24 13:49:08 +00:00 by atheaadmin

Installation

@csstools:registry=
npm install @csstools/postcss-text-decoration-shorthand@1.0.0
"@csstools/postcss-text-decoration-shorthand": "1.0.0"

About this package

PostCSS Text Decoration Shorthand PostCSS Logo

npm version CSS Standard Status Build Status Discord

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

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

/* becomes */

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

Usage

Add PostCSS Text Decoration Shorthand to your project:

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

Use it as a PostCSS plugin:

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

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

PostCSS Text Decoration Shorthand runs in all Node environments, with special instructions for:

Node PostCSS CLI Webpack Create React App Gulp Grunt

Options

preserve

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

postcssTextDecorationShorthand({ preserve: true })
.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%;
}

Dependencies

Dependencies

ID Version
postcss-value-parser ^4.2.0

Development Dependencies

ID Version
autoprefixer ^10.4.8

Peer Dependencies

ID Version
postcss ^8.2

Keywords

css postcss-plugin shorthand text-decoration text-decoration-thickness
Details
npm
2026-02-24 13:49:08 +00:00
0
CC0-1.0
latest
6.4 KiB
Assets (1)
Versions (1) View all
1.0.0 2026-02-24