@csstools/postcss-text-decoration-shorthand
TypeScript icon, indicating that this package has built-in type declarations

3.0.5 • Public • Published

PostCSS Text Decoration Shorthand PostCSS Logo

npm version Build Status Discord

Baseline Status CSS Standard Status

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.

.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:

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:

Options

preserve

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

postcssTextDecorationShorthand({ preserve: false })
.example {
	text-decoration: wavy underline purple 25%;
}

/* becomes */

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

Package Sidebar

Install

npm i @csstools/postcss-text-decoration-shorthand

Weekly Downloads

3,517,956

Version

3.0.5

License

MIT-0

Unpacked Size

13.9 kB

Total Files

7

Last publish

Collaborators

  • romainmenke
  • alaguna
  • jonathantneal