
Short Text is a PostCSS plugin that lets you use a shorthand text
property in CSS.
/* before */ /* after */
Properties are matched into groups that may be written in any order. Once a property is matched to a group, other properties from that group must then be written before properties of another group. Asterisks indicate that an individual property in a group should be skipped. The groups include:
color
font-style
,font-variant
,font-weight
,font-stretch
text-decoration
,text-align
,text-rendering
,text-transform
white-space
font-size
,line-height
,letter-spacing
,word-spacing
Usage
Follow these steps to use Short Text.
Add Short Text to your build tool:
npm install postcss-short-text --save-dev
Node
/* options */ ;
PostCSS
Add PostCSS to your build tool:
npm install postcss --save-dev
Load Short Text as a PostCSS plugin:
;
Gulp
Add Gulp PostCSS to your build tool:
npm install gulp-postcss --save-dev
Enable Short Text within your Gulpfile:
var postcss = ; gulp;
Grunt
Add Grunt PostCSS to your build tool:
npm install grunt-postcss --save-dev
Enable Short Text within your Gruntfile:
grunt; grunt;
Options
prefix
Type: String
Default: null
Specifies a prefix to be surrounded by dashes before the declaration (e.g. -x-text
).