vrembem 3.0.0 → 3.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.
@@ -292,6 +292,10 @@ function getConfig$1(el, dataConfig) {
292
292
  return json ? JSON.parse(json) : {};
293
293
  }
294
294
 
295
+ function getPrefix() {
296
+ return getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix').trim();
297
+ }
298
+
295
299
  function localStore(key, enable = true) {
296
300
  function getStore() {
297
301
  const value = localStorage.getItem(key);
@@ -436,6 +440,7 @@ var index = {
436
440
  Collection: Collection,
437
441
  FocusTrap: FocusTrap,
438
442
  getConfig: getConfig$1,
443
+ getPrefix: getPrefix,
439
444
  localStore: localStore,
440
445
  teleport: teleport,
441
446
  openTransition: openTransition,
@@ -641,26 +646,23 @@ async function deregister$2(obj, close = true) {
641
646
  return this.collection;
642
647
  }
643
648
 
649
+ function L() {
650
+ return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
651
+ }
652
+
644
653
  function getBreakpoint(drawer) {
645
- const prefix = getVariablePrefix();
654
+ const prefix = L();
646
655
  const bp = drawer.getAttribute(`data-${this.settings.dataBreakpoint}`);
647
656
 
648
657
  if (this.settings.breakpoints && this.settings.breakpoints[bp]) {
649
658
  return this.settings.breakpoints[bp];
650
- } else if (getComputedStyle(document.body).getPropertyValue(prefix + bp)) {
651
- return getComputedStyle(document.body).getPropertyValue(prefix + bp);
659
+ } else if (getComputedStyle(document.body).getPropertyValue(`--${prefix}breakpoint-${bp}`).trim()) {
660
+ return getComputedStyle(document.body).getPropertyValue(`--${prefix}breakpoint-${bp}`).trim();
652
661
  } else {
653
662
  return bp;
654
663
  }
655
664
  }
656
665
 
657
- function getVariablePrefix() {
658
- let prefix = '--';
659
- prefix += getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix');
660
- prefix += 'breakpoint-';
661
- return prefix;
662
- }
663
-
664
666
  function getDrawer(query) {
665
667
  // Get the entry from collection.
666
668
  const entry = typeof query === 'string' ? this.get(query) : this.get(query.id); // Return entry if it was resolved, otherwise throw error.
@@ -1695,7 +1697,7 @@ function getConfig(el, settings) {
1695
1697
 
1696
1698
  for (const prop in config) {
1697
1699
  // Get the CSS variable property values.
1698
- const prefix = getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix');
1700
+ const prefix = L();
1699
1701
  const value = styles.getPropertyValue(`--${prefix}popover-${prop}`).trim(); // If a value was found, replace the default in config obj.
1700
1702
 
1701
1703
  if (value) {