-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't add parenthesis to media query if already present (#14699)
- Loading branch information
1 parent
61a0da8
commit 887ce6a
Showing
5 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: don't add parenthesis to media query if already present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/svelte/tests/runtime-runes/samples/media-query/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { expect } from 'vitest'; | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
async test({ window }) { | ||
expect(window.matchMedia).toHaveBeenCalledWith('(max-width: 599px), (min-width: 900px)'); | ||
expect(window.matchMedia).toHaveBeenCalledWith('(min-width: 900px)'); | ||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/runtime-runes/samples/media-query/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script> | ||
import { MediaQuery } from "svelte/reactivity" | ||
const mq = new MediaQuery("(max-width: 599px), (min-width: 900px)"); | ||
const mq2 = new MediaQuery("min-width: 900px"); | ||
</script> |