Skip to content

Commit 1f122fd

Browse files
MoOxromainmenke
authored andcommitted
Add support for multiples media in query list
Credit to @ooflorent reworkcss/rework-custom-media#5
1 parent 68cda84 commit 1f122fd

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

plugins/postcss-custom-media/CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
# 1.2.0 - 2014-10-01
2+
3+
- Add support for multiples media in query list (ref [#rework-custom-media/5](https://github.com/reworkcss/rework-custom-media/pull/5))
4+
15
# 1.1.0 - 2014-09-30
26

3-
- add support for js-defined media queries (fix [#3](https://github.com/postcss/postcss-custom-media/issues/3))
7+
- Add support for js-defined media queries (fix [#3](https://github.com/postcss/postcss-custom-media/issues/3))
48

59
# 1.0.1 - 2014-09-16
610

7-
- allow whitespace around custom media name (fix [#2](https://github.com/postcss/postcss-custom-media/issues/2))
11+
- Allow whitespace around custom media name (fix [#2](https://github.com/postcss/postcss-custom-media/issues/2))
812

913

1014
# 1.0.0 - 2014-08-12

plugins/postcss-custom-media/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Constants.
33
*/
4-
var EXTENSION_RE = /\(\s*(--[\w-]+)\s*\)/
4+
var EXTENSION_RE = /\(\s*(--[\w-]+)\s*\)/g
55

66
/**
77
* Expose the plugin.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@custom-media --a (foo: bar);
2+
@custom-media --b (bar: baz);
3+
4+
@media (--a), (--b) {
5+
selector {
6+
property: value;
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
@media (foo: bar), (bar: baz) {
4+
selector {
5+
property: value;
6+
}
7+
}

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

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ function compareFixtures(t, name, msg, opts, postcssOpts) {
2121
test("@custom-media", function(t) {
2222
compareFixtures(t, "transform", "should transform custom media")
2323

24+
compareFixtures(t, "transform-all", "should replaces all extension names")
25+
2426
compareFixtures(t, "undefined", "should remove undefined @media")
2527

2628
compareFixtures(t, "js-defined", "should transform custom media and override local extensions", {

0 commit comments

Comments
 (0)