Allow long media rules to break (#2219)

Fixes #2198
master
Christopher Chedeau 2017-06-21 13:02:16 -07:00 committed by GitHub
parent e8fb9bddf7
commit 313519d8ae
5 changed files with 23 additions and 3 deletions

View File

@ -141,7 +141,7 @@ function genericPrint(path, options, print) {
}
parts.push(childPath.call(print));
}, "nodes");
return join(", ", parts);
return group(indent(join(concat([",", line]), parts)));
}
case "media-query": {
return join(" ", path.map(print, "nodes"));

View File

@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`overflow.css 1`] = `
@media all and (-webkit-min-device-pixel-ratio: 1.5), all and (-o-min-device-pixel-ratio: 3/2), all and (min--moz-device-pixel-ratio: 1.5), all and (min-device-pixel-ratio: 1.5) {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@media all and (-webkit-min-device-pixel-ratio: 1.5),
all and (-o-min-device-pixel-ratio: 3/2),
all and (min--moz-device-pixel-ratio: 1.5),
all and (min-device-pixel-ratio: 1.5) {
}
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, { parser: "postcss" });

View File

@ -0,0 +1,2 @@
@media all and (-webkit-min-device-pixel-ratio: 1.5), all and (-o-min-device-pixel-ratio: 3/2), all and (min--moz-device-pixel-ratio: 1.5), all and (min-device-pixel-ratio: 1.5) {
}

View File

@ -26,10 +26,14 @@ exports[`at-media.css 1`] = `
}
@media (not ( screen and ( color ) )), print and (color) {
}
@media screen and (device-aspect-ratio: 16/9), screen and (device-aspect-ratio: 16/10) {
@media screen and (device-aspect-ratio: 16/9),
screen and (device-aspect-ratio: 16/10) {
}
@media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (min-resolution: 2dppx), (min-resolution: 192dpi) {
@media (-webkit-min-device-pixel-ratio: 2),
(min--moz-device-pixel-ratio: 2),
(min-resolution: 2dppx),
(min-resolution: 192dpi) {
}
`;