@tamagui/core 1.85.7 → 1.85.8

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.
@@ -1430,7 +1430,7 @@ var require_insertStyleRule_native = __commonJS({
1430
1430
  }
1431
1431
  return scannedCache.set(sheet2, cacheKey), dedupedThemes;
1432
1432
  }
1433
- var colorVarToVal, rootComputedStyle = null, schemes = { dark: !0, light: !0 };
1433
+ var colorVarToVal, rootComputedStyle = null;
1434
1434
  function addThemesFromCSS(cssStyleRule, tokens) {
1435
1435
  let selectors = cssStyleRule.selectorText.split(",");
1436
1436
  if (!selectors.length)
@@ -1448,7 +1448,7 @@ var require_insertStyleRule_native = __commonJS({
1448
1448
  if (sepI === -1)
1449
1449
  continue;
1450
1450
  let key = rule.slice(rule.indexOf("--") + 2, sepI), val = rule.slice(sepI + 2), value;
1451
- if (val[3] === "(") {
1451
+ if (val.startsWith("var(")) {
1452
1452
  let varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
1453
1453
  tokenVal ? value = tokenVal : (rootComputedStyle ||= getComputedStyle(document.body), value = rootComputedStyle.getPropertyValue("--" + varName));
1454
1454
  } else
@@ -1462,20 +1462,17 @@ var require_insertStyleRule_native = __commonJS({
1462
1462
  !0
1463
1463
  );
1464
1464
  }
1465
- return {
1466
- names: [
1467
- ...new Set(
1468
- selectors.map((selector) => {
1469
- let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), secondToLast = parts[parts.length - 2] || "", scheme = secondToLast.includes("dark") ? "dark" : secondToLast.includes("light") ? "light" : "", name = (() => {
1470
- let _ = parts[parts.length - 1];
1471
- return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
1472
- })();
1473
- return scheme === name || schemes[name] ? scheme : `${scheme}${scheme && name ? "_" : ""}${name}`;
1474
- })
1475
- )
1476
- ],
1465
+ let dedupedEntry = {
1466
+ names: [],
1477
1467
  theme: values
1478
1468
  };
1469
+ for (let selector of selectors) {
1470
+ let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
1471
+ name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
1472
+ let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
1473
+ dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
1474
+ }
1475
+ return dedupedEntry;
1479
1476
  }
1480
1477
  function getTamaguiSelector(rule, collectThemes = !1) {
1481
1478
  if (rule instanceof CSSStyleRule) {