Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan503 committed Jan 8, 2018
2 parents a7c105d + 99eab71 commit 11f956c
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 61 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ The use case in this example is that you always want the print styles to be base

### The `not` media type

`'not'` is an interesting media type. It was introduced in v2.1.0 as a short-hand for `not screen` in mq-scss (`@media not (max-width: 600px){}` is actually invalid css).
`'not'` is an interesting media type. It was introduced in v2.1.0 as a short-hand for `not screen` (then updated in v2.1.3 to output `not all`).

`'not'` will essentially invert the media query. You could use this for helping you write counter queries however I would caution against this. In general, using `'not'` is fine. However, if you try and nest another media query inside of it, or you nest the `'not'` statement inside a different media query, Sass can output some very odd and unexpected results. This is the reason version 1.0.0 of mq-scss couldn't support nested `outside` statements. It was essentially using `not inside` to produce the media query.

Expand All @@ -1002,7 +1002,7 @@ In order to use a `min-ratio` that works in the same sort of way that `min-heigh

````css
/* output css for both */
@media not screen and (max-aspect-ratio: 2 / 1) {
@media not all and (max-aspect-ratio: 2 / 1) {
body { color: #000; }
}
````
Expand Down Expand Up @@ -1147,6 +1147,10 @@ It also comes with a batch of 46 unit tests that are used to ensure that all of

This change log only covers major changes to the mixin. Due to how npm works, things like edits to the readme file require releasing whole new versions of the module to publish the edits. Those sorts of releases are not listed here.

### v2.1.3

- `'not'` is now short hand for `not all` instead of `not screen`. This is more what I was trying to go with originally but I wasn't sure what the proper syntax was.

### v2.1.2

- Added automated unit-tests.
Expand Down
2 changes: 1 addition & 1 deletion _mq.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $mq-debug: false !default;

@function mediaType($mediaType: false, $hasAnd: true){
$media: '';
$mediaType: if($mediaType == 'not', 'not screen', $mediaType);
$mediaType: if($mediaType == 'not', 'not all', $mediaType);
@if ($mediaType){
$media: if($hasAnd, $mediaType + ' and ', $mediaType);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/scripts/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/scripts/main.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions docs/assets/styles/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/styles/main.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/assets/styles/test-styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/assets/styles/test-styles.css.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="favicon.ico" rel="shortcut icon">
<link rel="stylesheet" href="assets/styles/main.css">
<link rel="stylesheet" href="assets/styles/test-styles.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
Expand All @@ -27,7 +28,7 @@
<div class="pageContainer__width">
<header class="header">
<h1>mq-scss testing/demo environment</h1>
<p class="version">v2.1.0</p>
<p class="version">v2.1.3</p>
<pre class="no-lines"><code style="text-align: center">npm install mq-scss --save</code></pre>
</header>
<div class="bodyContent"><p>This is a testing/demo site for mq-scss. Full documentation can be found on <a href="https://github.com/Dan503/mq-scss">GitHub</a> and <a href="https://www.npmjs.com/package/mq-scss">npm</a>.</p>
Expand Down
28 changes: 0 additions & 28 deletions gulp/tasks/modernizr.js

This file was deleted.

1 change: 0 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ gulp.task('compile', gulp.series(
'imagemin',
'sass',
'compile-tests',
'modernizr',
'browserify',
)
));
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mq-scss",
"version": "2.1.2",
"version": "2.1.3",
"description": "An extremely powerful but easy to use Sass media query mixin that allows you to create almost any media query you can imagine.",
"main": "_mq.scss",
"repository": {
Expand Down Expand Up @@ -54,7 +54,6 @@
"gulp-imagemin": "^4.0.0",
"gulp-jade": "^1.1.0",
"gulp-load-plugins": "^1.5.0",
"gulp-modernizr": "0.0.0",
"gulp-newer": "^1.3.0",
"gulp-notify": "^3.0.0",
"gulp-plumber": "^1.1.0",
Expand Down
4 changes: 0 additions & 4 deletions src/_modules/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@
display: none;
}
}

.no-flexbox & {
width: 780px;
}
}
2 changes: 2 additions & 0 deletions src/_scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import codeLineNumbers from '~on-page-load-js/codeLineNumbers';
import smoothAnchors from '~on-page-load-js/smoothAnchors';

$(() => {
$('html').removeClass('no-js').addClass('js');
codeLineNumbers();
smoothAnchors();
$('html').addClass('-jsLoaded');
});
8 changes: 0 additions & 8 deletions src/_styles/04-base-styles/elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ a {
cursor: default;
pointer-events: none;
opacity: 0.2;

.no-csspointerevents & {
display: none;
}
}
}

Expand Down Expand Up @@ -199,10 +195,6 @@ pre {
padding: 10px 5px;
font-size: 1em;
}

.no-flexbox & {
max-width: 780px;
}
}

code {
Expand Down
2 changes: 1 addition & 1 deletion unit-tests/media/notMedia/notMedia.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@media not screen and (min-width: 801px){.unitTest{color:#000}}
@media not all and (min-width: 801px){.unitTest{color:#000}}
2 changes: 1 addition & 1 deletion unit-tests/media/notMedia/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import unitTest from '../../../gulp/helpers/unitTest';

unitTest('notMedia', __dirname, '@media not screen and (min-width: 801px){.unitTest{color:#000}}')
unitTest('notMedia', __dirname, '@media not all and (min-width: 801px){.unitTest{color:#000}}')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@media not screen and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}
@media not all and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}
2 changes: 1 addition & 1 deletion unit-tests/ratio/exactRatioWorkAround1/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import unitTest from '../../../gulp/helpers/unitTest';

unitTest('exactRatioWorkAround1', __dirname, '@media not screen and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}')
unitTest('exactRatioWorkAround1', __dirname, '@media not all and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@media not screen and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}
@media not all and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}
2 changes: 1 addition & 1 deletion unit-tests/ratio/exactRatioWorkAround2/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import unitTest from '../../../gulp/helpers/unitTest';

unitTest('exactRatioWorkAround2', __dirname, '@media not screen and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}')
unitTest('exactRatioWorkAround2', __dirname, '@media not all and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@media not screen and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}
@media not all and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}
2 changes: 1 addition & 1 deletion unit-tests/ratio/exactRatioWorkAround3/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import unitTest from '../../../gulp/helpers/unitTest';

unitTest('exactRatioWorkAround3', __dirname, '@media not screen and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}')
unitTest('exactRatioWorkAround3', __dirname, '@media not all and (max-aspect-ratio: 2 / 1){.unitTest{color:#000}}')

0 comments on commit 11f956c

Please sign in to comment.