sass-mq 6.0.0 → 7.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
  <!-- ## Unreleased -->
9
9
 
10
+ ## v7.0.0 - 2024-10-24
11
+
12
+ This is a major version bump that contains no breaking changes but may require a newer version of Sass. It ensures compatibility with the latest version of dart-sass and removes support for `@import`, as [`@import` is officially deprecated as of sass-dart 1.80.0](https://sass-lang.com/blog/import-is-deprecated/).
13
+
14
+ ### Added
15
+
16
+ - Support for dart-sass >= 1.80.0 (without deprecation warnings)
17
+
18
+ ### Changed
19
+
20
+ - BREAKING CHANGE: Dropped support for `@import` (use [sass-mq v6.0.0](https://github.com/sass-mq/sass-mq/tree/v6.0.0) if you need backward compatibility with `@import`)
21
+ - Updated all global Sass functions to use their module equivalents (for example: `type-of` ➡️ `meta.type-of`, `slice` ➡️ `string.slice`), silencing deprecation warnings introduced in dart-sass 1.80.0
22
+
23
+ ### Chores
24
+
25
+ - Upgraded Jest and Sass True dependencies to unlock testing with the latest versions of `sass-dart`
26
+ - Fixed a test where a space was missing between `and` and `(` in the generated CSS (caused by the latest version of Sass)
27
+
10
28
  ## v6.0.0 - 2022-01-10
11
29
 
12
30
  This is a major version bump that contains breaking changes. It adds support for the [new Sass module system](https://sass-lang.com/blog/the-module-system-is-launched), drops support for Eyeglass, and drops support for deprecated versions of Sass. No new features were added.
@@ -38,8 +56,6 @@ See the updated [README](https://github.com/sass-mq/sass-mq/blob/main/README.md)
38
56
  - Removed usage of `unit()` in favor of [`math.compatible()`](https://sass-lang.com/documentation/modules/math#compatible), as the `unit()` function is intended for debugging, and its output format is not guaranteed to be consistent across Sass versions or implementations.
39
57
  - Updated all other global Sass functions to use their module equivalents (for example: `map-merge` ➡️ `map.merge`, `append` ➡️ `list.append`)
40
58
 
41
- ### Fixed
42
-
43
59
  ## Changes prior to v6.0.0
44
60
 
45
61
  Changes prior to v6.0.0 were logged in https://github.com/sass-mq/sass-mq/releases
package/README.md CHANGED
@@ -316,10 +316,9 @@ Please see the `examples` folder which contains a variety of examples on how to
316
316
 
317
317
  ### Backward compatibility with `@import`
318
318
 
319
- Just in case you need to have backward compatibility and want to use`@import` instead of `@use`,
320
- you can do so by importing `_mq.import.scss` instead of `_mq.scss`.
319
+ As of sass-dart 1.80.0, `@import` is officially deprecated, and sass-mq v7.0.0 removes support for it.
321
320
 
322
- Please see `legacy.scss` on `examples` folder.
321
+ [sass-mq v6.0.0](https://github.com/sass-mq/sass-mq/tree/v6.0.0) is the last version that supports `@import`.
323
322
 
324
323
  ## Running tests
325
324
 
package/_mq.scss CHANGED
@@ -1,3 +1,5 @@
1
+ @use "sass:meta";
2
+ @use "sass:string";
1
3
  @use 'sass:math';
2
4
  @use 'sass:map';
3
5
  @use 'sass:list';
@@ -142,7 +144,7 @@ $media-type: all !default;
142
144
 
143
145
  // From: this breakpoint (inclusive)
144
146
  @if $from {
145
- @if type-of($from) == number {
147
+ @if meta.type-of($from) == number {
146
148
  $min-width: px2em($from);
147
149
  } @else {
148
150
  $min-width: px2em(get-breakpoint-width($from, $breakpoints));
@@ -151,7 +153,7 @@ $media-type: all !default;
151
153
 
152
154
  // Until: that breakpoint (exclusive)
153
155
  @if $until {
154
- @if type-of($until) == number {
156
+ @if meta.type-of($until) == number {
155
157
  $max-width: px2em($until);
156
158
  } @else {
157
159
  $max-width: px2em(get-breakpoint-width($until, $breakpoints)) - 0.01em;
@@ -171,7 +173,7 @@ $media-type: all !default;
171
173
  // Remove unnecessary media query prefix 'all and '
172
174
  @if ($media-type == 'all' and $media-query != '') {
173
175
  $media-type: '';
174
- $media-query: str-slice(unquote($media-query), 6);
176
+ $media-query: string.slice(string.unquote($media-query), 6);
175
177
  }
176
178
 
177
179
  @media #{$media-type + $media-query} {
@@ -190,8 +192,8 @@ $media-type: all !default;
190
192
  $equal: ();
191
193
  $large: ();
192
194
 
193
- @if length($list) > 1 {
194
- $seed: list.nth($list, math.ceil(math.div(length($list), 2)));
195
+ @if list.length($list) > 1 {
196
+ $seed: list.nth($list, math.ceil(math.div(list.length($list), 2)));
195
197
 
196
198
  @each $item in $list {
197
199
  @if ($item == $seed) {
@@ -203,7 +205,7 @@ $media-type: all !default;
203
205
  }
204
206
  }
205
207
 
206
- @return join(join(_quick-sort($less), $equal), _quick-sort($large));
208
+ @return list.join(list.join(_quick-sort($less), $equal), _quick-sort($large));
207
209
  }
208
210
 
209
211
  @return $list;
@@ -222,7 +224,7 @@ $media-type: all !default;
222
224
 
223
225
  // Reorder key/value pairs based on key values
224
226
  @each $value in $map-values-sorted {
225
- $index: index($map-values, $value);
227
+ $index: list.index($map-values, $value);
226
228
  $key: list.nth($map-keys, $index);
227
229
  $map-sorted: map.merge(
228
230
  $map-sorted,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sass-mq",
3
3
  "description": "mq() is a Sass mixin that helps manipulating media queries in an elegant way.",
4
- "version": "6.0.0",
4
+ "version": "7.0.0-beta.1",
5
5
  "keywords": [
6
6
  "responsive",
7
7
  "sass",
@@ -21,7 +21,6 @@
21
21
  ],
22
22
  "files": [
23
23
  "_mq.scss",
24
- "_mq.import.scss",
25
24
  "CHANGELOG.md",
26
25
  "LICENSE.md",
27
26
  "README.md",
@@ -51,9 +50,9 @@
51
50
  "homepage": "https://sass-mq.github.io/sass-mq/",
52
51
  "devDependencies": {
53
52
  "glob": "^7.1.7",
54
- "jest": "^27.0.4",
55
- "sass": "^1.35.1",
56
- "sass-true": "^6.0.1",
53
+ "jest": "^29.7.0",
54
+ "sass": "^1.80.4",
55
+ "sass-true": "^8.1.0",
57
56
  "sassdoc": "^2.7.3"
58
57
  }
59
58
  }
package/_mq.import.scss DELETED
@@ -1,2 +0,0 @@
1
- @forward 'mq' as mq-*;
2
- @forward 'mq' hide show-breakpoints, add-breakpoint, get-breakpoint-width, px2em, $media-type, $show-breakpoints, $breakpoints;