Skip to content

Commit d78ed06

Browse files
jonathantnealromainmenke
authored andcommitted
7.0.6
1 parent 2c1884d commit d78ed06

10 files changed

+61
-10
lines changed

plugins/postcss-custom-media/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to PostCSS Custom Media
22

3+
### 7.0.6 (October 12, 2018)
4+
5+
- Fixing: Issue combining multiple custom media
6+
37
### 7.0.5 (October 5, 2018)
48

59
- Fixed: Possible issues resolving paths to imports and exports

plugins/postcss-custom-media/lib/transform-media-list.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function transformMedia(media, customMedias) {
4848
}
4949

5050
mediaClone.nodes.splice(index, 1, ...replacementMedia.clone().nodes.map(node => {
51-
// use spacing from the current usage
51+
// use raws and spacing from the current usage
52+
node.raws = { ...media.nodes[index].raws };
5253
node.spaces = { ...media.nodes[index].spaces };
5354

5455
return node;

plugins/postcss-custom-media/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-custom-media",
3-
"version": "7.0.5",
3+
"version": "7.0.6",
44
"description": "Use Custom Media Queries in CSS",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"contributors": [
@@ -38,7 +38,7 @@
3838
"eslint-config-dev": "^2.0.0",
3939
"postcss-tape": "^2.2.0",
4040
"pre-commit": "^1.2.2",
41-
"rollup": "^0.66.4",
41+
"rollup": "^0.66.6",
4242
"rollup-plugin-babel": "^4.0.3"
4343
},
4444
"eslintConfig": {

plugins/postcss-custom-media/test/basic.css

+12-1
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,16 @@
5454
}
5555

5656
@media (--unresolved-mq) {
57-
body order: 5;
57+
body {
58+
order: 5;
59+
}
60+
}
61+
62+
@custom-media --min (min-width: 320px);
63+
@custom-media --max (max-width: 640px);
64+
65+
@media (--min) and (--max) {
66+
body {
67+
order: 6;
68+
}
5869
}

plugins/postcss-custom-media/test/basic.expect.css

+9-1
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,13 @@
4747
}
4848

4949
@media (--unresolved-mq) {
50-
body order: 5;
50+
body {
51+
order: 5;
52+
}
53+
}
54+
55+
@media (min-width: 320px) and (max-width: 640px) {
56+
body {
57+
order: 6;
58+
}
5159
}

plugins/postcss-custom-media/test/basic.preserve.expect.css

+21-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,28 @@
102102
}
103103

104104
@media (--unresolved-mq) {
105-
body order: 5;
105+
body {
106+
order: 5;
107+
}
106108
}
107109

108110
@media (--unresolved-mq) {
109-
body order: 5;
111+
body {
112+
order: 5;
113+
}
114+
}
115+
116+
@custom-media --min (min-width: 320px);
117+
@custom-media --max (max-width: 640px);
118+
119+
@media (min-width: 320px) and (max-width: 640px) {
120+
body {
121+
order: 6;
122+
}
123+
}
124+
125+
@media (--min) and (--max) {
126+
body {
127+
order: 6;
128+
}
110129
}

plugins/postcss-custom-media/test/export-media.css

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
@custom-media --not-mq-a not all and (--mq-a);
44
@custom-media --circular-mq-a (--circular-mq-b);
55
@custom-media --circular-mq-b (--circular-mq-a);
6+
@custom-media --min (min-width: 320px);
7+
@custom-media --max (max-width: 640px);

plugins/postcss-custom-media/test/export-media.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module.exports = {
44
'--mq-b': 'screen and (max-width: 30em)',
55
'--not-mq-a': 'not all and (--mq-a)',
66
'--circular-mq-a': '(--circular-mq-b)',
7-
'--circular-mq-b': '(--circular-mq-a)'
7+
'--circular-mq-b': '(--circular-mq-a)',
8+
'--min': '(min-width: 320px)',
9+
'--max': '(max-width: 640px)'
810
}
911
};

plugins/postcss-custom-media/test/export-media.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"--mq-b": "screen and (max-width: 30em)",
55
"--not-mq-a": "not all and (--mq-a)",
66
"--circular-mq-a": "(--circular-mq-b)",
7-
"--circular-mq-b": "(--circular-mq-a)"
7+
"--circular-mq-b": "(--circular-mq-a)",
8+
"--min": "(min-width: 320px)",
9+
"--max": "(max-width: 640px)"
810
}
911
}

plugins/postcss-custom-media/test/export-media.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ export const customMedia = {
33
'--mq-b': 'screen and (max-width: 30em)',
44
'--not-mq-a': 'not all and (--mq-a)',
55
'--circular-mq-a': '(--circular-mq-b)',
6-
'--circular-mq-b': '(--circular-mq-a)'
6+
'--circular-mq-b': '(--circular-mq-a)',
7+
'--min': '(min-width: 320px)',
8+
'--max': '(max-width: 640px)'
79
};

0 commit comments

Comments
 (0)