Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit fe6d852

Browse files
authoredMar 16, 2017
Merge pull request #342 from JLHwung/add-postcss-font-family-system-ui
Add postcss-font-family-system-ui
2 parents 8c72990 + cf5a472 commit fe6d852

File tree

7 files changed

+83
-0
lines changed

7 files changed

+83
-0
lines changed
 

‎docs/content/features.md

+14
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,20 @@ div {
483483
|
484484
[Plugin documentation](https://github.com/dmarchena/postcss-color-hsl)
485485

486+
## `system-ui` font-family
487+
488+
Allows you to use `system-ui` generic font-family. The current transformation provides a practical font-family list as fallback.
489+
490+
```css
491+
body {
492+
font-family: system-ui;
493+
}
494+
```
495+
496+
[Specification](https://drafts.csswg.org/css-fonts-4/#valdef-font-family-system-ui)
497+
|
498+
[Plugin documentation](https://github.com/JLHwung/postcss-font-family-system-ui)
499+
486500
## @todo
487501

488502
Any omissions of the CSS specifications (even in draft) that are subject to be

‎docs/content/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ title: cssnext - Use tomorrow’s CSS syntax, today.
151151
(functional-notation)
152152
</small>
153153
</li>
154+
<li class="r-Grid-cell r-minS--1of2">
155+
<a href="/features/#system-ui-font-family"><code>system-ui</code> font-family</a>
156+
<small class="cssnext-FeaturesList-small">
157+
(font-family fallback)
158+
</small>
159+
</li>
154160
</ul>
155161
<small
156162
class="cssnext-FeaturesList-small"

‎docs/content/playground.html

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
/* attribute case insensitive */
8686
[frame=hsides i] {
8787
border-style: solid none;
88+
}
89+
90+
/* system-ui font-family */
91+
body {
92+
font-family: system-ui;
8893
}
8994

9095
</textarea>

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"postcss-custom-media": "^5.0.0",
4242
"postcss-custom-properties": "^5.0.0",
4343
"postcss-custom-selectors": "^3.0.0",
44+
"postcss-font-family-system-ui": "^1.0.1",
4445
"postcss-font-variant": "^2.0.0",
4546
"postcss-initial": "^1.3.1",
4647
"postcss-media-minmax": "^2.1.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
selector {
2+
font-family: system-ui, sans-serif;
3+
}
4+
5+
selector {
6+
font-family: system-ui, Helvetica Neue, sans-serif;
7+
}
8+
9+
selector {
10+
font-family: sans-serif;
11+
}
12+
13+
selector {
14+
font: italic bold 12px/30px system-ui, sans-serif;
15+
}
16+
17+
selector {
18+
font: italic bold 12px/30px system-ui, Helvetica Neue, sans-serif;
19+
}
20+
21+
selector {
22+
font: italic 12px sans-serif;
23+
}
24+
25+
selector {
26+
font-weight: 700;
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
selector {
2+
font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
3+
}
4+
5+
selector {
6+
font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica Neue, sans-serif;
7+
}
8+
9+
selector {
10+
font-family: sans-serif;
11+
}
12+
13+
selector {
14+
font: italic bold 12px/30px system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
15+
}
16+
17+
selector {
18+
font: italic bold 12px/30px system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica Neue, sans-serif;
19+
}
20+
21+
selector {
22+
font: italic 12px sans-serif;
23+
}
24+
25+
selector {
26+
font-weight: 700;
27+
}

‎src/features.js

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export default {
5151
// https://npmjs.com/package/postcss-color-function
5252
colorFunction: (options) => require("postcss-color-function")(options),
5353

54+
// https://npmjs.com/package/postcss-font-family-system-ui
55+
fontFamilySystemUi: (options) => require("postcss-font-family-system-ui")(options),
56+
5457
// https://npmjs.com/package/postcss-font-variant
5558
fontVariant: (options) => require("postcss-font-variant")(options),
5659

0 commit comments

Comments
 (0)
This repository has been archived.