Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Treat white spaces same as Media Queries Level 4

> Whitespace must be present between a `)` character and a `not`, `and`,
> or `or` keyword, and between a `not`, `and`, or `or` keyword and a `(`
> character.

— [3 Syntax (Media Queries Level 4)][1]

[1]: http://www.w3.org/TR/2014/WD-mediaqueries-4-20140605/#mq-syntax
  • Loading branch information...
hail2u committed Mar 20, 2015
1 parent 28b79ea commit 6c0e587c860165dc5d5b09b48c4b44e2ba64760e
Showing with 3 additions and 7 deletions.
  1. +1 −2 lib/csswring.js
  2. +0 −3 lib/regexp.js
  3. +1 −1 test/expected/at-import-url.css
  4. +1 −1 test/expected/at-media-params.css
@@ -442,7 +442,7 @@ var wringAtRule = function (atRule) {

params = atRule.params;
params = params.replace(re.whiteSpaces, ' ');
params = params.replace(/([(),:])\s/g, '$1');
params = params.replace(/([(,:])\s/g, '$1');
params = params.replace(/\s([),:])/g, '$1');

if (atRule.name === 'import') {
@@ -461,7 +461,6 @@ var wringAtRule = function (atRule) {

if (atRule.name === 'supports') {
params = params.replace(re.declInParentheses, wringDeclLike);
params = params.replace(re.supportsConjunctions, ') $1');
}

atRule.params = params;
@@ -44,9 +44,6 @@ module.exports = {
// p > a, p + a, p ~ a
selectorCombinators: /\s*(\\?[>+~])\s*/g,

// )and, )or
supportsConjunctions: /\)(and|or)/g,

// u0-10ffff, u000000-10ffff
unicodeRangeDefault: /u\+0{1,6}-10ffff/i,

@@ -1 +1 @@
@import"foo.css";@import"bar.css";@import'baz.css';@import"qux.css";@import'quux.css';@import"corge.css"print,screen and (min-width:999px)
@import"foo.css";@import"bar.css";@import'baz.css';@import"qux.css";@import'quux.css';@import"corge.css" print,screen and (min-width:999px)
@@ -1 +1 @@
@media(min-width:99px)and (max-width:999px){.at-media-params{display:auto}}
@media(min-width:99px) and (max-width:999px){.at-media-params{display:auto}}

0 comments on commit 6c0e587

Please sign in to comment.
You can’t perform that action at this time.