@budarin/postcss-pixelstorem 1.0.2 → 1.0.4
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 +20 -8
- package/package.json +1 -1
- package/.prettierignore +0 -3
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/package.json
CHANGED
package/.prettierignore
DELETED