Skip to content

Commit bc31663

Browse files
Merge pull request #23 from yunusga/range-notation-support
Media Queries Level 4 "range" support
2 parents 3f642aa + 1071b94 commit bc31663

File tree

2 files changed

+224
-54
lines changed

2 files changed

+224
-54
lines changed

lib/create-sort.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
// Private
33
// ----------------------------------------
44

5-
const minMaxWidth = /(!?\(\s*min(-device-)?-width)(.|\n)+\(\s*max(-device)?-width/i;
6-
const minWidth = /\(\s*min(-device)?-width/i;
7-
const maxMinWidth = /(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width/i;
8-
const maxWidth = /\(\s*max(-device)?-width/i;
5+
const minMaxWidth =
6+
/(!?\(\s*min(-device)?-width)(.|\n)+\(\s*max(-device)?-width|\(\s*width\s*>(=)?(.|\n)+\(\s*width\s*<(=)?|(!?\(.*<(=)?\s*width\s*<(=)?)/i;
7+
const minWidth = /\(\s*min(-device)?-width|\(\s*width\s*>(=)?/i;
8+
const maxMinWidth =
9+
/(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width|\(\s*width\s*<(=)?(.|\n)+\(\s*width\s*>(=)?|(!?\(.*>(=)?\s*width\s*>(=)?)/i;
10+
const maxWidth = /\(\s*max(-device)?-width|\(\s*width\s*<(=)?/i;
911

1012
const isMinWidth = _testQuery(minMaxWidth, maxMinWidth, minWidth);
1113
const isMaxWidth = _testQuery(maxMinWidth, minMaxWidth, maxWidth);
1214

13-
const minMaxHeight = /(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height/i;
14-
const minHeight = /\(\s*min(-device)?-height/i;
15-
const maxMinHeight = /(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height/i;
16-
const maxHeight = /\(\s*max(-device)?-height/i;
15+
const minMaxHeight =
16+
/(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height|\(\s*height\s*>(=)?(.|\n)+\(\s*height\s*<(=)?|(!?\(.*<(=)?\s*height\s*<(=)?)/i;
17+
const minHeight = /\(\s*min(-device)?-height|\(\s*height\s*>(=)?/i;
18+
const maxMinHeight =
19+
/(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height|\(\s*height\s*<(=)?(.|\n)+\(\s*height\s*>(=)?|(!?\(.*>(=)?\s*height\s*>(=)?)/i;
20+
const maxHeight = /\(\s*max(-device)?-height|\(\s*height\s*<(=)?/i;
1721

1822
const isMinHeight = _testQuery(minMaxHeight, maxMinHeight, minHeight);
1923
const isMaxHeight = _testQuery(maxMinHeight, minMaxHeight, maxHeight);

0 commit comments

Comments
 (0)