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.
@@ -597,6 +597,10 @@ function getConfig$1(el, dataConfig) {
597
597
  return json ? JSON.parse(json) : {};
598
598
  }
599
599
 
600
+ function getPrefix() {
601
+ return getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix').trim();
602
+ }
603
+
600
604
  function localStore(key, enable) {
601
605
  if (enable === void 0) {
602
606
  enable = true;
@@ -745,6 +749,7 @@ var index = {
745
749
  Collection: Collection,
746
750
  FocusTrap: FocusTrap,
747
751
  getConfig: getConfig$1,
752
+ getPrefix: getPrefix,
748
753
  localStore: localStore,
749
754
  teleport: teleport,
750
755
  openTransition: openTransition,
@@ -993,26 +998,23 @@ var deregister$2 = function deregister(obj, close) {
993
998
  }
994
999
  };
995
1000
 
1001
+ function L() {
1002
+ return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
1003
+ }
1004
+
996
1005
  function getBreakpoint(drawer) {
997
- var prefix = getVariablePrefix();
1006
+ var prefix = L();
998
1007
  var bp = drawer.getAttribute("data-" + this.settings.dataBreakpoint);
999
1008
 
1000
1009
  if (this.settings.breakpoints && this.settings.breakpoints[bp]) {
1001
1010
  return this.settings.breakpoints[bp];
1002
- } else if (getComputedStyle(document.body).getPropertyValue(prefix + bp)) {
1003
- return getComputedStyle(document.body).getPropertyValue(prefix + bp);
1011
+ } else if (getComputedStyle(document.body).getPropertyValue("--" + prefix + "breakpoint-" + bp).trim()) {
1012
+ return getComputedStyle(document.body).getPropertyValue("--" + prefix + "breakpoint-" + bp).trim();
1004
1013
  } else {
1005
1014
  return bp;
1006
1015
  }
1007
1016
  }
1008
1017
 
1009
- function getVariablePrefix() {
1010
- var prefix = '--';
1011
- prefix += getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix');
1012
- prefix += 'breakpoint-';
1013
- return prefix;
1014
- }
1015
-
1016
1018
  function getDrawer(query) {
1017
1019
  // Get the entry from collection.
1018
1020
  var entry = typeof query === 'string' ? this.get(query) : this.get(query.id); // Return entry if it was resolved, otherwise throw error.
@@ -2306,7 +2308,7 @@ function getConfig(el, settings) {
2306
2308
 
2307
2309
  for (var prop in config) {
2308
2310
  // Get the CSS variable property values.
2309
- var prefix = getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix');
2311
+ var prefix = L();
2310
2312
  var value = styles.getPropertyValue("--" + prefix + "popover-" + prop).trim(); // If a value was found, replace the default in config obj.
2311
2313
 
2312
2314
  if (value) {