JSPM

postcss-short-font-size

4.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4513
  • Score
    100M100P100Q16315F
  • License CC0-1.0

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

Package Exports

  • postcss-short-font-size

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-short-font-size) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Font Size Shorthand PostCSS Logo

NPM Version Build Status Windows Build Status ![Gitter Chat][git-img]

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

/* before */

.example-1 {
  font-size: 125%/1.5;
}

/* after */

.example-1 {
  font-size: 125%;
  line-height: 1.5;
}

Options

prefix

Type: String
Default: ""

Adds an optional prefix to the font-size property (e.g. "x" for -x-font-size). Wrapping dashes (-) are automatically applied.

skip

Type: String
Default: "*"

Specifies the skip token used to ignore a length.

Usage

Add Font Size Shorthand to your build tool:

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

Node

require('postcss-short-font-size').process(YOUR_CSS, { /* options */ });

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Load Font Size Shorthand as a PostCSS plugin:

postcss([
  require('postcss-short-font-size')({ /* options */ })
]).process(YOUR_CSS, /* options */);

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Enable Font Size Shorthand within your Gulpfile:

var postcss = require('gulp-postcss');

gulp.task('css', function () {
  return gulp.src('./src/*.css').pipe(
    postcss([
      require('postcss-short-font-size')({ /* options */ })
    ])
  ).pipe(
    gulp.dest('.')
  );
});

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Enable Font Size Shorthand within your Gruntfile:

grunt.loadNpmTasks('grunt-postcss');

grunt.initConfig({
  postcss: {
    options: {
      use: [
        require('postcss-short-font-size')({ /* options */ })
      ]
    },
    dist: {
      src: '*.css'
    }
  }
});