sass-mq 7.0.0 → 7.0.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/README.md +21 -0
  3. package/package.json +9 -2
package/CHANGELOG.md CHANGED
@@ -5,7 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
- <!-- ## Unreleased -->
8
+ ## v7.0.1 - 2026-06-19
9
+
10
+ ### Fixed
11
+
12
+ - Vite 8 compatibility: added a `package.json` `exports` field with a `sass` condition so `@use 'sass-mq'` resolves again. Vite 8 dropped the `main`-field fallback that earlier versions relied on ([#179](https://github.com/sass-mq/sass-mq/issues/179)).
13
+ - Behavior change: adding `exports` encapsulates the package. The documented `@use 'sass-mq'` import is unaffected, but undocumented deep imports such as `@use 'sass-mq/_mq.scss'` are no longer resolvable — use `@use 'sass-mq'` instead.
14
+
15
+ ### Added
16
+
17
+ - `examples/vite8`: a runnable Vite 8 project that proves `@use 'sass-mq'` resolves and compiles. It runs in CI as a regression test.
9
18
 
10
19
  ## v7.0.0 - 2025-06-16
11
20
 
package/README.md CHANGED
@@ -91,6 +91,27 @@ $show-breakpoints: (mobile, mobileLandscape, tablet, desktop, wide);
91
91
  );
92
92
  ```
93
93
 
94
+ ### Using with Vite, webpack and other bundlers
95
+
96
+ When you install Sass MQ from npm, import it by its package name and Sass will
97
+ resolve it from `node_modules`:
98
+
99
+ ```scss
100
+ @use 'sass-mq' as mq;
101
+
102
+ .foo {
103
+ @include mq.mq($from: tablet) {
104
+ color: red;
105
+ }
106
+ }
107
+ ```
108
+
109
+ Sass MQ declares a `sass` [package export](https://sass-lang.com/blog/announcing-pkg-importers/),
110
+ so it resolves out of the box with Vite (including Vite 8, which dropped the
111
+ `main`-field fallback — see [#179](https://github.com/sass-mq/sass-mq/issues/179)),
112
+ webpack's `sass-loader`, and the dart-sass `pkg:` importer. See the example in
113
+ [`examples/vite8`](examples/vite8).
114
+
94
115
  ### Notes about `@use` Vs `@import`
95
116
 
96
117
  When using the `@use` directive, you have to change your mindset when working with vars,
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": "7.0.0",
4
+ "version": "7.0.1",
5
5
  "keywords": [
6
6
  "responsive",
7
7
  "sass",
@@ -27,10 +27,17 @@
27
27
  "sass/index.scss"
28
28
  ],
29
29
  "main": "_mq.scss",
30
+ "sass": "_mq.scss",
31
+ "exports": {
32
+ ".": {
33
+ "sass": "./_mq.scss",
34
+ "default": "./_mq.scss"
35
+ }
36
+ },
30
37
  "scripts": {
31
38
  "test": "jest",
32
39
  "sassdoc": "./scripts/sassdoc.sh",
33
- "build:examples": "sass ./examples:./examples --no-source-map"
40
+ "build:examples": "sass ./examples/basic:./examples/basic ./examples/advanced:./examples/advanced ./examples/custom:./examples/custom --no-source-map"
34
41
  },
35
42
  "contributors": [
36
43
  {