@budarin/postcss-pixelstorem 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -8,6 +8,7 @@ It will convert several types of CSS notation. It is designed to be versatile by
8
8
 
9
9
  In `@budarin/postcss-pixelstorem` default mode, an input of:
10
10
 
11
+ ```css
11
12
  h1 {
12
13
  font-size: rem(32);
13
14
  }
@@ -17,9 +18,11 @@ In `@budarin/postcss-pixelstorem` default mode, an input of:
17
18
  p {
18
19
  font-size: 16px;
19
20
  }
21
+ ```
20
22
 
21
23
  will result in an output of:
22
24
 
25
+ ```css
23
26
  h1 {
24
27
  font-size: 2rem;
25
28
  }
@@ -29,7 +32,7 @@ will result in an output of:
29
32
  p {
30
33
  font-size: 1em;
31
34
  }
32
-
35
+ ```
33
36
 
34
37
  ## Installation and use
35
38
 
@@ -39,11 +42,14 @@ will result in an output of:
39
42
 
40
43
  In gulpfile.js
41
44
 
45
+ ```js
42
46
  var postcss = require('gulp-postcss')
43
47
  var pixelstorem = require('@budarin/postcss-pixelstorem');
48
+ ```
44
49
 
45
50
  Gulp task:
46
51
 
52
+ ```js
47
53
  gulp.task('css', function() {
48
54
  var plugins = [
49
55
  pixelstorem()
@@ -52,7 +58,7 @@ Gulp task:
52
58
  .pipe(postcss(plugins))
53
59
  .pipe(gulp.dest(public/css));
54
60
  });
55
-
61
+ ```
56
62
 
57
63
  ## Defaults
58
64
 
@@ -60,12 +66,13 @@ Gulp task:
60
66
  * Default output for `rem(<value>)`is `rem`.
61
67
  * DEfault output for `em(<value>)` is `em`.
62
68
  * Default output unit for `<value>px` is `rem`.
63
- * Default is to convert values in media queries.
69
+ * Default is to convert values in media and container queries.
64
70
 
65
71
  ## Options
66
72
 
67
73
  `@budarin/postcss-pixelstorem` accepts optional settings that override default settings.
68
74
 
75
+ ```js
69
76
  gulp.task('css', function() {
70
77
  var plugins = [
71
78
  pixelstorem({
@@ -78,15 +85,20 @@ Gulp task:
78
85
  .pipe(postcss(plugins))
79
86
  .pipe(gulp.dest(public/css));
80
87
  });
88
+ ```
81
89
 
82
90
  Optional values:
83
- * `base: <value>` - Accepts a unitless value. Resets the base font size for conversion to rems or ems.
84
- * `unit: "rem" or "em"` - Accepts unit value of either `"rem"` or `"em"` as a string. All items will be output in the unit value set here, including values set by `rem(<value>)` or `em(<value>)` notation.
85
- * `exclude: ["declaration"]` - any declaration type to exclude from conversion, eg, `border`, `border-radius`, etc. These declarations will be excluded globally.
86
- * `mediaQueries: boolean` Setting this to `false` prevents conversion of values in media queries. Default value is `true`.
91
+ * `base: <value>` - Accepts a unitless value. Resets the base font size for conversion to rems or ems. Default value is `16`.
92
+ * `unit: "rem" or "em"` - Accepts unit value of either `"rem"` or `"em"` as a string. All items will be output in the unit value set here, including values set by `rem(<value>)` or `em(<value>)` notation. Default value is `rem`.
93
+ * `exclude: ["declaration"]` - any declaration type to exclude from conversion, eg, `border`, `border-radius`, etc. These declarations will be excluded globally. Default value is `[]`.
94
+ * `mediaQueries: boolean` Setting this to `false` prevents conversion of values in media and container queries. Default value is `true`.
95
+
87
96
 
97
+ Links:
88
98
 
99
+ <pre>
89
100
  [1]: http://bourbon.io/
90
101
  [2]: http://bourbon.io/docs/#px-to-em
91
102
  [3]: http://bourbon.io/docs/#px-to-rem
92
- [4]: http://postcss.org/
103
+ [4]: http://postcss.org/
104
+ </pre>
package/dist/index.d.ts CHANGED
@@ -5,13 +5,13 @@ interface PixelstoremOptions {
5
5
  exclude?: string[];
6
6
  mediaQueries?: boolean;
7
7
  }
8
- export declare const pixelstorem: {
9
- (opts?: PixelstoremOptions): {
10
- postcssPlugin: string;
11
- Declaration(decl: Declaration): void;
12
- AtRule(atRule: AtRule): void;
13
- };
14
- postcss: boolean;
8
+ declare function pixelstorem(opts?: PixelstoremOptions): {
9
+ postcssPlugin: string;
10
+ Declaration(decl: Declaration): void;
11
+ AtRule(atRule: AtRule): void;
15
12
  };
16
- export {};
13
+ declare namespace pixelstorem {
14
+ var postcss: boolean;
15
+ }
16
+ export default pixelstorem;
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnD,UAAU,kBAAkB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,eAAO,MAAM,WAAW;YAAU,kBAAkB;;0BAK1B,WAAW;uBAad,MAAM;;;CAwB5B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnD,UAAU,kBAAkB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,iBAAwB,WAAW,CAAC,IAAI,GAAE,kBAAuB;;sBAKvC,WAAW;mBAad,MAAM;EAwB5B;kBA1CuB,WAAW;;;eAAX,WAAW"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ const defaultOpts = {
4
4
  exclude: [],
5
5
  mediaQueries: false,
6
6
  };
7
- export const pixelstorem = (opts = {}) => {
7
+ export default function pixelstorem(opts = {}) {
8
8
  opts = { ...defaultOpts, ...opts };
9
9
  return {
10
10
  postcssPlugin: 'pixelstorem',
@@ -33,6 +33,6 @@ export const pixelstorem = (opts = {}) => {
33
33
  }
34
34
  },
35
35
  };
36
- };
36
+ }
37
37
  pixelstorem.postcss = true;
38
38
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,GAAuB;IACpC,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,KAAK;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAA2B,EAAE,EAAE,EAAE;IACzD,IAAI,GAAG,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,EAAE,CAAC;IACnC,OAAO;QACH,aAAa,EAAE,aAAa;QAE5B,WAAW,CAAC,IAAiB;YACzB,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO;YAE9C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAAE,OAAO;YACvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAC3B,kBAAkB,EAClB,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;gBACP,MAAM,SAAS,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;gBAC3C,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YACtC,CAAC,CACJ,CAAC;QACN,CAAC;QAED,MAAM,CAAC,MAAc;YACjB,IAAI,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/E,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CACjC,kBAAkB,EAClB,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;oBACP,MAAM,SA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AC;AACN,CAAC;AAED,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budarin/postcss-pixelstorem",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A plugin for PostCSS that generates rem units from pixel units.",
5
5
  "main": "/dist/index.js",
6
6
  "type": "module",