Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.6 KB
|
Line | |
---|
1 | # PostCSS Font-Variant [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">](https://github.com/postcss/postcss/)
|
---|
2 |
|
---|
3 | [![CSS Status](https://cssdb.org/badge/font-variant-property.svg)](https://cssdb.org/#font-variant-property)
|
---|
4 | [![Build Status](https://travis-ci.org/postcss/postcss-font-variant.svg)](https://travis-ci.org/postcss/postcss-font-variant)
|
---|
5 |
|
---|
6 | PostCSS Font-Variant lets you use `font-variant` in CSS, following the
|
---|
7 | [CSS Fonts](https://www.w3.org/TR/css-fonts-3/#font-variant-prop) specification.
|
---|
8 |
|
---|
9 | ## Installation
|
---|
10 |
|
---|
11 | ```console
|
---|
12 | $ npm install postcss-font-variant
|
---|
13 | ```
|
---|
14 |
|
---|
15 | ## Usage
|
---|
16 |
|
---|
17 | ```js
|
---|
18 | // dependencies
|
---|
19 | var postcss = require("postcss")
|
---|
20 | var fontVariant = require("postcss-font-variant")
|
---|
21 |
|
---|
22 | // css to be processed
|
---|
23 | var css = fs.readFileSync("input.css", "utf8")
|
---|
24 |
|
---|
25 | // process css using postcss-font-variant
|
---|
26 | var out = postcss()
|
---|
27 | .use(fontVariant())
|
---|
28 | .process(css)
|
---|
29 | .css
|
---|
30 | ```
|
---|
31 |
|
---|
32 | Using this `input.css`:
|
---|
33 |
|
---|
34 | ```css
|
---|
35 | h2 {
|
---|
36 | font-variant-caps: small-caps;
|
---|
37 | }
|
---|
38 |
|
---|
39 | table {
|
---|
40 | font-variant-numeric: lining-nums;
|
---|
41 | }
|
---|
42 | ```
|
---|
43 |
|
---|
44 | you will get:
|
---|
45 |
|
---|
46 | ```css
|
---|
47 | h2 {
|
---|
48 | font-feature-settings: "smcp";
|
---|
49 | font-variant-caps: small-caps;
|
---|
50 | }
|
---|
51 |
|
---|
52 | table {
|
---|
53 | font-feature-settings: "lnum";
|
---|
54 | font-variant-numeric: lining-nums;
|
---|
55 | }
|
---|
56 |
|
---|
57 | ```
|
---|
58 |
|
---|
59 | Checkout [tests](test) for more examples.
|
---|
60 |
|
---|
61 | ---
|
---|
62 |
|
---|
63 | ## Contributing
|
---|
64 |
|
---|
65 | Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
|
---|
66 |
|
---|
67 | $ git clone https://github.com/postcss/postcss-font-variant.git
|
---|
68 | $ git checkout -b patch-1
|
---|
69 | $ npm install
|
---|
70 | $ npm test
|
---|
71 |
|
---|
72 | ## [Changelog](CHANGELOG.md)
|
---|
73 |
|
---|
74 | ## [License](LICENSE)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.