@csstools/postcss-font-width-property
Use the font-width property in CSS
Last updated 2 months ago by romainmenke .
MIT-0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @csstools/postcss-font-width-property 
SYNC missed versions from official npm registry.

PostCSS Font Width Property PostCSS Logo

npm install @csstools/postcss-font-width-property --save-dev

PostCSS Font Width Property lets you use the font-width property and descriptor follow the CSS Fonts Specification.

@font-face {
	src: url("foo.ttf");
	font-family: "foo";
	font-style: normal;
	font-width: 1% 1000%;
}

.foo {
	font-width: 50%;
}

/* becomes */

@font-face {
	src: url("foo.ttf");
	font-family: "foo";
	font-style: normal;
	font-stretch: 1% 1000%;
}

.foo {
	font-stretch: 50%;
}

Usage

Add PostCSS Font Width Property to your project:

npm install postcss @csstools/postcss-font-width-property --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssFontWidthProperty = require('@csstools/postcss-font-width-property');

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

Options

preserve

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

postcssFontWidthProperty({ preserve: true })
@font-face {
	src: url("foo.ttf");
	font-family: "foo";
	font-style: normal;
	font-width: 1% 1000%;
}

.foo {
	font-width: 50%;
}

/* becomes */

@font-face {
	src: url("foo.ttf");
	font-family: "foo";
	font-style: normal;
	font-stretch: 1% 1000%;
	font-width: 1% 1000%;
}

.foo {
	font-stretch: 50%;
	font-width: 50%;
}

Current Tags

  • 1.0.0                                ...           latest (2 months ago)

1 Versions

  • 1.0.0                                ...           2 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |