mirror of https://github.com/sveltejs/svelte
fix: don't add parenthesis to media query if already present (#14699)
parent
61a0da8a5f
commit
887ce6ab4b
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: don't add parenthesis to media query if already present
|
@ -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)');
|
||||||
|
}
|
||||||
|
});
|
@ -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>
|
Loading…
Reference in new issue