@symbo.ls/scratch 2.11.225 → 2.11.227

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.
@@ -1447,6 +1447,7 @@ var defaultProps = {
1447
1447
  h1Matches: 6,
1448
1448
  lineHeight: 1.5,
1449
1449
  subSequence: true,
1450
+ mediaRegenerate: false,
1450
1451
  unit: "em",
1451
1452
  templates: {},
1452
1453
  sequence: {},
@@ -1502,6 +1503,7 @@ var defaultProps2 = {
1502
1503
  ratio: SEQUENCE.phi,
1503
1504
  range: [-5, 15],
1504
1505
  subSequence: true,
1506
+ mediaRegenerate: false,
1505
1507
  unit: "em",
1506
1508
  sequence: {},
1507
1509
  scales: {},
@@ -1529,6 +1531,7 @@ var defaultProps3 = {
1529
1531
  type: "timing",
1530
1532
  ratio: SEQUENCE["perfect-fourth"],
1531
1533
  range: [-3, 12],
1534
+ mediaRegenerate: false,
1532
1535
  unit: "ms",
1533
1536
  sequence: {},
1534
1537
  scales: {},
@@ -1634,45 +1637,77 @@ var numToLetterMap = {
1634
1637
  19: "T"
1635
1638
  };
1636
1639
  var setSequenceValue = (props, sequenceProps) => {
1637
- const { key, variable, value, scaling, index } = props;
1640
+ const { key, variable, value, scaling, index, scalingVariable } = props;
1638
1641
  sequenceProps.sequence[key] = {
1639
1642
  key,
1640
1643
  decimal: ~~(value * 100) / 100,
1641
1644
  val: ~~value,
1642
1645
  scaling,
1643
1646
  index,
1647
+ scalingVariable,
1644
1648
  variable
1645
1649
  };
1646
1650
  sequenceProps.scales[key] = scaling;
1647
1651
  sequenceProps.vars[variable] = scaling + sequenceProps.unit;
1648
1652
  };
1653
+ var setScalingVar = (key, sequenceProps) => {
1654
+ const { type } = sequenceProps;
1655
+ if (key === 0)
1656
+ return "1em";
1657
+ const prefix = "--" + (type && type.replace(".", "-"));
1658
+ const ratioVar = `${prefix}-ratio`;
1659
+ if (key > 0) {
1660
+ const prevLetterKey = numToLetterMap[key - 1];
1661
+ return `calc(var(${prefix}-${prevLetterKey}) * var(${ratioVar}))`;
1662
+ }
1663
+ if (key < 0) {
1664
+ const nextLetterKey = numToLetterMap[key + 1];
1665
+ return `calc(var(${prefix}-${nextLetterKey}) / var(${ratioVar}))`;
1666
+ }
1667
+ };
1668
+ var setSubScalingVar = (index, arr, variable, sequenceProps) => {
1669
+ const { type } = sequenceProps;
1670
+ const skipMiddle = index === 2 && arr.length === 2;
1671
+ const indexMapWithLength = skipMiddle ? index + 1 : index;
1672
+ const prefix = "--" + (type && type.replace(".", "-"));
1673
+ const subRatioVarPrefix = `${prefix}-sub-ratio-`;
1674
+ return `calc(var(${variable}) * var(${subRatioVarPrefix + indexMapWithLength}))`;
1675
+ };
1676
+ var getSubratioDifference = (base, ratio) => {
1677
+ const diff = base * ratio - base;
1678
+ const subRatio = diff / 1.618;
1679
+ const first = base * ratio - subRatio;
1680
+ const second = base + subRatio;
1681
+ const middle = (first + second) / 2;
1682
+ return [first, middle, second];
1683
+ };
1684
+ var getSubratio = (base, ratio) => {
1685
+ return getSubratioDifference(base, ratio).map((v) => v / base);
1686
+ };
1649
1687
  var generateSubSequence = (props, sequenceProps) => {
1650
1688
  const { key, base, value, ratio, variable, index } = props;
1651
1689
  const next = value * ratio;
1652
- const diff = next - value;
1653
- const smallscale = diff / 1.618;
1654
- const valueRounded = ~~value;
1655
- const nextRounded = ~~next;
1656
- const diffRounded = nextRounded - valueRounded;
1657
- let arr = [];
1658
- const first = next - smallscale;
1659
- const second = value + smallscale;
1660
- const middle = (first + second) / 2;
1690
+ const diffRounded = ~~next - ~~value;
1691
+ let arr;
1692
+ const [first, middle, second] = getSubratioDifference(value, ratio);
1661
1693
  if (diffRounded > 16)
1662
1694
  arr = [first, middle, second];
1663
1695
  else
1664
1696
  arr = [first, second];
1665
- arr.map((v, k) => {
1697
+ arr.forEach((v, k) => {
1666
1698
  const scaling = ~~(v / base * 1e3) / 1e3;
1667
1699
  const newVar = variable + (k + 1);
1700
+ const newIndex = index + (k + 1) / 10;
1701
+ const scalingVariable = setSubScalingVar(k + 1, arr, variable, sequenceProps);
1668
1702
  const props2 = {
1669
1703
  key: key + (k + 1),
1670
1704
  variable: newVar,
1671
1705
  value: v,
1672
1706
  scaling,
1673
- index: index + (k + 1) / 10
1707
+ scalingVariable,
1708
+ index: newIndex
1674
1709
  };
1675
- return setSequenceValue(props2, sequenceProps);
1710
+ setSequenceValue(props2, sequenceProps);
1676
1711
  });
1677
1712
  };
1678
1713
  var switchSequenceOnNegative = (key, base, ratio) => {
@@ -1688,12 +1723,14 @@ var generateSequence = (sequenceProps) => {
1688
1723
  const value = switchSequenceOnNegative(key, base, ratio);
1689
1724
  const scaling = ~~(value / base * 100) / 100;
1690
1725
  const variable = prefix + letterKey;
1726
+ const scalingVariable = setScalingVar(key, sequenceProps);
1691
1727
  const props = {
1692
1728
  key: letterKey,
1693
1729
  variable,
1694
1730
  value,
1695
1731
  base,
1696
1732
  scaling,
1733
+ scalingVariable,
1697
1734
  ratio,
1698
1735
  index: key
1699
1736
  };
@@ -1769,62 +1806,110 @@ var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
1769
1806
 
1770
1807
  // src/utils/var.js
1771
1808
  var import_utils7 = __toESM(require_cjs(), 1);
1772
- var applySequenceVars = (props, mediaName, options = {}) => {
1809
+ var applyGlobalVars = (vars, obj, options) => {
1773
1810
  const CONFIG2 = getActiveConfig();
1774
- const { UNIT: UNIT2, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1775
- const unit = props.unit || UNIT2.default;
1776
- const { sequence, scales } = props;
1811
+ const { UNIT: UNIT2 } = CONFIG2;
1812
+ const unit = obj.unit || UNIT2.default;
1813
+ const { base, ratio, type } = obj;
1814
+ const prefix = "--" + (type && type.replace(".", "-"));
1815
+ vars[`${prefix}-base`] = base;
1816
+ vars[`${prefix}-unit`] = unit;
1817
+ const ratioVar = `${prefix}-ratio`;
1818
+ vars[ratioVar] = ratio;
1819
+ const [first, middle, second] = getSubratio(base, ratio);
1820
+ vars[`${prefix}-sub-ratio-1`] = first;
1821
+ vars[`${prefix}-sub-ratio-2`] = middle;
1822
+ vars[`${prefix}-sub-ratio-3`] = second;
1823
+ };
1824
+ var applySequenceVars = (FACTORY2, options = {}) => {
1825
+ const CONFIG2 = getActiveConfig();
1826
+ const { UNIT: UNIT2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1827
+ const unit = FACTORY2.unit || UNIT2.default;
1828
+ const { mediaRegenerate, sequence, scales } = FACTORY2;
1829
+ if (!mediaRegenerate) {
1830
+ applyGlobalVars(CSS_VARS2, FACTORY2, options);
1831
+ }
1777
1832
  for (const key in sequence) {
1778
1833
  const item = sequence[key];
1779
- const value = (props.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1780
- if (mediaName) {
1781
- const query = MEDIA2[mediaName];
1782
- if (!query) {
1783
- if (CONFIG2.verbose)
1784
- console.warn("Can't find query ", query);
1785
- }
1786
- let underMediaQuery = CSS_VARS2[`@media ${query}`];
1787
- if (!underMediaQuery)
1788
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1789
- underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
1790
- CSS_VARS2[item.variable + "_" + mediaName] = value;
1834
+ const value = (FACTORY2.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1835
+ if (!mediaRegenerate) {
1836
+ CSS_VARS2[item.variable + "_default"] = value;
1837
+ CSS_VARS2[item.variable] = item.scalingVariable;
1838
+ continue;
1839
+ }
1840
+ if (options.useDefault === false) {
1841
+ CSS_VARS2[item.variable] = value;
1791
1842
  } else {
1792
- if (options.useDefault === false) {
1793
- CSS_VARS2[item.variable] = value;
1794
- } else {
1795
- CSS_VARS2[item.variable + "_default"] = value;
1796
- CSS_VARS2[item.variable] = `var(${item.variable + "_default"})`;
1797
- }
1843
+ CSS_VARS2[item.variable + "_default"] = value;
1844
+ CSS_VARS2[item.variable] = `var(${item.variable + "_default"})`;
1798
1845
  }
1799
1846
  }
1800
1847
  };
1848
+ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1849
+ const CONFIG2 = getActiveConfig();
1850
+ const { UNIT: UNIT2, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1851
+ const mediaName = media.slice(1);
1852
+ const unit = FACTORY2.unit || UNIT2.default;
1853
+ const { mediaRegenerate } = FACTORY2;
1854
+ const { sequence, scales } = FACTORY2[media];
1855
+ const query = MEDIA2[mediaName];
1856
+ if (!query && CONFIG2.verbose)
1857
+ console.warn("Can't find media query ", query);
1858
+ if (!mediaRegenerate) {
1859
+ let underMediaQuery = CSS_VARS2[`@media ${query}`];
1860
+ if (!underMediaQuery)
1861
+ underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1862
+ applyGlobalVars(underMediaQuery, FACTORY2[media], options);
1863
+ return;
1864
+ }
1865
+ for (const key in sequence) {
1866
+ const item = sequence[key];
1867
+ const value = (FACTORY2.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1868
+ if (!query && CONFIG2.verbose)
1869
+ console.warn("Can't find query ", query);
1870
+ let underMediaQuery = CSS_VARS2[`@media ${query}`];
1871
+ if (!underMediaQuery)
1872
+ underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1873
+ underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
1874
+ CSS_VARS2[item.variable + "_" + mediaName] = value;
1875
+ }
1876
+ console.log(CSS_VARS2);
1877
+ };
1801
1878
 
1802
1879
  // src/utils/sprite.js
1803
1880
  var import_utils8 = __toESM(require_cjs(), 1);
1804
1881
 
1805
1882
  // src/system/spacing.js
1806
- var runThroughMedia = (sequenceProps) => {
1807
- for (const prop in sequenceProps) {
1808
- const mediaProps = sequenceProps[prop];
1809
- if (prop.slice(0, 1) === "@") {
1810
- const { type, base, ratio, range, subSequence, h1Matches, unit } = sequenceProps;
1811
- (0, import_utils10.merge)(mediaProps, {
1812
- type,
1813
- base,
1814
- ratio,
1815
- range,
1816
- subSequence,
1817
- h1Matches,
1818
- unit,
1819
- sequence: {},
1820
- scales: {},
1821
- templates: {},
1822
- vars: {}
1823
- });
1824
- generateSequence(mediaProps);
1825
- const mediaName = prop.slice(1);
1826
- applySequenceVars(mediaProps, mediaName);
1827
- }
1883
+ var runThroughMedia = (FACTORY2) => {
1884
+ for (const prop in FACTORY2) {
1885
+ const mediaProps = FACTORY2[prop];
1886
+ const isMediaName = prop.slice(0, 1) === "@";
1887
+ if (!isMediaName)
1888
+ continue;
1889
+ const {
1890
+ type,
1891
+ base,
1892
+ ratio,
1893
+ range,
1894
+ subSequence,
1895
+ h1Matches,
1896
+ unit
1897
+ } = FACTORY2;
1898
+ (0, import_utils10.merge)(mediaProps, {
1899
+ type,
1900
+ base,
1901
+ ratio,
1902
+ range,
1903
+ subSequence,
1904
+ h1Matches,
1905
+ unit,
1906
+ sequence: {},
1907
+ scales: {},
1908
+ templates: {},
1909
+ vars: {}
1910
+ });
1911
+ generateSequence(mediaProps);
1912
+ applyMediaSequenceVars(FACTORY2, prop);
1828
1913
  }
1829
1914
  };
1830
1915
  var applySpacingSequence = () => {
@@ -1899,7 +1984,7 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
1899
1984
  unit: SPACING2.unit
1900
1985
  });
1901
1986
  }
1902
- applySequenceVars(sequenceProps, null, { useDefault: false });
1987
+ applySequenceVars(sequenceProps, { useDefault: false });
1903
1988
  return getSpacingByKey(value, propertyName, sequenceProps);
1904
1989
  }
1905
1990
  return getSpacingByKey(value, propertyName);
@@ -1442,6 +1442,7 @@ var defaultProps = {
1442
1442
  h1Matches: 6,
1443
1443
  lineHeight: 1.5,
1444
1444
  subSequence: true,
1445
+ mediaRegenerate: false,
1445
1446
  unit: "em",
1446
1447
  templates: {},
1447
1448
  sequence: {},
@@ -1497,6 +1498,7 @@ var defaultProps2 = {
1497
1498
  ratio: SEQUENCE.phi,
1498
1499
  range: [-5, 15],
1499
1500
  subSequence: true,
1501
+ mediaRegenerate: false,
1500
1502
  unit: "em",
1501
1503
  sequence: {},
1502
1504
  scales: {},
@@ -1524,6 +1526,7 @@ var defaultProps3 = {
1524
1526
  type: "timing",
1525
1527
  ratio: SEQUENCE["perfect-fourth"],
1526
1528
  range: [-3, 12],
1529
+ mediaRegenerate: false,
1527
1530
  unit: "ms",
1528
1531
  sequence: {},
1529
1532
  scales: {},
@@ -1431,6 +1431,7 @@ var defaultProps = {
1431
1431
  h1Matches: 6,
1432
1432
  lineHeight: 1.5,
1433
1433
  subSequence: true,
1434
+ mediaRegenerate: false,
1434
1435
  unit: "em",
1435
1436
  templates: {},
1436
1437
  sequence: {},
@@ -1486,6 +1487,7 @@ var defaultProps2 = {
1486
1487
  ratio: SEQUENCE.phi,
1487
1488
  range: [-5, 15],
1488
1489
  subSequence: true,
1490
+ mediaRegenerate: false,
1489
1491
  unit: "em",
1490
1492
  sequence: {},
1491
1493
  scales: {},
@@ -1513,6 +1515,7 @@ var defaultProps3 = {
1513
1515
  type: "timing",
1514
1516
  ratio: SEQUENCE["perfect-fourth"],
1515
1517
  range: [-3, 12],
1518
+ mediaRegenerate: false,
1516
1519
  unit: "ms",
1517
1520
  sequence: {},
1518
1521
  scales: {},
@@ -1441,6 +1441,7 @@ var defaultProps = {
1441
1441
  h1Matches: 6,
1442
1442
  lineHeight: 1.5,
1443
1443
  subSequence: true,
1444
+ mediaRegenerate: false,
1444
1445
  unit: "em",
1445
1446
  templates: {},
1446
1447
  sequence: {},
@@ -1496,6 +1497,7 @@ var defaultProps2 = {
1496
1497
  ratio: SEQUENCE.phi,
1497
1498
  range: [-5, 15],
1498
1499
  subSequence: true,
1500
+ mediaRegenerate: false,
1499
1501
  unit: "em",
1500
1502
  sequence: {},
1501
1503
  scales: {},
@@ -1523,6 +1525,7 @@ var defaultProps3 = {
1523
1525
  type: "timing",
1524
1526
  ratio: SEQUENCE["perfect-fourth"],
1525
1527
  range: [-3, 12],
1528
+ mediaRegenerate: false,
1526
1529
  unit: "ms",
1527
1530
  sequence: {},
1528
1531
  scales: {},
@@ -1628,45 +1631,77 @@ var numToLetterMap = {
1628
1631
  19: "T"
1629
1632
  };
1630
1633
  var setSequenceValue = (props, sequenceProps) => {
1631
- const { key, variable, value, scaling, index } = props;
1634
+ const { key, variable, value, scaling, index, scalingVariable } = props;
1632
1635
  sequenceProps.sequence[key] = {
1633
1636
  key,
1634
1637
  decimal: ~~(value * 100) / 100,
1635
1638
  val: ~~value,
1636
1639
  scaling,
1637
1640
  index,
1641
+ scalingVariable,
1638
1642
  variable
1639
1643
  };
1640
1644
  sequenceProps.scales[key] = scaling;
1641
1645
  sequenceProps.vars[variable] = scaling + sequenceProps.unit;
1642
1646
  };
1647
+ var setScalingVar = (key, sequenceProps) => {
1648
+ const { type } = sequenceProps;
1649
+ if (key === 0)
1650
+ return "1em";
1651
+ const prefix = "--" + (type && type.replace(".", "-"));
1652
+ const ratioVar = `${prefix}-ratio`;
1653
+ if (key > 0) {
1654
+ const prevLetterKey = numToLetterMap[key - 1];
1655
+ return `calc(var(${prefix}-${prevLetterKey}) * var(${ratioVar}))`;
1656
+ }
1657
+ if (key < 0) {
1658
+ const nextLetterKey = numToLetterMap[key + 1];
1659
+ return `calc(var(${prefix}-${nextLetterKey}) / var(${ratioVar}))`;
1660
+ }
1661
+ };
1662
+ var setSubScalingVar = (index, arr, variable, sequenceProps) => {
1663
+ const { type } = sequenceProps;
1664
+ const skipMiddle = index === 2 && arr.length === 2;
1665
+ const indexMapWithLength = skipMiddle ? index + 1 : index;
1666
+ const prefix = "--" + (type && type.replace(".", "-"));
1667
+ const subRatioVarPrefix = `${prefix}-sub-ratio-`;
1668
+ return `calc(var(${variable}) * var(${subRatioVarPrefix + indexMapWithLength}))`;
1669
+ };
1670
+ var getSubratioDifference = (base, ratio) => {
1671
+ const diff = base * ratio - base;
1672
+ const subRatio = diff / 1.618;
1673
+ const first = base * ratio - subRatio;
1674
+ const second = base + subRatio;
1675
+ const middle = (first + second) / 2;
1676
+ return [first, middle, second];
1677
+ };
1678
+ var getSubratio = (base, ratio) => {
1679
+ return getSubratioDifference(base, ratio).map((v) => v / base);
1680
+ };
1643
1681
  var generateSubSequence = (props, sequenceProps) => {
1644
1682
  const { key, base, value, ratio, variable, index } = props;
1645
1683
  const next = value * ratio;
1646
- const diff = next - value;
1647
- const smallscale = diff / 1.618;
1648
- const valueRounded = ~~value;
1649
- const nextRounded = ~~next;
1650
- const diffRounded = nextRounded - valueRounded;
1651
- let arr = [];
1652
- const first = next - smallscale;
1653
- const second = value + smallscale;
1654
- const middle = (first + second) / 2;
1684
+ const diffRounded = ~~next - ~~value;
1685
+ let arr;
1686
+ const [first, middle, second] = getSubratioDifference(value, ratio);
1655
1687
  if (diffRounded > 16)
1656
1688
  arr = [first, middle, second];
1657
1689
  else
1658
1690
  arr = [first, second];
1659
- arr.map((v, k) => {
1691
+ arr.forEach((v, k) => {
1660
1692
  const scaling = ~~(v / base * 1e3) / 1e3;
1661
1693
  const newVar = variable + (k + 1);
1694
+ const newIndex = index + (k + 1) / 10;
1695
+ const scalingVariable = setSubScalingVar(k + 1, arr, variable, sequenceProps);
1662
1696
  const props2 = {
1663
1697
  key: key + (k + 1),
1664
1698
  variable: newVar,
1665
1699
  value: v,
1666
1700
  scaling,
1667
- index: index + (k + 1) / 10
1701
+ scalingVariable,
1702
+ index: newIndex
1668
1703
  };
1669
- return setSequenceValue(props2, sequenceProps);
1704
+ setSequenceValue(props2, sequenceProps);
1670
1705
  });
1671
1706
  };
1672
1707
  var switchSequenceOnNegative = (key, base, ratio) => {
@@ -1682,12 +1717,14 @@ var generateSequence = (sequenceProps) => {
1682
1717
  const value = switchSequenceOnNegative(key, base, ratio);
1683
1718
  const scaling = ~~(value / base * 100) / 100;
1684
1719
  const variable = prefix + letterKey;
1720
+ const scalingVariable = setScalingVar(key, sequenceProps);
1685
1721
  const props = {
1686
1722
  key: letterKey,
1687
1723
  variable,
1688
1724
  value,
1689
1725
  base,
1690
1726
  scaling,
1727
+ scalingVariable,
1691
1728
  ratio,
1692
1729
  index: key
1693
1730
  };
@@ -1763,32 +1800,42 @@ var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
1763
1800
 
1764
1801
  // src/utils/var.js
1765
1802
  var import_utils7 = __toESM(require_cjs(), 1);
1766
- var applySequenceVars = (props, mediaName, options = {}) => {
1803
+ var applyGlobalVars = (vars, obj, options) => {
1767
1804
  const CONFIG2 = getActiveConfig();
1768
- const { UNIT: UNIT2, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1769
- const unit = props.unit || UNIT2.default;
1770
- const { sequence, scales } = props;
1805
+ const { UNIT: UNIT2 } = CONFIG2;
1806
+ const unit = obj.unit || UNIT2.default;
1807
+ const { base, ratio, type } = obj;
1808
+ const prefix = "--" + (type && type.replace(".", "-"));
1809
+ vars[`${prefix}-base`] = base;
1810
+ vars[`${prefix}-unit`] = unit;
1811
+ const ratioVar = `${prefix}-ratio`;
1812
+ vars[ratioVar] = ratio;
1813
+ const [first, middle, second] = getSubratio(base, ratio);
1814
+ vars[`${prefix}-sub-ratio-1`] = first;
1815
+ vars[`${prefix}-sub-ratio-2`] = middle;
1816
+ vars[`${prefix}-sub-ratio-3`] = second;
1817
+ };
1818
+ var applySequenceVars = (FACTORY2, options = {}) => {
1819
+ const CONFIG2 = getActiveConfig();
1820
+ const { UNIT: UNIT2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1821
+ const unit = FACTORY2.unit || UNIT2.default;
1822
+ const { mediaRegenerate, sequence, scales } = FACTORY2;
1823
+ if (!mediaRegenerate) {
1824
+ applyGlobalVars(CSS_VARS2, FACTORY2, options);
1825
+ }
1771
1826
  for (const key in sequence) {
1772
1827
  const item = sequence[key];
1773
- const value = (props.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1774
- if (mediaName) {
1775
- const query = MEDIA2[mediaName];
1776
- if (!query) {
1777
- if (CONFIG2.verbose)
1778
- console.warn("Can't find query ", query);
1779
- }
1780
- let underMediaQuery = CSS_VARS2[`@media ${query}`];
1781
- if (!underMediaQuery)
1782
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1783
- underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
1784
- CSS_VARS2[item.variable + "_" + mediaName] = value;
1828
+ const value = (FACTORY2.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1829
+ if (!mediaRegenerate) {
1830
+ CSS_VARS2[item.variable + "_default"] = value;
1831
+ CSS_VARS2[item.variable] = item.scalingVariable;
1832
+ continue;
1833
+ }
1834
+ if (options.useDefault === false) {
1835
+ CSS_VARS2[item.variable] = value;
1785
1836
  } else {
1786
- if (options.useDefault === false) {
1787
- CSS_VARS2[item.variable] = value;
1788
- } else {
1789
- CSS_VARS2[item.variable + "_default"] = value;
1790
- CSS_VARS2[item.variable] = `var(${item.variable + "_default"})`;
1791
- }
1837
+ CSS_VARS2[item.variable + "_default"] = value;
1838
+ CSS_VARS2[item.variable] = `var(${item.variable + "_default"})`;
1792
1839
  }
1793
1840
  }
1794
1841
  };