postcss-font-family-system-ui 2.1.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ # Changes to postcss-font-family-system-ui
2
+
3
+ ## 3.0.0 (2018-01-20)
4
+
5
+ ##### Breaking Changes
6
+
7
+ * **main:** removes `Fira Sans` as Firefox OS is dead
8
+ - if you relies on the 2.x behavior, you can use the newly introduced `family` option
9
+ ```js
10
+ postcssSystemUiFont({
11
+ family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI','Roboto','Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue'
12
+ })
13
+ ```
14
+ ##### Refactors
15
+
16
+ * **package:** es6 + rollup + babel - postcss-value-parser
17
+
18
+ ##### New Features
19
+
20
+ * **main:** adds `family` option to specify polyfill font-family stack
21
+
22
+ #### 2.1.4 (2018-01-17)
23
+
24
+ ##### Chores
25
+
26
+ * **package:** update @std/esm to version 0.19.5 (0723f986)
27
+
28
+ #### 2.1.3 (2018-01-13)
29
+
30
+ ##### Chores
31
+
32
+ * **package:** update @std/esm to version 0.19.2 (dee84838)
33
+
34
+ #### 2.1.2 (2018-01-09)
35
+
36
+ ##### Chores
37
+
38
+ * **package:** update @std/esm to version 0.19.1 (#35)
39
+
40
+ ##### Refactors
41
+
42
+ * **main:** simplify value parsing (#36) (7d970e9c)
43
+
1
44
  #### 2.1.1 (2017-11-20)
2
45
 
3
46
  ##### Bug Fixes
@@ -43,7 +86,7 @@
43
86
  ##### Chores
44
87
 
45
88
  * **package:**
46
- * update nyc to lastest version (32b6c515)
89
+ * update nyc to latest version (32b6c515)
47
90
  * upgrade dependencies (5a6924da)
48
91
  * update standard to version 10.0.0 (f9e3996d)
49
92
  * update cross-env to version 4.0.0 (7c079fc9)
@@ -100,4 +143,3 @@
100
143
 
101
144
  * **readme:** add basic readme (17b4eb5b)
102
145
  * **main:** initial release (1c75288b)
103
-
package/LICENSE.md ADDED
@@ -0,0 +1,108 @@
1
+ # CC0 1.0 Universal
2
+
3
+ ## Statement of Purpose
4
+
5
+ The laws of most jurisdictions throughout the world automatically confer
6
+ exclusive Copyright and Related Rights (defined below) upon the creator and
7
+ subsequent owner(s) (each and all, an “owner”) of an original work of
8
+ authorship and/or a database (each, a “Work”).
9
+
10
+ Certain owners wish to permanently relinquish those rights to a Work for the
11
+ purpose of contributing to a commons of creative, cultural and scientific works
12
+ (“Commons”) that the public can reliably and without fear of later claims of
13
+ infringement build upon, modify, incorporate in other works, reuse and
14
+ redistribute as freely as possible in any form whatsoever and for any purposes,
15
+ including without limitation commercial purposes. These owners may contribute
16
+ to the Commons to promote the ideal of a free culture and the further
17
+ production of creative, cultural and scientific works, or to gain reputation or
18
+ greater distribution for their Work in part through the use and efforts of
19
+ others.
20
+
21
+ For these and/or other purposes and motivations, and without any expectation of
22
+ additional consideration or compensation, the person associating CC0 with a
23
+ Work (the “Affirmer”), to the extent that he or she is an owner of Copyright
24
+ and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
25
+ publicly distribute the Work under its terms, with knowledge of his or her
26
+ Copyright and Related Rights in the Work and the meaning and intended legal
27
+ effect of CC0 on those rights.
28
+
29
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
30
+ protected by copyright and related or neighboring rights (“Copyright and
31
+ Related Rights”). Copyright and Related Rights include, but are not limited
32
+ to, the following:
33
+ 1. the right to reproduce, adapt, distribute, perform, display, communicate,
34
+ and translate a Work;
35
+ 2. moral rights retained by the original author(s) and/or performer(s);
36
+ 3. publicity and privacy rights pertaining to a person’s image or likeness
37
+ depicted in a Work;
38
+ 4. rights protecting against unfair competition in regards to a Work,
39
+ subject to the limitations in paragraph 4(i), below;
40
+ 5. rights protecting the extraction, dissemination, use and reuse of data in
41
+ a Work;
42
+ 6. database rights (such as those arising under Directive 96/9/EC of the
43
+ European Parliament and of the Council of 11 March 1996 on the legal
44
+ protection of databases, and under any national implementation thereof,
45
+ including any amended or successor version of such directive); and
46
+ 7. other similar, equivalent or corresponding rights throughout the world
47
+ based on applicable law or treaty, and any national implementations
48
+ thereof.
49
+
50
+ 2. Waiver. To the greatest extent permitted by, but not in contravention of,
51
+ applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
52
+ unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright
53
+ and Related Rights and associated claims and causes of action, whether now
54
+ known or unknown (including existing as well as future claims and causes of
55
+ action), in the Work (i) in all territories worldwide, (ii) for the maximum
56
+ duration provided by applicable law or treaty (including future time
57
+ extensions), (iii) in any current or future medium and for any number of
58
+ copies, and (iv) for any purpose whatsoever, including without limitation
59
+ commercial, advertising or promotional purposes (the “Waiver”). Affirmer
60
+ makes the Waiver for the benefit of each member of the public at large and
61
+ to the detriment of Affirmer’s heirs and successors, fully intending that
62
+ such Waiver shall not be subject to revocation, rescission, cancellation,
63
+ termination, or any other legal or equitable action to disrupt the quiet
64
+ enjoyment of the Work by the public as contemplated by Affirmer’s express
65
+ Statement of Purpose.
66
+
67
+ 3. Public License Fallback. Should any part of the Waiver for any reason be
68
+ judged legally invalid or ineffective under applicable law, then the Waiver
69
+ shall be preserved to the maximum extent permitted taking into account
70
+ Affirmer’s express Statement of Purpose. In addition, to the extent the
71
+ Waiver is so judged Affirmer hereby grants to each affected person a
72
+ royalty-free, non transferable, non sublicensable, non exclusive,
73
+ irrevocable and unconditional license to exercise Affirmer’s Copyright and
74
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
75
+ maximum duration provided by applicable law or treaty (including future time
76
+ extensions), (iii) in any current or future medium and for any number of
77
+ copies, and (iv) for any purpose whatsoever, including without limitation
78
+ commercial, advertising or promotional purposes (the “License”). The License
79
+ shall be deemed effective as of the date CC0 was applied by Affirmer to the
80
+ Work. Should any part of the License for any reason be judged legally
81
+ invalid or ineffective under applicable law, such partial invalidity or
82
+ ineffectiveness shall not invalidate the remainder of the License, and in
83
+ such case Affirmer hereby affirms that he or she will not (i) exercise any
84
+ of his or her remaining Copyright and Related Rights in the Work or (ii)
85
+ assert any associated claims and causes of action with respect to the Work,
86
+ in either case contrary to Affirmer’s express Statement of Purpose.
87
+
88
+ 4. Limitations and Disclaimers.
89
+ 1. No trademark or patent rights held by Affirmer are waived, abandoned,
90
+ surrendered, licensed or otherwise affected by this document.
91
+ 2. Affirmer offers the Work as-is and makes no representations or warranties
92
+ of any kind concerning the Work, express, implied, statutory or
93
+ otherwise, including without limitation warranties of title,
94
+ merchantability, fitness for a particular purpose, non infringement, or
95
+ the absence of latent or other defects, accuracy, or the present or
96
+ absence of errors, whether or not discoverable, all to the greatest
97
+ extent permissible under applicable law.
98
+ 3. Affirmer disclaims responsibility for clearing rights of other persons
99
+ that may apply to the Work or any use thereof, including without
100
+ limitation any person’s Copyright and Related Rights in the Work.
101
+ Further, Affirmer disclaims responsibility for obtaining any necessary
102
+ consents, permissions or other rights required for any use of the Work.
103
+ 4. Affirmer understands and acknowledges that Creative Commons is not a
104
+ party to this document and has no duty or obligation with respect to this
105
+ CC0 or use of the Work.
106
+
107
+ For more information, please see
108
+ http://creativecommons.org/publicdomain/zero/1.0/.
package/README.md CHANGED
@@ -1,61 +1,146 @@
1
- # postcss-font-family-system-ui
1
+ # postcss-font-family-system-ui [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
2
2
 
3
- [![CSS Standard Status](https://jonathantneal.github.io/css-db/badge/css-fonts-system-ui-def.svg)](https://jonathantneal.github.io/css-db/#css-fonts-system-ui-def)
4
- [![npm version](https://img.shields.io/npm/v/postcss-font-family-system-ui.svg?style=flat-square)](https://www.npmjs.com/package/postcss-font-family-system-ui)
5
- [![Build Status](https://img.shields.io/travis/JLHwung/postcss-font-family-system-ui/master.svg?style=flat-square)](https://travis-ci.org/JLHwung/postcss-font-family-system-ui)
6
- [![Coverage Status](https://img.shields.io/coveralls/JLHwung/postcss-font-family-system-ui.svg?style=flat-square)](https://coveralls.io/github/JLHwung/postcss-font-family-system-ui)
7
- [![Greenkeeper badge](https://badges.greenkeeper.io/JLHwung/postcss-font-family-system-ui.svg)](https://greenkeeper.io/)
3
+ [![CSS Standard][css-img]][css-url]
4
+ [![NPM Version][npm-img]][npm-url]
5
+ [![Linux Build Status][cli-img]][cli-url]
6
+ [![Windows Build Status][win-img]][win-url]
7
+ [![Greenkeeper][gkp-img]][gkp-url]
8
+ [![Gitter Chat][git-img]][git-url]
8
9
 
9
- > [PostCSS](https://github.com/postcss/postcss) plugin to transform W3C CSS generic font-family [system-ui](https://www.w3.org/TR/css-fonts-4/#system-ui-def) to a practical font-family list
10
+ [postcss-font-family-system-ui] lets you use `system-ui` in CSS, following the
11
+ [CSS Fonts Module Level 4] specification.
12
+
13
+ ```css
14
+ body {
15
+ font: 100%/1.5 system-ui;
16
+ }
17
+
18
+ /* becomes */
19
+
20
+ body {
21
+ font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue;
22
+ }
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ Add [postcss-font-family-system-ui] to your build tool:
10
28
 
11
- ## Installation
12
29
  ```bash
13
- yarn add postcss-font-family-system-ui --dev
30
+ npm install postcss-font-family-system-ui --save-dev
14
31
  ```
15
32
 
16
- ## Version
33
+ #### Node
17
34
 
18
- | postcss | postcss-font-family-system-ui |
19
- | ------- | ----------------------------- |
20
- | 5.x | 1.x |
21
- | 6.x | 2.x |
35
+ Use [postcss-font-family-system-ui] to process your CSS:
22
36
 
23
- ## Usage
24
37
  ```js
25
- // dependencies
26
- import postcss from 'postcss'
27
- import fontFamilySystemUI from 'postcss-font-family-system-ui'
38
+ import postcssSystemUiFont from 'postcss-font-family-system-ui';
39
+
40
+ postcssSystemUiFont.process(YOUR_CSS);
41
+ ```
42
+
43
+ #### PostCSS
28
44
 
29
- // css to be processed
30
- const css = fs.readFileSync('input.css', 'utf8')
45
+ Add [PostCSS] to your build tool:
31
46
 
32
- // process css using postcss-font-family-system-ui
33
- const out = postcss()
34
- .use(fontFamilySystemUI())
35
- .process(css)
36
- .css
47
+ ```bash
48
+ npm install postcss --save-dev
37
49
  ```
38
50
 
39
- Using this `input.css`:
51
+ Use [postcss-font-family-system-ui] as a plugin:
40
52
 
41
- ```css
42
- body {
43
- font-family: system-ui;
44
- }
53
+ ```js
54
+ import postcss from 'gulp-postcss';
55
+ import postcssSystemUiFont from 'postcss-font-family-system-ui';
45
56
 
57
+ postcss([
58
+ postcssSystemUiFont(/* options */)
59
+ ]).process(YOUR_CSS);
46
60
  ```
47
61
 
48
- you will get:
62
+ #### Gulp
49
63
 
50
- ```css
51
- body {
52
- font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue;
53
- }
64
+ Add [Gulp PostCSS] to your build tool:
65
+
66
+ ```bash
67
+ npm install gulp-postcss --save-dev
68
+ ```
69
+
70
+ Use [postcss-font-family-system-ui] in your Gulpfile:
71
+
72
+ ```js
73
+ import postcss from 'gulp-postcss';
74
+ import postcssSystemUiFont from 'postcss-font-family-system-ui';
75
+
76
+ gulp.task('css', () => gulp.src('./src/*.css').pipe(
77
+ postcss([
78
+ postcssSystemUiFont(/* options */)
79
+ ])
80
+ ).pipe(
81
+ gulp.dest('.')
82
+ ));
83
+ ```
84
+
85
+ #### Grunt
86
+
87
+ Add [Grunt PostCSS] to your build tool:
88
+
89
+ ```bash
90
+ npm install grunt-postcss --save-dev
91
+ ```
92
+
93
+ Use [postcss-font-family-system-ui] in your Gruntfile:
94
+
95
+ ```js
96
+ import postcssSystemUiFont from 'postcss-font-family-system-ui';
97
+
98
+ grunt.loadNpmTasks('grunt-postcss');
99
+
100
+ grunt.initConfig({
101
+ postcss: {
102
+ options: {
103
+ use: [
104
+ postcssSystemUiFont(/* options */)
105
+ ]
106
+ },
107
+ dist: {
108
+ src: '*.css'
109
+ }
110
+ }
111
+ });
54
112
  ```
55
113
 
56
- Checkout [tests](test) for examples.
114
+ ## Options
57
115
 
58
- ## FAQ
116
+ ### family
117
+
118
+ The `family` option defines the fallback families used to polyfill `system-ui`.
119
+ It accepts an array or a comma-separated string.
120
+
121
+ ```js
122
+ import postcssSystemUiFont from 'postcss-font-family-system-ui';
123
+
124
+ postcssSystemUiFont({
125
+ family: 'system-ui, Segoe UI, Roboto, Helvetica Neue' // use less fallbacks
126
+ });
127
+ ```
59
128
 
60
- ### Can I use `require('postcss-font-family-system-ui')`?
61
- Yes
129
+ [css-url]: https://jonathantneal.github.io/css-db/#css-fonts-system-ui-def
130
+ [css-img]: https://jonathantneal.github.io/css-db/badge/css-fonts-system-ui-def.svg
131
+ [npm-url]: https://www.npmjs.com/package/postcss-font-family-system-ui
132
+ [npm-img]: https://img.shields.io/npm/v/postcss-font-family-system-ui.svg
133
+ [cli-url]: https://travis-ci.org/JLHwung/postcss-font-family-system-ui
134
+ [cli-img]: https://img.shields.io/travis/JLHwung/postcss-font-family-system-ui.svg
135
+ [win-url]: https://ci.appveyor.com/project/JLHwung/postcss-font-family-system-ui
136
+ [win-img]: https://img.shields.io/appveyor/ci/JLHwung/postcss-font-family-system-ui.svg
137
+ [gkp-url]: https://greenkeeper.io/
138
+ [gkp-img]: https://badges.greenkeeper.io/JLHwung/postcss-font-family-system-ui.svg
139
+ [git-url]: https://gitter.im/postcss/postcss
140
+ [git-img]: https://img.shields.io/badge/chat-gitter-blue.svg
141
+
142
+ [CSS Fonts Module Level 4]: https://drafts.csswg.org/css-fonts-4/#system-ui-def
143
+ [Gulp PostCSS]: https://github.com/postcss/gulp-postcss
144
+ [Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
145
+ [postcss-font-family-system-ui]: https://github.com/JLHwung/postcss-font-family-system-ui
146
+ [PostCSS]: https://github.com/postcss/postcss
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var postcss = _interopDefault(require('postcss'));
6
+
7
+ // tooling
8
+ // plugin
9
+ var index = postcss.plugin('postcss-system-ui-font', function (opts) {
10
+ var familyOpt = Object(opts).family;
11
+
12
+ var systemUiFamily = typeof familyOpt === 'string' ? familyOpt.trim().split(/\s*,\s*/) : familyOpt || ['system-ui', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Droid Sans', 'Helvetica Neue'];
13
+
14
+ // system-ui and fallbacks match
15
+ var whitespace = '[\\f\\n\\r\\x09\\x20]';
16
+ var systemUiMatch = new RegExp(`(^|,|${whitespace}+)(?:system-ui${whitespace}*)(?:,${whitespace}*(?:${systemUiFamily.join('|')})${whitespace}*)?(,|$)`, 'i');
17
+
18
+ // system-ui fallback replacement
19
+ var systemUiReplace = `$1${systemUiFamily.join(', ')}$2`;
20
+
21
+ return function (root) {
22
+ // update font declarations to polyfill system-ui usage
23
+ root.walkDecls(fontPropertyMatch, function (decl) {
24
+ decl.value = decl.value.replace(systemUiMatch, systemUiReplace);
25
+ });
26
+ };
27
+ });
28
+
29
+ // font and font family property match
30
+ var fontPropertyMatch = /^font(-family)?$/i;
31
+
32
+ module.exports = index;
package/index.js ADDED
@@ -0,0 +1,39 @@
1
+ // tooling
2
+ import postcss from 'postcss';
3
+
4
+ // plugin
5
+ export default postcss.plugin('postcss-system-ui-font', opts => {
6
+ const familyOpt = Object(opts).family;
7
+
8
+ const systemUiFamily = typeof familyOpt === 'string'
9
+ ? familyOpt.trim().split(/\s*,\s*/)
10
+ : familyOpt || [
11
+ 'system-ui',
12
+ '-apple-system',
13
+ 'BlinkMacSystemFont',
14
+ 'Segoe UI',
15
+ 'Roboto',
16
+ 'Oxygen',
17
+ 'Ubuntu',
18
+ 'Cantarell',
19
+ 'Droid Sans',
20
+ 'Helvetica Neue'
21
+ ];
22
+
23
+ // system-ui and fallbacks match
24
+ const whitespace = '[\\f\\n\\r\\x09\\x20]';
25
+ const systemUiMatch = new RegExp(`(^|,|${whitespace}+)(?:system-ui${whitespace}*)(?:,${whitespace}*(?:${systemUiFamily.join('|')})${whitespace}*)?(,|$)`, 'i');
26
+
27
+ // system-ui fallback replacement
28
+ const systemUiReplace = `$1${systemUiFamily.join(', ')}$2`;
29
+
30
+ return root => {
31
+ // update font declarations to polyfill system-ui usage
32
+ root.walkDecls(fontPropertyMatch, decl => {
33
+ decl.value = decl.value.replace(systemUiMatch, systemUiReplace);
34
+ });
35
+ };
36
+ });
37
+
38
+ // font and font family property match
39
+ const fontPropertyMatch = /^font(-family)?$/i;
package/package.json CHANGED
@@ -1,47 +1,98 @@
1
1
  {
2
2
  "name": "postcss-font-family-system-ui",
3
- "version": "2.1.1",
4
- "description": "PostCSS plugin to transform W3C CSS font-family: system-ui to a practical font-family list",
5
- "keywords": [
6
- "css",
7
- "postcss",
8
- "postcss-plugin",
9
- "font-family",
10
- "system-ui"
11
- ],
12
- "main": "src/index.js",
13
- "module": "src/main.mjs",
14
- "jsnext:main": "src/main.mjs",
15
- "repository": "https://github.com/JLHwung/postcss-font-family-system-ui.git",
3
+ "version": "3.0.0",
4
+ "description": "Use the system-ui font family in CSS",
16
5
  "author": "Junliang Huang <i@jhuang.me>",
17
- "license": "MIT",
6
+ "contributors": [
7
+ "Junliang Huang <i@jhuang.me>",
8
+ "Jonathan Neal <jonathantneal@hotmail.com>"
9
+ ],
10
+ "license": "CC0-1.0",
11
+ "repository": "JLHwung/postcss-font-family-system-ui",
12
+ "homepage": "https://github.com/JLHwung/postcss-font-family-system-ui#readme",
13
+ "bugs": "https://github.com/JLHwung/postcss-font-family-system-ui/issues",
14
+ "main": "index.bundle.js",
15
+ "module": "index.js",
16
+ "files": [
17
+ "index.js",
18
+ "index.bundle.js"
19
+ ],
18
20
  "scripts": {
19
- "lint": "standard",
20
- "test": "cross-env NODE_ENV=test jest && npm run spellcheck",
21
- "coverage": "nyc report",
22
- "spellcheck": "yaspeller-ci .",
23
- "prepublishOnly": "npm run lint && npm run test"
21
+ "prepublishOnly": "npm test",
22
+ "pretest": "rollup -c .rollup.js --silent",
23
+ "test": "echo 'Running tests...'; npm run test:ec && npm run test:spelling && npm run test:js && npm run test:tape",
24
+ "test:ec": "echint --ignore index.bundle.js test",
25
+ "test:js": "eslint *.js --cache --ignore-path .gitignore --quiet",
26
+ "test:spelling": "yaspeller-ci -c package.json --lang en --ignore-uppercase --ignore-roman-numerals --ignore-urls *.md",
27
+ "test:tape": "postcss-tape"
28
+ },
29
+ "engines": {
30
+ "node": ">=4.0.0"
24
31
  },
25
32
  "dependencies": {
26
- "@std/esm": "^0.16.0",
27
- "lodash": "^4.17.4",
28
- "postcss": "^6.0.1",
29
- "postcss-value-parser": "^3.3.0"
33
+ "postcss": "^6.0"
30
34
  },
31
35
  "devDependencies": {
32
- "babel-preset-env": "^1.5.1",
33
- "cross-env": "^5.0.0",
34
- "jest": "^21.2.1",
35
- "pre-commit": "^1.2.2",
36
- "standard": "^10.0.0",
36
+ "babel-core": "^6.26",
37
+ "babel-eslint": "^8.2",
38
+ "babel-preset-env": "^1.6",
39
+ "echint": "^4.0",
40
+ "eslint": "^4.15",
41
+ "eslint-config-dev": "2.0",
42
+ "postcss-tape": "2.2",
43
+ "pre-commit": "^1.2",
44
+ "rollup": "^0.54",
45
+ "rollup-plugin-babel": "^3.0",
37
46
  "yaspeller-ci": "^1.0.0"
38
47
  },
39
- "pre-commit": "lint",
40
- "@std/esm": {
41
- "esm": "all",
42
- "cjs": true
48
+ "eslintConfig": {
49
+ "extends": "dev",
50
+ "parser": "babel-eslint"
43
51
  },
44
- "jest": {
45
- "collectCoverage": true
46
- }
52
+ "keywords": [
53
+ "postcss",
54
+ "css",
55
+ "postcss-plugin",
56
+ "ua",
57
+ "user",
58
+ "agent",
59
+ "platform",
60
+ "system",
61
+ "ui",
62
+ "default",
63
+ "font",
64
+ "font-family",
65
+ "family",
66
+ "face",
67
+ "type",
68
+ "typeface"
69
+ ],
70
+ "dictionary": [
71
+ "Affirmer",
72
+ "babili",
73
+ "babelrc",
74
+ "devDependencies",
75
+ "env",
76
+ "es6",
77
+ "esm",
78
+ "Gulpfile",
79
+ "greenkeeper",
80
+ "Gruntfile",
81
+ "istanbul",
82
+ "js",
83
+ "lockfile",
84
+ "npm",
85
+ "nyc",
86
+ "postcss",
87
+ "PostCSS",
88
+ "polyfill",
89
+ "Refactors",
90
+ "rollup",
91
+ "std",
92
+ "sublicensable",
93
+ "travis",
94
+ "ui",
95
+ "yaspeller",
96
+ "^[A-f0-9]{8}$"
97
+ ]
47
98
  }
@@ -1,44 +0,0 @@
1
- let postcss;_107‍.w('postcss',[["default",function(v){postcss=v}]]);let valueParser;_107‍.w('postcss-value-parser',[["default",function(v){valueParser=v}]]);let flatMap;_107‍.w('lodash',[["flatMap",function(v){flatMap=v}]]);
2
-
3
-
4
-
5
- const fontFamilySystemUIList = [
6
- 'system-ui',
7
- '-apple-system',
8
- 'BlinkMacSystemFont',
9
- 'Segoe UI',
10
- 'Roboto',
11
- 'Oxygen',
12
- 'Ubuntu',
13
- 'Cantarell',
14
- 'Fira Sans',
15
- 'Droid Sans',
16
- 'Helvetica Neue'
17
- ]
18
-
19
- const parsedFontFamilySystemUIListTree = valueParser(fontFamilySystemUIList.join(', '))
20
-
21
- const transformFontFamilySystemUI = (nodes) => {
22
- return flatMap(nodes, node => {
23
- if (node.type === 'word' && node.value === 'system-ui') {
24
- return parsedFontFamilySystemUIListTree
25
- }
26
- return node
27
- })
28
- }
29
-
30
- const transform = () => (decl) => {
31
- if (decl.type === 'decl') {
32
- if (decl.prop === 'font-family' || decl.prop === 'font') {
33
- const tree = valueParser(decl.value)
34
- tree.nodes = transformFontFamilySystemUI(tree.nodes)
35
- decl.value = tree.toString()
36
- }
37
- }
38
- }
39
-
40
- _107‍.d(postcss.plugin('postcss-font-family-system-ui', () => {
41
- return (root) => {
42
- root.walk(transform())
43
- }
44
- }));
package/.npmignore DELETED
@@ -1,57 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
-
6
- # Runtime data
7
- pids
8
- *.pid
9
- *.seed
10
-
11
- # Directory for instrumented libs generated by jscoverage/JSCover
12
- lib-cov
13
-
14
- # Coverage directory used by tools like istanbul
15
- coverage
16
-
17
- # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18
- .grunt
19
-
20
- # node-waf configuration
21
- .lock-wscript
22
-
23
- # Compiled binary addons (http://nodejs.org/api/addons.html)
24
- build/Release
25
-
26
- # Dependency directories
27
- node_modules
28
- jspm_packages
29
-
30
- # Optional npm cache directory
31
- .npm
32
-
33
- # Optional REPL history
34
- .node_repl_history
35
-
36
- # IntelliJ IDEA
37
- .idea
38
-
39
- /test/
40
-
41
- # appveyor config
42
- /appveyor.yml
43
-
44
- # yarn lockfile
45
- yarn.lock
46
-
47
- # yaspeller dictionary
48
- .yaspellerrc
49
-
50
- # babel config
51
- .babelrc
52
-
53
- # travis config
54
- .travis.yml
55
-
56
- # editor config
57
- .editorconfig
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 Junliang Huang
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/src/index.js DELETED
@@ -1,3 +0,0 @@
1
- //eslint-disable-next-line
2
- require = require('@std/esm')(module)
3
- module.exports = require('./main.mjs').default
package/src/main.mjs DELETED
@@ -1,44 +0,0 @@
1
- import postcss from 'postcss'
2
- import valueParser from 'postcss-value-parser'
3
- import { flatMap } from 'lodash'
4
-
5
- const fontFamilySystemUIList = [
6
- 'system-ui',
7
- '-apple-system',
8
- 'BlinkMacSystemFont',
9
- 'Segoe UI',
10
- 'Roboto',
11
- 'Oxygen',
12
- 'Ubuntu',
13
- 'Cantarell',
14
- 'Fira Sans',
15
- 'Droid Sans',
16
- 'Helvetica Neue'
17
- ]
18
-
19
- const parsedFontFamilySystemUIListTree = valueParser(fontFamilySystemUIList.join(', '))
20
-
21
- const transformFontFamilySystemUI = (nodes) => {
22
- return flatMap(nodes, node => {
23
- if (node.type === 'word' && node.value === 'system-ui') {
24
- return parsedFontFamilySystemUIListTree
25
- }
26
- return node
27
- })
28
- }
29
-
30
- const transform = () => (decl) => {
31
- if (decl.type === 'decl') {
32
- if (decl.prop === 'font-family' || decl.prop === 'font') {
33
- const tree = valueParser(decl.value)
34
- tree.nodes = transformFontFamilySystemUI(tree.nodes)
35
- decl.value = tree.toString()
36
- }
37
- }
38
- }
39
-
40
- export default postcss.plugin('postcss-font-family-system-ui', () => {
41
- return (root) => {
42
- root.walk(transform())
43
- }
44
- })