Detalhes do pacote

postcss-short-font-size

jonathantneal37.6kCC0-1.0depreciado5.0.0

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

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

postcss, css, postcss-plugin, color

readme (leia-me)

PostCSS Short Font Size PostCSS

NPM Version Build Status Support Chat

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

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

/* becomes */

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

Usage

Add PostCSS Short Font Size to your project:

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

Use PostCSS Short Font Size to process your CSS:

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

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

Or use it as a PostCSS plugin:

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 PostCSS CLI Webpack Create React App Gulp 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.

postcssShortFontSize({ prefix: 'x' });
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.

postcssShortFontSize({ skip: '-' });
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.

changelog (log de mudanças)

Changes to PostCSS Short Font Size

5.0.0 (October 9, 2018)

  • Updated: Supports Node 6+ (major)
  • Updated: PostCSS 7.0.5 (major)

4.0.0 (May 25, 2017)

  • Added: Support for PostCSS 6, Node 4
  • Removed: echint and jscs devDependencies
  • Updated: 2 spaces in Markdown
  • Updated: dependencies

3.0.1 (December 8, 2016)

  • Updated: Use destructing assignment on plugin options
  • Updated: Use template literals

3.0.0 (December 6, 2016)

  • Added: Define skip token
  • Updated: boilerplate conventions (Node v6.9.1 LTS)

2.0.0 (June 9, 2016)

  • Added: Support for !important on either the font size or line height.
  • Changed: Splits on a forward-slash (/) instead of a space ( ).
  • Updated: Tests

1.0.1 (September 29, 2015)

  • Updated: Value parsing
  • Updated: Plugin description

1.0.0 (September 21, 2015)

  • Added: Initial version