@mapbox/assembly 1.3.0 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/assembly",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "A CSS framework",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -52,19 +52,19 @@
52
52
  "concat-with-sourcemaps": "^1.1.0",
53
53
  "cp-file": "^6.0.0",
54
54
  "csso": "^4.2.0",
55
- "globby": "^8.0.1",
55
+ "globby": "^10.0.0",
56
56
  "indent-string": "^3.1.0",
57
57
  "mkdirp": "^0.5.1",
58
- "optimize-js": "^1.0.2",
58
+ "optimize-js": "^1.0.3",
59
59
  "p-queue": "^2.4.2",
60
60
  "pify": "^3.0.0",
61
61
  "postcss": "^8.2.8",
62
62
  "postcss-custom-media": "^8.0.0",
63
- "postcss-custom-properties": "^7.0.0",
63
+ "postcss-custom-properties": "^12.1.8",
64
64
  "postcss-reporter": "^7.0.0",
65
65
  "strip-indent": "^2.0.0",
66
- "svgo": "^1.0.5",
67
- "svgstore": "^2.0.3",
66
+ "svgo": "^2.8.0",
67
+ "svgstore": "^3.0.1",
68
68
  "uglify-js": "^3.4.3"
69
69
  },
70
70
  "devDependencies": {
@@ -86,13 +86,13 @@
86
86
  "eslint-plugin-react": "^7.23.2",
87
87
  "execall": "^1.0.0",
88
88
  "gzip-size": "^5.0.0",
89
- "highlight.js": "^9.8.0",
89
+ "highlight.js": "^11.5.1",
90
90
  "husky": "^0.14.3",
91
91
  "jest": "^26.6.3",
92
92
  "lint-staged": "7.2.0",
93
93
  "lodash": "^4.17.21",
94
94
  "mime": "^2.3.1",
95
- "nodemon": "^1.17.5",
95
+ "nodemon": "^2.0.18",
96
96
  "npm-run-all": "^4.1.3",
97
97
  "postcss-discard-comments": "^4.0.0",
98
98
  "prettier": "1.13.7",
@@ -101,11 +101,11 @@
101
101
  "react": "^16.14.0",
102
102
  "react-dom": "^16.14.0",
103
103
  "react-helmet": "^6.1.0",
104
- "react-lowlight": "^2.0.0",
105
- "remark": "^9.0.0",
106
- "remark-react": "^4.0.3",
107
- "stylelint": "^9.3.0",
108
- "tap-spec": "^5.0.0",
104
+ "react-lowlight": "^3.0.0",
105
+ "remark": "^14.0.2",
106
+ "remark-react": "^9.0.1",
107
+ "stylelint": "^14.9.1",
108
+ "tap-spec": "^2.2.2",
109
109
  "tape": "^4.9.1",
110
110
  "xml2js": "^0.4.19"
111
111
  },
@@ -10,7 +10,7 @@ const postcss = require('postcss');
10
10
  const csso = require('csso');
11
11
  const reporter = require('postcss-reporter');
12
12
  const autoprefixer = require('autoprefixer');
13
- const initPostcssCustomProperties = require('postcss-custom-properties');
13
+ const postcssCustomProperties = require('postcss-custom-properties');
14
14
  const postcssCustomMedia = require('postcss-custom-media');
15
15
  const defaultVariables = require('../src/variables');
16
16
  const defaultMediaQueries = require('../src/media-queries');
@@ -102,11 +102,13 @@ function buildCss(options) {
102
102
  ? Object.assign({}, defaultMediaQueries, options.mediaQueries)
103
103
  : defaultMediaQueries;
104
104
 
105
- const customProperties = initPostcssCustomProperties({
105
+ const customProperties = postcssCustomProperties({
106
106
  preserve: false,
107
- warnings: true
107
+ warnings: true,
108
+ importFrom: {
109
+ customProperties: variableDefinitions
110
+ }
108
111
  });
109
- customProperties.setVariables(variableDefinitions);
110
112
 
111
113
  const postcssPlugins = [
112
114
  customProperties,
@@ -5,18 +5,19 @@ const _ = require('lodash');
5
5
  const fs = require('fs');
6
6
  const pify = require('pify');
7
7
  const path = require('path');
8
- const SVGO = require('svgo');
8
+ const { optimize } = require('svgo');
9
9
 
10
10
  const svgDir = path.join(__dirname, '../src/svgs');
11
- const svgo = new SVGO({
11
+ const options = {
12
12
  plugins: [
13
13
  {
14
- removeAttrs: {
14
+ name: 'removeAttrs',
15
+ params: {
15
16
  attrs: 'path:(fill|color|style|width|height|overflow)'
16
17
  }
17
18
  }
18
19
  ]
19
- });
20
+ };
20
21
 
21
22
  const baseJsTemplate = options => {
22
23
  return `
@@ -50,7 +51,7 @@ function processSvgFile(filename) {
50
51
 
51
52
  return pify(fs.readFile)(filename, 'utf8')
52
53
  .then(content => {
53
- return svgo.optimize(content);
54
+ return optimize(content, options);
54
55
  })
55
56
  .then(optimizedContent => {
56
57
  spriteItems.push({
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.79623 3C7.08459 3 7.35892 3.12448 7.54881 3.3415L8.70119 4.6585C8.89108 4.87552 9.16541 5 9.45377 5H15C15.5523 5 16 5.44772 16 6V14C16 14.5523 15.5523 15 15 15H3C2.44772 15 2 14.5523 2 14V4C2 3.44772 2.44772 3 3 3H6.79623ZM11 9.25V7L15 10L11 13V10.75H7.75C7.33579 10.75 7 10.4142 7 10C7 9.58579 7.33579 9.25 7.75 9.25H11Z"/>
3
+ </svg>
@@ -1,115 +1,115 @@
1
1
  {
2
- "gray-dark": "#1a2224",
3
- "gray-deep": "#4D5255",
4
- "gray": "#757D82",
5
- "gray-light": "#C7CACC",
6
- "gray-lighter": "#E4E6E7",
7
- "gray-faint": "#F7F8F8",
8
-
9
- "pink-dark": "#800C3C",
10
- "pink-deep": "#BA1258",
11
- "pink": "#FA428F",
12
- "pink-light": "#FABDD6",
13
- "pink-lighter": "#FCD4E4",
14
- "pink-faint": "#FDEEF4",
15
-
16
- "red-dark": "#741806",
17
- "red-deep": "#B6290D",
18
- "red": "#EB3814",
19
- "red-light": "#F8C4B9",
20
- "red-lighter": "#FED7CD",
21
- "red-faint": "#FDEBE7",
22
-
23
- "orange-dark": "#773503",
24
- "orange-deep": "#AE4B04",
25
- "orange": "#E46707",
26
- "orange-light": "#FCC295",
27
- "orange-lighter": "#FEDEC5",
28
- "orange-faint": "#FFF3EB",
29
-
30
- "yellow-dark": "#625204",
31
- "yellow-deep": "#8E740B",
32
- "yellow": "#F3E444",
33
- "yellow-light": "#FAF29E",
34
- "yellow-lighter": "#FBF7D0",
35
- "yellow-faint": "#FDFBE7",
36
-
37
- "green-dark": "#13582F",
38
- "green-deep": "#1F7A43",
39
- "green": "#2AA75C",
40
- "green-light": "#AAE1C0",
41
- "green-lighter": "#D3F0DE",
42
- "green-faint": "#EAFBF1",
43
-
44
- "blue-dark": "#072E64",
45
- "blue-deep": "#0B428E",
46
- "blue": "#0F71FA",
47
- "blue-light": "#91B7EE",
48
- "blue-lighter": "#C8DAF4",
49
- "blue-faint": "#E8F1FC",
50
-
51
- "purple-dark": "#512392",
52
- "purple-deep": "#6E2FC6",
53
- "purple": "#9669D5",
54
- "purple-light": "#DBCEED",
55
- "purple-lighter": "#E7E0F1",
56
- "purple-faint": "#F3F1F6",
57
-
58
- "darken5": "rgba(26, 34, 36, 0.05)",
59
- "darken10": "rgba(26, 34, 36, 0.1)",
60
- "darken25": "rgba(26, 34, 36, 0.25)",
61
- "darken50": "rgba(26, 34, 36, 0.5)",
62
- "darken75": "rgba(26, 34, 36, 0.75)",
63
-
64
- "lighten5": "rgba(255, 255, 255, 0.05)",
65
- "lighten10": "rgba(255, 255, 255, 0.1)",
66
- "lighten25": "rgba(255, 255, 255, 0.25)",
67
- "lighten50": "rgba(255, 255, 255, 0.5)",
68
- "lighten75": "rgba(255, 255, 255, 0.75)",
69
-
70
- "black": "#000",
71
- "white": "#fff",
72
- "transparent": "transparent",
73
-
74
- "disabled10": "rgba(158, 163, 167, 0.1)",
75
- "disabled25": "rgba(158, 163, 167, 0.25)",
76
- "disabled75": "rgba(158, 163, 167, 0.75)",
77
-
78
- "border-radius": "4px",
79
- "border-radius-bold": "8px",
80
- "border-radius-full": "9999px",
81
-
82
- "transition": "0.125s",
83
-
84
- "focus-shadow": "0 0 0 3px rgba(137, 199, 216, 0.65)",
85
-
86
- "font-size-h1": "36px",
87
- "font-size-h2": "30px",
88
- "font-size-h3": "24px",
89
- "font-size-h4": "20px",
90
- "font-size-h5": "16px",
91
-
92
- "line-height-h1": "45px",
93
- "line-height-h2": "36px",
94
- "line-height-h3": "30px",
95
- "line-height-h4": "25px",
96
- "line-height-h5": "20px",
97
-
98
- "font-size-xl": "30px",
99
- "font-size-l": "20px",
100
- "font-size-m": "16px",
101
- "font-size-ms": "14px",
102
- "font-size-s": "12px",
103
- "font-size-xs": "10px",
104
-
105
- "line-height-xl": "45px",
106
- "line-height-l": "30px",
107
- "line-height-m": "24px",
108
- "line-height-ms": "21px",
109
- "line-height-s": "18px",
110
- "line-height-xs": "15px",
111
-
112
- "font-stack-base": "'Open Sans', sans-serif",
113
- "font-stack-mono":
2
+ "--gray-dark": "#1a2224",
3
+ "--gray-deep": "#4D5255",
4
+ "--gray": "#757D82",
5
+ "--gray-light": "#C7CACC",
6
+ "--gray-lighter": "#E4E6E7",
7
+ "--gray-faint": "#F7F8F8",
8
+
9
+ "--pink-dark": "#800C3C",
10
+ "--pink-deep": "#BA1258",
11
+ "--pink": "#FA428F",
12
+ "--pink-light": "#FABDD6",
13
+ "--pink-lighter": "#FCD4E4",
14
+ "--pink-faint": "#FDEEF4",
15
+
16
+ "--red-dark": "#741806",
17
+ "--red-deep": "#B6290D",
18
+ "--red": "#EB3814",
19
+ "--red-light": "#F8C4B9",
20
+ "--red-lighter": "#FED7CD",
21
+ "--red-faint": "#FDEBE7",
22
+
23
+ "--orange-dark": "#773503",
24
+ "--orange-deep": "#AE4B04",
25
+ "--orange": "#E46707",
26
+ "--orange-light": "#FCC295",
27
+ "--orange-lighter": "#FEDEC5",
28
+ "--orange-faint": "#FFF3EB",
29
+
30
+ "--yellow-dark": "#625204",
31
+ "--yellow-deep": "#8E740B",
32
+ "--yellow": "#F3E444",
33
+ "--yellow-light": "#FAF29E",
34
+ "--yellow-lighter": "#FBF7D0",
35
+ "--yellow-faint": "#FDFBE7",
36
+
37
+ "--green-dark": "#13582F",
38
+ "--green-deep": "#1F7A43",
39
+ "--green": "#2AA75C",
40
+ "--green-light": "#AAE1C0",
41
+ "--green-lighter": "#D3F0DE",
42
+ "--green-faint": "#EAFBF1",
43
+
44
+ "--blue-dark": "#072E64",
45
+ "--blue-deep": "#0B428E",
46
+ "--blue": "#0F71FA",
47
+ "--blue-light": "#91B7EE",
48
+ "--blue-lighter": "#C8DAF4",
49
+ "--blue-faint": "#E8F1FC",
50
+
51
+ "--purple-dark": "#512392",
52
+ "--purple-deep": "#6E2FC6",
53
+ "--purple": "#9669D5",
54
+ "--purple-light": "#DBCEED",
55
+ "--purple-lighter": "#E7E0F1",
56
+ "--purple-faint": "#F3F1F6",
57
+
58
+ "--darken5": "rgba(26, 34, 36, 0.05)",
59
+ "--darken10": "rgba(26, 34, 36, 0.1)",
60
+ "--darken25": "rgba(26, 34, 36, 0.25)",
61
+ "--darken50": "rgba(26, 34, 36, 0.5)",
62
+ "--darken75": "rgba(26, 34, 36, 0.75)",
63
+
64
+ "--lighten5": "rgba(255, 255, 255, 0.05)",
65
+ "--lighten10": "rgba(255, 255, 255, 0.1)",
66
+ "--lighten25": "rgba(255, 255, 255, 0.25)",
67
+ "--lighten50": "rgba(255, 255, 255, 0.5)",
68
+ "--lighten75": "rgba(255, 255, 255, 0.75)",
69
+
70
+ "--black": "#000",
71
+ "--white": "#fff",
72
+ "--transparent": "transparent",
73
+
74
+ "--disabled10": "rgba(158, 163, 167, 0.1)",
75
+ "--disabled25": "rgba(158, 163, 167, 0.25)",
76
+ "--disabled75": "rgba(158, 163, 167, 0.75)",
77
+
78
+ "--border-radius": "4px",
79
+ "--border-radius-bold": "8px",
80
+ "--border-radius-full": "9999px",
81
+
82
+ "--transition": "0.125s",
83
+
84
+ "--focus-shadow": "0 0 0 3px rgba(137, 199, 216, 0.65)",
85
+
86
+ "--font-size-h1": "36px",
87
+ "--font-size-h2": "30px",
88
+ "--font-size-h3": "24px",
89
+ "--font-size-h4": "20px",
90
+ "--font-size-h5": "16px",
91
+
92
+ "--line-height-h1": "45px",
93
+ "--line-height-h2": "36px",
94
+ "--line-height-h3": "30px",
95
+ "--line-height-h4": "25px",
96
+ "--line-height-h5": "20px",
97
+
98
+ "--font-size-xl": "30px",
99
+ "--font-size-l": "20px",
100
+ "--font-size-m": "16px",
101
+ "--font-size-ms": "14px",
102
+ "--font-size-s": "12px",
103
+ "--font-size-xs": "10px",
104
+
105
+ "--line-height-xl": "45px",
106
+ "--line-height-l": "30px",
107
+ "--line-height-m": "24px",
108
+ "--line-height-ms": "21px",
109
+ "--line-height-s": "18px",
110
+ "--line-height-xs": "15px",
111
+
112
+ "--font-stack-base": "'Open Sans', sans-serif",
113
+ "--font-stack-mono":
114
114
  "'Menlo', 'Bitstream Vera Sans Mono', 'Monaco', 'Consolas', monospace"
115
115
  }