flowbite-svelte 1.12.2 → 1.12.3
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { browser } from "$app/environment";
|
|
2
1
|
/**
|
|
3
2
|
* A Svelte 5 rune-based media query hook
|
|
4
3
|
* @param query - CSS media query string (e.g., '(min-width: 768px)')
|
|
@@ -7,7 +6,7 @@ import { browser } from "$app/environment";
|
|
|
7
6
|
export function useMediaQuery(query) {
|
|
8
7
|
let matches = $state(false);
|
|
9
8
|
$effect(() => {
|
|
10
|
-
if (
|
|
9
|
+
if (typeof window === "undefined")
|
|
11
10
|
return;
|
|
12
11
|
const mediaQuery = window.matchMedia(query);
|
|
13
12
|
matches = mediaQuery.matches;
|
|
@@ -65,7 +64,7 @@ export function useBreakpoints() {
|
|
|
65
64
|
export function useCurrentBreakpoint() {
|
|
66
65
|
let currentBreakpoint = $state("xs");
|
|
67
66
|
$effect(() => {
|
|
68
|
-
if (
|
|
67
|
+
if (typeof window === "undefined")
|
|
69
68
|
return;
|
|
70
69
|
const updateBreakpoint = () => {
|
|
71
70
|
const width = window.innerWidth;
|