Browse Source

fix addBreakpointListener

Yuki Takei 2 years ago
parent
commit
f8458f4e18
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/ui/src/utils/browser-utils.ts

+ 2 - 2
packages/ui/src/utils/browser-utils.ts

@@ -7,8 +7,8 @@ export const addBreakpointListener = (
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     listener: (this: MediaQueryList, ev: MediaQueryListEvent) => any,
     listener: (this: MediaQueryList, ev: MediaQueryListEvent) => any,
 ): MediaQueryList => {
 ): MediaQueryList => {
-  // get the value of '--breakpoint-*'
-  const breakpointPixel = parseInt(window.getComputedStyle(document.documentElement).getPropertyValue(`--breakpoint-${breakpoint}`), 10);
+  // get the value of '--bs-breakpoint-*'
+  const breakpointPixel = parseInt(window.getComputedStyle(document.documentElement).getPropertyValue(`--bs-breakpoint-${breakpoint}`), 10);
 
 
   const mediaQueryList = window.matchMedia(`(min-width: ${breakpointPixel}px)`);
   const mediaQueryList = window.matchMedia(`(min-width: ${breakpointPixel}px)`);