@barocss/math-editor 0.4.0 → 0.5.0

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.
Files changed (49) hide show
  1. package/API-SESSION.md +10 -0
  2. package/API-WEB-COMPONENT.md +2 -0
  3. package/CHANGELOG.md +61 -0
  4. package/EDITING-SCENARIOS.md +174 -0
  5. package/IMPLEMENTATION.md +95 -0
  6. package/LATEX-GUIDE.md +22 -0
  7. package/LATEX-MODEL.md +12 -0
  8. package/LATEX-SCOPE.md +10 -1
  9. package/README.md +73 -19
  10. package/RELEASING.md +81 -10
  11. package/RENDERING-TESTS.md +79 -0
  12. package/ROADMAP.md +132 -5
  13. package/VALIDATION.md +331 -0
  14. package/dist/context-tools.d.ts +21 -0
  15. package/dist/context-tools.js +37 -0
  16. package/dist/dom/context-keyboard.d.ts +2 -0
  17. package/dist/dom/context-keyboard.js +22 -0
  18. package/dist/dom/menu-position.d.ts +3 -0
  19. package/dist/dom/menu-position.js +45 -1
  20. package/dist/dom.d.ts +2 -0
  21. package/dist/dom.js +187 -38
  22. package/dist/latex.js +11 -0
  23. package/dist/locales/en.js +13 -1
  24. package/dist/locales/en.json +13 -1
  25. package/dist/locales/ko.js +13 -1
  26. package/dist/locales/ko.json +13 -1
  27. package/dist/math-editor.d.ts +3 -1
  28. package/dist/math-editor.js +394 -280
  29. package/dist/math-layout.d.ts +12 -0
  30. package/dist/math-layout.js +59 -0
  31. package/dist/math-spacing.d.ts +13 -0
  32. package/dist/math-spacing.js +87 -0
  33. package/dist/model.d.ts +4 -0
  34. package/dist/model.js +49 -4
  35. package/dist/root-transform.d.ts +19 -0
  36. package/dist/root-transform.js +69 -0
  37. package/dist/suggestions.d.ts +9 -0
  38. package/dist/suggestions.js +53 -0
  39. package/dist/web-component.js +9 -1
  40. package/package.json +11 -3
  41. package/src/fonts/KaTeX_Math-Italic.woff2 +0 -0
  42. package/src/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  43. package/src/fonts/README.md +18 -0
  44. package/src/shapes/README.md +21 -0
  45. package/src/shapes/parenthesis-bottom.svg +1 -0
  46. package/src/shapes/parenthesis-top.svg +1 -0
  47. package/src/shapes/parenthesis.svg +1 -0
  48. package/src/shapes/radical.svg +1 -0
  49. package/src/style.css +695 -44
package/src/style.css CHANGED
@@ -1,9 +1,24 @@
1
- /* Use lining numerals for mathematical baselines and a clear similarity sign.
2
- Georgia's text numerals have uneven heights and its U+223C is unusually curled. */
1
+ /* Match the reference math faces in both editable inputs and passive runs.
2
+ The bundled fonts retain their KaTeX license in src/fonts. */
3
3
  @font-face {
4
4
  font-family: 'Barocss Math Glyphs';
5
5
  src: url('./fonts/KaTeX_Main-Regular.woff2') format('woff2');
6
- unicode-range: U+0030-0039, U+223C;
6
+ font-style: normal;
7
+ font-weight: 400;
8
+ font-display: swap;
9
+ }
10
+ @font-face {
11
+ font-family: 'Barocss Math Glyphs';
12
+ src: url('./fonts/KaTeX_Math-Italic.woff2') format('woff2');
13
+ font-style: italic;
14
+ font-weight: 400;
15
+ font-display: swap;
16
+ }
17
+ @font-face {
18
+ font-family: 'Barocss Large Operators';
19
+ src: url('./fonts/KaTeX_Size2-Regular.woff2') format('woff2');
20
+ font-style: normal;
21
+ font-display: swap;
7
22
  }
8
23
  .me-editor {
9
24
  color: var(--me-text, #202c27);
@@ -125,11 +140,12 @@
125
140
  align-self: flex-end;
126
141
  transform: translateY(0.3em);
127
142
  }
143
+ /* Normal scripts use TeX script size; root indices use scriptscript size (VIS-004/005). */
128
144
  .me-superscript > .me-slot:last-child .me-input,
129
145
  .me-subscript > .me-slot:last-child .me-input,
130
146
  .me-superscript > .me-slot:last-child .me-measure,
131
147
  .me-subscript > .me-slot:last-child .me-measure {
132
- font-size: calc(var(--me-font-size, 22px) * 16 / 22);
148
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
133
149
  }
134
150
  .me-suggestions {
135
151
  position: absolute;
@@ -286,10 +302,10 @@
286
302
  }
287
303
  .me-limit .me-input,
288
304
  .me-limit .me-measure {
289
- font-size: calc(var(--me-font-size, 22px) * 14 / 22);
305
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
290
306
  }
291
307
  .me-operator-glyph {
292
- font: 35px/1 'Barocss Math Glyphs', Georgia, serif;
308
+ font: calc(var(--me-font-size, 22px) * 1.59) / 1 'Barocss Math Glyphs', Georgia, serif;
293
309
  }
294
310
  .me-large-operator {
295
311
  gap: 8px;
@@ -616,10 +632,10 @@
616
632
  }
617
633
  .me-superscript > .me-slot:last-child .me-preview-token,
618
634
  .me-subscript > .me-slot:last-child .me-preview-token {
619
- font-size: calc(var(--me-font-size, 22px) * 16 / 22);
635
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
620
636
  }
621
637
  .me-limit .me-preview-token {
622
- font-size: calc(var(--me-font-size, 22px) * 14 / 22);
638
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
623
639
  }
624
640
  .me-range-highlight,
625
641
  .me-empty[data-range-selected='true'] {
@@ -804,7 +820,7 @@
804
820
  grid-row: 1;
805
821
  }
806
822
  .me-scripts > .me-slot:not(:first-child) :is(.me-input, .me-measure, .me-preview-token) {
807
- font-size: calc(var(--me-font-size, 22px) * 16 / 22);
823
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
808
824
  }
809
825
 
810
826
  .me-textGroup,
@@ -850,7 +866,7 @@
850
866
  margin-top: 4px;
851
867
  }
852
868
  .me-indexedRoot > .me-slot:nth-last-child(2) :is(.me-input, .me-measure, .me-preview-token) {
853
- font-size: calc(var(--me-font-size, 22px) * 14 / 22);
869
+ font-size: calc(var(--me-font-size, 22px) * 0.5);
854
870
  }
855
871
 
856
872
  /* Accents follow the editable body's width, including nested structures. */
@@ -949,7 +965,7 @@
949
965
  align-self: baseline;
950
966
  }
951
967
  .me-limit-operator .me-limit :is(.me-input, .me-measure, .me-preview-token) {
952
- font-size: calc(var(--me-font-size, 22px) * 14 / 22);
968
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
953
969
  line-height: 1.1;
954
970
  padding-block: 1px;
955
971
  }
@@ -998,7 +1014,7 @@
998
1014
  font-size: calc(var(--me-font-size, 22px) * 16 / 22);
999
1015
  }
1000
1016
  .me-limit :is(.me-quad, .me-qquad) {
1001
- font-size: calc(var(--me-font-size, 22px) * 14 / 22);
1017
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
1002
1018
  }
1003
1019
 
1004
1020
  /* Structured delimiters export as \left/\right and stretch with their body. */
@@ -1015,14 +1031,11 @@
1015
1031
  :is(.me-parentheses, .me-brackets, .me-absolute) > .me-delimiter:last-child {
1016
1032
  border-right: 1.5px solid currentColor;
1017
1033
  }
1018
- /* A tapered curve keeps its bow at tall sizes; an elliptical border flattens. */
1034
+ /* The outline mask is shared with mixed fences in the contour rules below. */
1019
1035
  .me-parentheses > .me-delimiter:first-child,
1020
1036
  .me-parentheses > .me-delimiter:last-child {
1021
- flex-basis: 8px;
1022
1037
  border: 0;
1023
1038
  background: currentColor;
1024
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 100' preserveAspectRatio='none'%3E%3Cpath d='M14 0C4 16 0 32 0 50C0 68 4 84 14 100L14 97C7 80 3 65 3 50C3 35 7 20 14 3Z'/%3E%3C/svg%3E")
1025
- center / 100% 100% no-repeat;
1026
1039
  }
1027
1040
  .me-parentheses > .me-delimiter:last-child {
1028
1041
  transform: scaleX(-1);
@@ -1052,7 +1065,7 @@
1052
1065
  :is(.me-openClosed, .me-closedOpen, .me-fenced) > :is([data-fence='('], [data-fence=')']),
1053
1066
  .me-matrix[data-environment='pmatrix'] > .me-matrix-delimiter {
1054
1067
  background: currentColor;
1055
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 100' preserveAspectRatio='none'%3E%3Cpath d='M14 0C4 16 0 32 0 50C0 68 4 84 14 100L14 97C7 80 3 65 3 50C3 35 7 20 14 3Z'/%3E%3C/svg%3E")
1068
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 100' preserveAspectRatio='none'%3E%3Cpath d='M14 0C4 16 0 32 0 50C0 68 4 84 14 100L14 98C7 80 2.5 65 2.5 50C2.5 35 7 20 14 2Z'/%3E%3C/svg%3E")
1056
1069
  center / 100% 100% no-repeat;
1057
1070
  }
1058
1071
  .me-delimiter[data-fence=')'] {
@@ -1104,7 +1117,7 @@
1104
1117
  :is(.me-overset, .me-underset)
1105
1118
  > .me-slot:first-child
1106
1119
  :is(.me-input, .me-preview-token, .me-measure) {
1107
- font-size: calc(var(--me-font-size, 22px) * 14 / 22);
1120
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
1108
1121
  }
1109
1122
  /* Square and indexed roots share a radical joined to the radicand's overbar. */
1110
1123
  .me-root > .me-radical,
@@ -1116,17 +1129,6 @@
1116
1129
  margin-top: 4px;
1117
1130
  font-size: 0;
1118
1131
  background: currentColor;
1119
- clip-path: polygon(
1120
- 0 55%,
1121
- 6px 50%,
1122
- 12px 88%,
1123
- 21px 0,
1124
- 100% 0,
1125
- 14px 100%,
1126
- 11px 100%,
1127
- 5px 58%,
1128
- 1px 61%
1129
- );
1130
1132
  }
1131
1133
  .me-indexedRoot > .me-slot:nth-last-child(2) {
1132
1134
  margin-right: -9px;
@@ -1169,7 +1171,7 @@
1169
1171
  > .me-operator-glyph {
1170
1172
  grid-column: 1;
1171
1173
  grid-row: 1 / 3;
1172
- font-size: 44px;
1174
+ font-size: calc(var(--me-font-size, 22px) * 2);
1173
1175
  }
1174
1176
  :is(
1175
1177
  [data-structure='integral'],
@@ -1229,11 +1231,12 @@
1229
1231
  /* Keep nested fractions readable while avoiding full-size recursive stacks.
1230
1232
  Apply the same size to the input, passive glyph and measuring twin. */
1231
1233
  .me-fraction .me-fraction :is(.me-input, .me-measure, .me-preview-token) {
1232
- font-size: calc(var(--me-font-size, 22px) * 16 / 22);
1233
- line-height: 1.2;
1234
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
1235
+ line-height: 1;
1236
+ padding-block: 0;
1234
1237
  }
1235
1238
  .me-fraction .me-fraction .me-fraction :is(.me-input, .me-measure, .me-preview-token) {
1236
- font-size: 12px;
1239
+ font-size: calc(var(--me-font-size, 22px) * 0.5);
1237
1240
  }
1238
1241
  .me-fraction .me-fraction .me-row {
1239
1242
  min-height: 0;
@@ -1289,8 +1292,8 @@
1289
1292
  }
1290
1293
  [data-structure='contourIntegral'][data-limit-placement] > .me-limits > .me-operator-glyph {
1291
1294
  font: normal var(--me-font-size, 22px) / 2.3 'Barocss Contour', serif;
1292
- width: 25px;
1293
- height: 51px;
1295
+ width: calc(var(--me-font-size, 22px) * 25 / 22);
1296
+ height: calc(var(--me-font-size, 22px) * 2.3);
1294
1297
  transform: none;
1295
1298
  }
1296
1299
 
@@ -1314,7 +1317,7 @@
1314
1317
  :is(.me-overbrace, .me-underbrace)
1315
1318
  > .me-slot:first-child
1316
1319
  :is(.me-input, .me-measure, .me-preview-token) {
1317
- font-size: calc(var(--me-font-size, 22px) * 14 / 22);
1320
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
1318
1321
  line-height: 1.1;
1319
1322
  }
1320
1323
  :is(.me-overbrace, .me-underbrace) > .me-slot:last-child {
@@ -1322,20 +1325,23 @@
1322
1325
  width: 100%;
1323
1326
  box-sizing: border-box;
1324
1327
  }
1328
+ :is(.me-overbrace, .me-underbrace) > .me-slot:last-child {
1329
+ min-width: calc(var(--me-font-size, 22px) * 1.6);
1330
+ }
1325
1331
  .me-overbrace > .me-slot:last-child {
1326
- padding-top: 9px;
1332
+ padding-top: calc(var(--me-font-size, 22px) * 0.4);
1327
1333
  }
1328
1334
  .me-underbrace > .me-slot:last-child {
1329
- padding-bottom: 9px;
1335
+ padding-bottom: calc(var(--me-font-size, 22px) * 0.4);
1330
1336
  }
1331
1337
  :is(.me-overbrace, .me-underbrace) > .me-slot:last-child::before {
1332
1338
  content: '';
1333
1339
  position: absolute;
1334
1340
  inset-inline: 0;
1335
1341
  top: 0;
1336
- height: 8px;
1342
+ height: calc(var(--me-font-size, 22px) * 0.35);
1337
1343
  background: currentColor;
1338
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'%3E%3Cpath d='M0 12Q0 5 12 5L38 5Q48 5 50 0Q52 5 62 5L88 5Q100 5 100 12L98 12Q98 8 88 8L62 8Q53 8 50 4Q47 8 38 8L12 8Q2 8 2 12Z'/%3E%3C/svg%3E")
1344
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'%3E%3Cpath d='M0 12C4 6 12 7 24 5C37 3 45 2 50 0C55 2 63 3 76 5C88 7 96 6 100 12L98 12C94 9 86 10 75 8C62 6 54 5 50 3C46 5 38 6 25 8C14 10 6 9 2 12Z'/%3E%3C/svg%3E")
1339
1345
  center / 100% 100% no-repeat;
1340
1346
  pointer-events: none;
1341
1347
  }
@@ -1494,7 +1500,7 @@
1494
1500
  )[data-limit-placement='nolimits']
1495
1501
  > .me-limits
1496
1502
  > .me-operator-glyph {
1497
- font-size: 44px;
1503
+ font-size: calc(var(--me-font-size, 22px) * 2);
1498
1504
  }
1499
1505
 
1500
1506
  /* TeX math units: 18mu = 1em. Negative spacing has no painted hit box. */
@@ -1529,12 +1535,12 @@
1529
1535
  /* Explicit fraction/binomial styles override the surrounding default size.
1530
1536
  Nested explicit styles use the nearest style container's inherited value. */
1531
1537
  .me-structure[data-math-style='display'] {
1532
- --me-explicit-size: 22px;
1538
+ --me-explicit-size: var(--me-font-size, 22px);
1533
1539
  }
1534
1540
  .me-structure[data-math-style='text'] {
1535
- --me-explicit-size: 16px;
1541
+ --me-explicit-size: calc(var(--me-font-size, 22px) * 0.7);
1536
1542
  }
1537
- .me-structure[data-math-style] :is(.me-input, .me-measure, .me-preview-token) {
1543
+ .me-structure[data-math-style] > .me-slot :is(.me-input, .me-measure, .me-preview-token) {
1538
1544
  font-size: var(--me-explicit-size);
1539
1545
  }
1540
1546
  .me-structure[data-math-style='text'] > .me-slot > .me-row {
@@ -1727,3 +1733,648 @@
1727
1733
  align-items: center;
1728
1734
  gap: 8px;
1729
1735
  }
1736
+
1737
+ /* A fraction inside a script uses scriptscript-sized terms. Its rows must not
1738
+ retain the body's minimum line height, including while a term is editable. */
1739
+ :is(.me-superscript, .me-subscript, .me-scripts)
1740
+ > .me-slot:not(:first-child)
1741
+ .me-fraction:not([data-math-style='display'])
1742
+ :is(.me-input, .me-measure, .me-preview-token) {
1743
+ font-size: calc(var(--me-font-size, 22px) * 0.5);
1744
+ line-height: 1.1;
1745
+ padding-block: 0;
1746
+ }
1747
+ :is(.me-superscript, .me-subscript, .me-scripts)
1748
+ > .me-slot:not(:first-child)
1749
+ .me-fraction:not([data-math-style='display'])
1750
+ .me-row {
1751
+ min-height: 0;
1752
+ }
1753
+ :is(.me-superscript, .me-subscript, .me-scripts)
1754
+ > .me-slot:not(:first-child)
1755
+ .me-fraction:not([data-math-style='display'])
1756
+ > .me-slot {
1757
+ padding: 0 2px;
1758
+ }
1759
+ /* Compact fraction terms already reduce the script height. A simple base needs
1760
+ only a small shift; a tall structured base needs height-relative clearance. */
1761
+ .me-superscript > .me-slot:last-child:has(> .me-row > .me-fraction) {
1762
+ transform: translateY(-0.2em);
1763
+ }
1764
+ .me-subscript > .me-slot:last-child:has(> .me-row > .me-fraction) {
1765
+ transform: translateY(0.2em);
1766
+ }
1767
+ .me-superscript:has(> .me-slot:first-child > .me-row > .me-structure)
1768
+ > .me-slot:last-child:has(> .me-row > .me-fraction) {
1769
+ transform: translateY(-45%);
1770
+ }
1771
+ .me-subscript:has(> .me-slot:first-child > .me-row > .me-structure)
1772
+ > .me-slot:last-child:has(> .me-row > .me-fraction) {
1773
+ transform: translateY(45%);
1774
+ }
1775
+ /* Empty model boundaries are caret targets, not extra space before a script. */
1776
+ :is(.me-superscript, .me-subscript, .me-scripts)
1777
+ > .me-slot:not(:first-child)
1778
+ > .me-row
1779
+ > .me-empty-boundary:not(:focus-within)
1780
+ > .me-measure {
1781
+ min-width: 1px;
1782
+ width: 1px;
1783
+ padding-inline: 0;
1784
+ }
1785
+ :is(.me-superscript, .me-subscript, .me-scripts)
1786
+ > .me-slot:not(:first-child)
1787
+ > .me-row
1788
+ > .me-fraction {
1789
+ margin-inline: 1px;
1790
+ }
1791
+
1792
+ /* Query-independent structure actions remain visible while their operand is edited. */
1793
+ .me-context-footer {
1794
+ display: flex;
1795
+ align-items: center;
1796
+ flex-wrap: wrap;
1797
+ gap: 8px 12px;
1798
+ padding: 10px 14px;
1799
+ border-top: 1px solid var(--me-line, #d9e1dd);
1800
+ background: var(--me-subtle-background, #f6f8f6);
1801
+ color: var(--me-text, #202c27);
1802
+ font: 12px/1.4 var(--me-ui-font-family, system-ui, sans-serif);
1803
+ text-align: start;
1804
+ }
1805
+ .me-context-footer[hidden] {
1806
+ display: none;
1807
+ }
1808
+ .me-context-label {
1809
+ font-weight: 600;
1810
+ }
1811
+ .me-context-actions {
1812
+ display: flex;
1813
+ flex-wrap: wrap;
1814
+ gap: 6px;
1815
+ }
1816
+ .me-context-button {
1817
+ appearance: none;
1818
+ font: inherit;
1819
+ color: inherit;
1820
+ background: var(--me-panel-background, white);
1821
+ border: 1px solid var(--me-line, #cbd8cf);
1822
+ border-radius: var(--me-control-radius, 6px);
1823
+ padding: 6px 10px;
1824
+ cursor: pointer;
1825
+ }
1826
+ .me-context-button:hover:not(:disabled) {
1827
+ background: var(--me-hover-background, #e7efe9);
1828
+ }
1829
+ .me-context-button:focus-visible {
1830
+ outline: 2px solid var(--me-accent, #236957);
1831
+ outline-offset: 2px;
1832
+ }
1833
+ .me-context-button:disabled {
1834
+ opacity: 0.5;
1835
+ cursor: default;
1836
+ }
1837
+ .me-context-hint {
1838
+ color: var(--me-muted, #708075);
1839
+ font-size: 11px;
1840
+ }
1841
+ .me-context-button[aria-pressed='true'] {
1842
+ background: var(--me-hover-background, #e7efe9);
1843
+ color: var(--me-accent, #236957);
1844
+ font-weight: 600;
1845
+ }
1846
+
1847
+ /* Geometry audit: remove UI line-box struts from math stacks. Keep the same
1848
+ metrics for passive text, the input, and its measuring span. */
1849
+ .me-large-operator > .me-limits > .me-limit {
1850
+ display: inline-flex;
1851
+ }
1852
+ .me-large-operator > .me-limits > .me-limit > .me-row {
1853
+ min-height: 0;
1854
+ }
1855
+ .me-large-operator .me-limit :is(.me-input, .me-measure, .me-preview-token) {
1856
+ line-height: 1.1;
1857
+ padding-block: 0;
1858
+ }
1859
+ /* Side bounds span the full integral height, with room for the glyph's slant. */
1860
+ :is(
1861
+ [data-structure='integral'],
1862
+ [data-structure='doubleIntegral'],
1863
+ [data-structure='tripleIntegral'],
1864
+ [data-structure='contourIntegral']
1865
+ )
1866
+ > .me-limits
1867
+ > :is(.me-limit:first-child, .me-limit:last-child) {
1868
+ position: relative;
1869
+ }
1870
+ :is(
1871
+ [data-structure='integral'],
1872
+ [data-structure='doubleIntegral'],
1873
+ [data-structure='tripleIntegral'],
1874
+ [data-structure='contourIntegral']
1875
+ )
1876
+ > .me-limits
1877
+ > .me-operator-glyph {
1878
+ font-size: calc(var(--me-font-size, 22px) * 2);
1879
+ }
1880
+ :is(
1881
+ [data-structure='integral'],
1882
+ [data-structure='doubleIntegral'],
1883
+ [data-structure='tripleIntegral'],
1884
+ [data-structure='contourIntegral']
1885
+ )
1886
+ > .me-limits
1887
+ > .me-limit:first-child {
1888
+ top: calc(var(--me-font-size, 22px) * -0.35);
1889
+ }
1890
+ :is(
1891
+ [data-structure='integral'],
1892
+ [data-structure='doubleIntegral'],
1893
+ [data-structure='tripleIntegral'],
1894
+ [data-structure='contourIntegral']
1895
+ )
1896
+ > .me-limits
1897
+ > .me-limit:last-child {
1898
+ top: calc(var(--me-font-size, 22px) * 0.25);
1899
+ }
1900
+ :is(
1901
+ [data-structure='integral'],
1902
+ [data-structure='doubleIntegral'],
1903
+ [data-structure='tripleIntegral'],
1904
+ [data-structure='contourIntegral']
1905
+ )[data-limit-placement='limits']
1906
+ > .me-limits
1907
+ > .me-limit {
1908
+ top: 0;
1909
+ }
1910
+ /* Annotation rows overlap their text line boxes, not their painted glyphs. */
1911
+ :is(.me-overset, .me-underset) > .me-slot {
1912
+ display: inline-flex;
1913
+ justify-content: center;
1914
+ }
1915
+ :is(.me-overset, .me-underset) > .me-slot > .me-row {
1916
+ min-height: 0;
1917
+ }
1918
+ :is(.me-overset, .me-underset) > .me-slot :is(.me-input, .me-measure, .me-preview-token) {
1919
+ line-height: 1;
1920
+ padding-block: 0;
1921
+ }
1922
+ .me-overset > .me-slot:first-child {
1923
+ margin-bottom: calc(var(--me-font-size, 22px) * -0.2);
1924
+ }
1925
+ .me-underset > .me-slot:first-child {
1926
+ margin-top: calc(var(--me-font-size, 22px) * -0.2);
1927
+ }
1928
+ /* Matrix environments use text-style cells; aligned/cases retain display rows. */
1929
+ .me-matrix[data-structure='matrix'] > .me-matrix-grid {
1930
+ row-gap: calc(var(--me-font-size, 22px) * 0.07);
1931
+ }
1932
+ .me-matrix[data-structure='matrix'] > .me-matrix-grid > .me-matrix-cell > .me-row {
1933
+ min-height: 0;
1934
+ }
1935
+ .me-matrix[data-structure='matrix']
1936
+ > .me-matrix-grid
1937
+ > .me-matrix-cell
1938
+ > .me-row
1939
+ > .me-run
1940
+ :is(.me-input, .me-measure, .me-preview-token) {
1941
+ line-height: 1.2;
1942
+ padding-block: 0;
1943
+ }
1944
+ .me-matrix[data-structure='matrix']
1945
+ .me-fraction:not([data-math-style='display'])
1946
+ :is(.me-input, .me-measure, .me-preview-token) {
1947
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
1948
+ line-height: 0.85;
1949
+ padding-block: 0;
1950
+ }
1951
+ .me-matrix[data-structure='matrix'] .me-fraction:not([data-math-style='display']) .me-row {
1952
+ min-height: 0;
1953
+ }
1954
+
1955
+ /* Brace annotations need a compact body row as well as a compact label row. */
1956
+ :is(.me-overbrace, .me-underbrace) > .me-slot > .me-row {
1957
+ min-height: 0;
1958
+ }
1959
+ :is(.me-overbrace, .me-underbrace) > .me-slot :is(.me-input, .me-measure, .me-preview-token) {
1960
+ line-height: 1.1;
1961
+ padding-block: 0;
1962
+ }
1963
+ /* A display fraction in a script keeps full-size terms. Raise/lower the whole
1964
+ stack so that its near edge clears the base, not just its fraction bar. */
1965
+ .me-superscript > .me-slot:last-child:has(> .me-row > .me-fraction[data-math-style='display']) {
1966
+ transform: translateY(-30%);
1967
+ }
1968
+ .me-subscript > .me-slot:last-child:has(> .me-row > .me-fraction[data-math-style='display']) {
1969
+ transform: translateY(30%);
1970
+ }
1971
+
1972
+ /* Use the display operator glyphs themselves, including their italic correction,
1973
+ rather than enlarging/skewing a text-font integral or sum. */
1974
+ .me-large-operator[data-structure][data-limit-placement] > .me-limits > .me-operator-glyph {
1975
+ font: normal var(--me-font-size, 22px) / 1.6 'Barocss Large Operators', serif;
1976
+ transform: none;
1977
+ width: auto;
1978
+ height: calc(var(--me-font-size, 22px) * 1.6);
1979
+ }
1980
+ .me-large-operator:is(
1981
+ [data-structure='integral'],
1982
+ [data-structure='doubleIntegral'],
1983
+ [data-structure='tripleIntegral'],
1984
+ [data-structure='contourIntegral']
1985
+ )[data-limit-placement]
1986
+ > .me-limits
1987
+ > .me-operator-glyph {
1988
+ line-height: 2.3;
1989
+ height: calc(var(--me-font-size, 22px) * 2.3);
1990
+ }
1991
+ /* Keep fence curvature and stroke proportional to the chosen math size. */
1992
+ .me-parentheses > .me-delimiter,
1993
+ :is(.me-openClosed, .me-closedOpen, .me-fenced) > :is([data-fence='('], [data-fence=')']) {
1994
+ flex-basis: calc(var(--me-font-size, 22px) * 0.389);
1995
+ }
1996
+ .me-parentheses:has(> .me-slot .me-structure) > .me-delimiter,
1997
+ :is(.me-openClosed, .me-closedOpen, .me-fenced):has(> .me-slot .me-structure)
1998
+ > :is([data-fence='('], [data-fence=')']) {
1999
+ flex-basis: calc(var(--me-font-size, 22px) * 0.55);
2000
+ }
2001
+ .me-matrix[data-environment='pmatrix'] > .me-matrix-delimiter {
2002
+ width: calc(var(--me-font-size, 22px) * 0.55);
2003
+ }
2004
+ .me-delimiter:is([data-fence='{'], [data-fence='}']),
2005
+ .me-matrix:is([data-environment='Bmatrix'], [data-structure='cases']) > .me-matrix-delimiter {
2006
+ width: calc(var(--me-font-size, 22px) * 0.55);
2007
+ flex-basis: calc(var(--me-font-size, 22px) * 0.55);
2008
+ }
2009
+
2010
+ /* Brace outlines derived from KaTeX 0.16.28 svgGeometry.js (MIT; see
2011
+ fonts/LICENSE-KaTeX.txt). Clip three slices so long braces keep curved ends. */
2012
+ :is(.me-overbrace, .me-underbrace) > .me-slot:last-child::before {
2013
+ height: calc(var(--me-font-size, 22px) * 0.548);
2014
+ mask: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22100%25%22%20height%3D%22100%25%22%3E%3Csvg%20x%3D%220%22%20width%3D%2225%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%20400000%20548%22%20preserveAspectRatio%3D%22xMinYMin%20slice%22%3E%3Cpath%20d%3D%22M6%20548l-6-6v-35l6-11c56-104%20135.3-181.3%20238-232%2057.3-28.7%20117%20-45%20179-50h399577v120H403c-43.3%207-81%2015-113%2026-100.7%2033-179.7%2091-237%20174-2.7%20%205-6%209-10%2013-.7%201-7.3%201-20%201H6z%22%2F%3E%3C%2Fsvg%3E%3Csvg%20x%3D%2225%25%22%20width%3D%2250%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%20400000%20548%22%20preserveAspectRatio%3D%22xMidYMin%20slice%22%3E%3Cpath%20d%3D%22M200428%20334%20c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7%204-5.7%208.7-9%2014%20-53.3%2086.7-123.7%20153-211%20199-66.7%2036-137.3%2056.3-212%2062H0V214h199568c178.3-11.7%20%20311.7-78.3%20403-201%206-8%209.7-12%2011-12%20.7-.7%206.7-1%2018-1s17.3.3%2018%201c1.3%200%205%204%2011%20%2012%2044.7%2059.3%20101.3%20106.3%20170%20141s145.3%2054.3%20229%2060h199572v120z%22%2F%3E%3C%2Fsvg%3E%3Csvg%20x%3D%2275%25%22%20width%3D%2225%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%20400000%20548%22%20preserveAspectRatio%3D%22xMaxYMin%20slice%22%3E%3Cpath%20d%3D%22M400000%20542l%20-6%206h-17c-12.7%200-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5%20s-117.2-55.8-184.5-66.5c-.7%200-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6%201%20c124.7%208%20235%2061.7%20331%20161%2031.3%2033.3%2059.7%2072.7%2085%20118l7%2013v35z%22%2F%3E%3C%2Fsvg%3E%3C%2Fsvg%3E')
2015
+ center / 100% 100% no-repeat;
2016
+ }
2017
+ .me-overbrace > .me-slot:last-child {
2018
+ padding-top: calc(var(--me-font-size, 22px) * 0.598);
2019
+ }
2020
+ .me-underbrace > .me-slot:last-child {
2021
+ padding-bottom: calc(var(--me-font-size, 22px) * 0.598);
2022
+ }
2023
+ .me-overbrace > .me-slot:first-child {
2024
+ margin-bottom: calc(var(--me-font-size, 22px) * -0.2);
2025
+ }
2026
+ .me-underbrace > .me-slot:first-child {
2027
+ margin-top: calc(var(--me-font-size, 22px) * -0.2);
2028
+ }
2029
+ .me-root > .me-radical,
2030
+ .me-indexedRoot > .me-radical {
2031
+ width: calc(var(--me-font-size, 22px) * 0.85);
2032
+ }
2033
+ .me-indexedRoot > .me-slot:nth-last-child(2) {
2034
+ align-self: center;
2035
+ display: inline-flex;
2036
+ margin-right: calc(var(--me-font-size, 22px) * -0.6);
2037
+ margin-top: 0;
2038
+ transform: translate(
2039
+ calc(var(--me-font-size, 22px) * 0.35),
2040
+ calc(var(--me-font-size, 22px) * -0.3)
2041
+ );
2042
+ }
2043
+ .me-indexedRoot > .me-slot:nth-last-child(2) > .me-row {
2044
+ min-height: 0;
2045
+ }
2046
+ .me-matrix[data-structure='matrix'] > .me-matrix-grid {
2047
+ column-gap: calc(var(--me-font-size, 22px) * 0.8);
2048
+ }
2049
+
2050
+ /* TeX leaves a thin space after a large operator. Integral side limits also
2051
+ need its italic correction so their upper label clears the slanted tip. */
2052
+ .me-large-operator {
2053
+ gap: calc(var(--me-font-size, 22px) / 6);
2054
+ }
2055
+ .me-large-operator:is(
2056
+ [data-structure='integral'],
2057
+ [data-structure='doubleIntegral'],
2058
+ [data-structure='tripleIntegral'],
2059
+ [data-structure='contourIntegral']
2060
+ ):not([data-limit-placement='limits'])
2061
+ > .me-limits
2062
+ > .me-limit:first-child {
2063
+ margin-left: calc(var(--me-font-size, 22px) * 0.44445);
2064
+ }
2065
+ .me-large-operator:is(
2066
+ [data-structure='integral'],
2067
+ [data-structure='doubleIntegral'],
2068
+ [data-structure='tripleIntegral'],
2069
+ [data-structure='contourIntegral']
2070
+ )[data-limit-placement='limits']
2071
+ > .me-limits
2072
+ > .me-operator-glyph {
2073
+ padding-inline-end: calc(var(--me-font-size, 22px) * 0.44445);
2074
+ }
2075
+ .me-large-operator:is(
2076
+ [data-structure='integral'],
2077
+ [data-structure='doubleIntegral'],
2078
+ [data-structure='tripleIntegral'],
2079
+ [data-structure='contourIntegral']
2080
+ )[data-limit-placement='limits']
2081
+ > .me-limits
2082
+ > .me-limit:last-child {
2083
+ transform: translateX(calc(var(--me-font-size, 22px) * -0.22222));
2084
+ }
2085
+ /* The upright glyph's lower side limit no longer needs the negative offset
2086
+ used for the skewed text-font integral. */
2087
+ .me-large-operator:is(
2088
+ [data-structure='integral'],
2089
+ [data-structure='doubleIntegral'],
2090
+ [data-structure='tripleIntegral'],
2091
+ [data-structure='contourIntegral']
2092
+ ):not([data-limit-placement='limits'])
2093
+ > .me-limits
2094
+ > .me-limit:last-child {
2095
+ margin-left: 0;
2096
+ }
2097
+ /* A radical encloses math ink rather than the taller UI text line box.
2098
+ Tall nested structures continue to determine their own row height. */
2099
+ :is(.me-root, .me-indexedRoot) > .me-slot:last-child > .me-row {
2100
+ min-height: 0;
2101
+ }
2102
+ :is(.me-root, .me-indexedRoot)
2103
+ > .me-slot:last-child
2104
+ > .me-row
2105
+ > .me-run
2106
+ :is(.me-input, .me-measure, .me-preview-token) {
2107
+ line-height: 1;
2108
+ padding-block: 0;
2109
+ }
2110
+
2111
+ /* Inline math uses text-style operator glyphs and side limits by default.
2112
+ Explicit limits/nolimits remain authoritative. */
2113
+ @font-face {
2114
+ font-family: 'Barocss Small Operators';
2115
+ src: url('./fonts/KaTeX_Size1-Regular.woff2') format('woff2');
2116
+ font-style: normal;
2117
+ font-display: swap;
2118
+ }
2119
+ /* TeX stops reducing nested scripts at scriptscript size. */
2120
+ :is(.me-superscript, .me-subscript, .me-scripts)
2121
+ > .me-slot:not(:first-child)
2122
+ :is(.me-superscript, .me-subscript, .me-scripts)
2123
+ > .me-slot:not(:first-child)
2124
+ :is(.me-input, .me-measure, .me-preview-token) {
2125
+ font-size: calc(var(--me-font-size, 22px) * 0.5);
2126
+ line-height: 1.1;
2127
+ padding-block: 0;
2128
+ }
2129
+ :is(.me-superscript, .me-subscript, .me-scripts)
2130
+ > .me-slot:not(:first-child)
2131
+ :is(.me-superscript, .me-subscript, .me-scripts)
2132
+ > .me-slot:not(:first-child)
2133
+ > .me-row {
2134
+ min-height: 0;
2135
+ }
2136
+ :is(.me-superscript, .me-subscript, .me-scripts)
2137
+ > .me-slot:not(:first-child)
2138
+ :is(.me-root, .me-indexedRoot)
2139
+ > .me-radical {
2140
+ width: calc(var(--me-font-size, 22px) * 0.595);
2141
+ min-height: calc(var(--me-font-size, 22px) * 0.7);
2142
+ }
2143
+ .me-superscript > .me-slot:last-child:has(> .me-row > :is(.me-root, .me-indexedRoot)) {
2144
+ transform: translateY(-15%);
2145
+ }
2146
+
2147
+ /* Nested scripts need less lift after their line boxes shrink. */
2148
+ :is(.me-superscript, .me-subscript, .me-scripts)
2149
+ > .me-slot:not(:first-child)
2150
+ .me-superscript
2151
+ > .me-slot:last-child {
2152
+ transform: translateY(-0.1em);
2153
+ }
2154
+
2155
+ /* KaTeX glyph contours retain the short curve and tall end caps. The cap
2156
+ length is bounded; only the straight stem extends for very tall bodies. */
2157
+ .me-parentheses > .me-delimiter,
2158
+ :is(.me-openClosed, .me-closedOpen, .me-fenced) > :is([data-fence='('], [data-fence=')']) {
2159
+ mask: url('./shapes/parenthesis.svg') center / 61.44% var(--me-font-size, 22px) no-repeat;
2160
+ }
2161
+ .me-parentheses:has(> .me-slot .me-structure) > .me-delimiter,
2162
+ :is(.me-openClosed, .me-closedOpen, .me-fenced):has(> .me-slot .me-structure)
2163
+ > :is([data-fence='('], [data-fence=')']),
2164
+ .me-matrix[data-environment='pmatrix'] > .me-matrix-delimiter {
2165
+ --me-fence-cap: min(50%, calc(var(--me-font-size, 22px) * 1.809));
2166
+ mask: url('./shapes/parenthesis-top.svg') left top / 100% var(--me-fence-cap) no-repeat,
2167
+ url('./shapes/parenthesis-bottom.svg') left bottom / 100% var(--me-fence-cap) no-repeat,
2168
+ linear-gradient(currentColor, currentColor) left center / 22.826%
2169
+ calc(100% - var(--me-fence-cap) - var(--me-fence-cap) + 1px) no-repeat;
2170
+ }
2171
+
2172
+ /* The font contour has a tapered entry and thin rising stroke. Reusing it
2173
+ avoids the thick uniform diagonal produced by the old polygon. */
2174
+ :is(.me-root, .me-indexedRoot) > .me-radical {
2175
+ clip-path: none;
2176
+ mask: url('./shapes/radical.svg') center / 100% 100% no-repeat;
2177
+ }
2178
+
2179
+ /* A nested radical needs clearance above its own rule. Without this space,
2180
+ successive rules collapse together even when the operand metrics agree. */
2181
+ :is(.me-root, .me-indexedRoot)
2182
+ > .me-slot:last-child:has(> .me-row > :is(.me-root, .me-indexedRoot)) {
2183
+ padding-top: calc(var(--me-font-size, 22px) * 0.25);
2184
+ }
2185
+
2186
+ /* Resolve reduced operator styles from model slots. Display operators retain
2187
+ their existing geometry; text/script contexts use Size1 and side limits. */
2188
+ .me-editor [data-operator-style] {
2189
+ --me-operator-scale: 1;
2190
+ --me-bound-scale: 0.7;
2191
+ --me-operator-size: calc(var(--me-font-size, 22px) * var(--me-operator-scale));
2192
+ }
2193
+ .me-editor [data-operator-style='script'] {
2194
+ --me-operator-scale: 0.7;
2195
+ --me-bound-scale: 0.5;
2196
+ }
2197
+ .me-editor [data-operator-style='scriptscript'] {
2198
+ --me-operator-scale: 0.5;
2199
+ --me-bound-scale: 0.5;
2200
+ }
2201
+ .me-editor
2202
+ .me-large-operator[data-operator-style]:not([data-operator-style='display'])
2203
+ > .me-limits
2204
+ > .me-operator-glyph {
2205
+ font: normal var(--me-operator-size) / 1.1 'Barocss Small Operators', serif;
2206
+ height: calc(var(--me-operator-size) * 1.1);
2207
+ transform: none;
2208
+ }
2209
+ .me-editor
2210
+ :is(.me-large-operator, .me-limit-operator)[data-operator-style]:not(
2211
+ [data-operator-style='display']
2212
+ ) {
2213
+ gap: calc(var(--me-operator-size) / 6);
2214
+ }
2215
+ .me-editor .me-large-operator[data-operator-style][data-layout-limits='side'] > .me-limits {
2216
+ display: inline-grid;
2217
+ grid-template-columns: max-content max-content;
2218
+ grid-template-rows: auto auto;
2219
+ align-items: center;
2220
+ }
2221
+ .me-editor
2222
+ .me-large-operator[data-operator-style][data-layout-limits='side']
2223
+ > .me-limits
2224
+ > .me-operator-glyph {
2225
+ grid-column: 1;
2226
+ grid-row: 1 / 3;
2227
+ }
2228
+ .me-editor
2229
+ .me-large-operator[data-operator-style][data-layout-limits='side']
2230
+ > .me-limits
2231
+ > .me-limit:first-child {
2232
+ grid-column: 2;
2233
+ grid-row: 1;
2234
+ }
2235
+ .me-editor
2236
+ .me-large-operator[data-operator-style][data-layout-limits='side']
2237
+ > .me-limits
2238
+ > .me-limit:last-child {
2239
+ grid-column: 2;
2240
+ grid-row: 2;
2241
+ }
2242
+ .me-editor
2243
+ .me-large-operator[data-operator-style]:not([data-operator-style='display'])
2244
+ > .me-limits
2245
+ > .me-limit {
2246
+ top: 0;
2247
+ margin-left: 0;
2248
+ }
2249
+ .me-editor
2250
+ .me-large-operator[data-operator-style]:not([data-operator-style='display']):is(
2251
+ [data-structure='integral'],
2252
+ [data-structure='doubleIntegral'],
2253
+ [data-structure='tripleIntegral'],
2254
+ [data-structure='contourIntegral']
2255
+ )[data-layout-limits='side']
2256
+ > .me-limits
2257
+ > .me-limit:first-child {
2258
+ margin-left: calc(var(--me-operator-size) * 0.19445);
2259
+ top: calc(var(--me-operator-size) * -0.12);
2260
+ }
2261
+ .me-editor
2262
+ .me-large-operator[data-operator-style]:not([data-operator-style='display']):is(
2263
+ [data-structure='integral'],
2264
+ [data-structure='doubleIntegral'],
2265
+ [data-structure='tripleIntegral'],
2266
+ [data-structure='contourIntegral']
2267
+ )[data-layout-limits='side']
2268
+ > .me-limits
2269
+ > .me-limit:last-child {
2270
+ top: calc(var(--me-operator-size) * 0.08);
2271
+ }
2272
+ .me-editor
2273
+ .me-large-operator[data-operator-style]:not([data-operator-style='display']):is(
2274
+ [data-structure='integral'],
2275
+ [data-structure='doubleIntegral'],
2276
+ [data-structure='tripleIntegral'],
2277
+ [data-structure='contourIntegral']
2278
+ )[data-layout-limits='stacked']
2279
+ > .me-limits
2280
+ > .me-operator-glyph {
2281
+ padding-inline-end: calc(var(--me-operator-size) * 0.19445);
2282
+ }
2283
+ .me-editor
2284
+ .me-large-operator[data-operator-style]:not([data-operator-style='display']):is(
2285
+ [data-structure='integral'],
2286
+ [data-structure='doubleIntegral'],
2287
+ [data-structure='tripleIntegral'],
2288
+ [data-structure='contourIntegral']
2289
+ )[data-layout-limits='stacked']
2290
+ > .me-limits
2291
+ > .me-limit:last-child {
2292
+ transform: translateX(calc(var(--me-operator-size) * -0.097225));
2293
+ }
2294
+ .me-editor
2295
+ .me-limit-operator[data-operator-style]:not([data-operator-style='display'])
2296
+ > .me-limits
2297
+ > .me-limit-glyph {
2298
+ font-size: var(--me-operator-size);
2299
+ }
2300
+ .me-editor .me-limit-operator[data-operator-style][data-layout-limits='side'] > .me-limits {
2301
+ flex-direction: row;
2302
+ align-items: center;
2303
+ gap: 0;
2304
+ }
2305
+ .me-editor
2306
+ .me-limit-operator[data-operator-style][data-layout-limits='side']
2307
+ > .me-limits
2308
+ > .me-limit {
2309
+ transform: translateY(calc(var(--me-operator-size) * 0.18));
2310
+ }
2311
+ /* Row styles distinguish a nested operator body from its own smaller bounds.
2312
+ Do not apply an ancestor bound's size to every descendant text token. */
2313
+ .me-editor [data-operator-style]:not([data-operator-style='display']) .me-row[data-layout-style] {
2314
+ min-height: 0;
2315
+ }
2316
+ .me-editor
2317
+ [data-operator-style]:not([data-operator-style='display'])
2318
+ .me-row[data-layout-style]
2319
+ > .me-run
2320
+ :is(.me-input, .me-measure, .me-preview-token) {
2321
+ font-size: var(--me-font-size, 22px);
2322
+ line-height: 1.1;
2323
+ padding-block: 0;
2324
+ }
2325
+ .me-editor
2326
+ [data-operator-style]:not([data-operator-style='display'])
2327
+ .me-row[data-layout-style='script']
2328
+ > .me-run
2329
+ :is(.me-input, .me-measure, .me-preview-token) {
2330
+ font-size: calc(var(--me-font-size, 22px) * 0.7);
2331
+ }
2332
+ .me-editor
2333
+ [data-operator-style]:not([data-operator-style='display'])
2334
+ .me-row[data-layout-style='scriptscript']
2335
+ > .me-run
2336
+ :is(.me-input, .me-measure, .me-preview-token) {
2337
+ font-size: calc(var(--me-font-size, 22px) * 0.5);
2338
+ }
2339
+
2340
+ /* Glyph width and mathematical spacing are separate from the caret hit area.
2341
+ Binary/relation/punctuation gaps disappear in script styles. Empty slots
2342
+ retain their existing minimum width; only model boundaries shrink. */
2343
+ .me-row {
2344
+ --me-spacing-unit: calc(var(--me-font-size, 22px) / 18);
2345
+ }
2346
+ .me-row[data-layout-style='script'],
2347
+ .me-row[data-layout-style='scriptscript'] {
2348
+ --me-spacing-unit: 0px;
2349
+ }
2350
+ .me-row > :is(.me-run, .me-operatorName, .me-fraction)[data-math-spacing='true'] {
2351
+ margin-left: calc(var(--me-space-before, 0) * var(--me-spacing-unit));
2352
+ margin-right: calc(var(--me-space-after, 0) * var(--me-spacing-unit));
2353
+ }
2354
+ .me-run[data-math-spacing='true']:not(.me-empty) > .me-measure {
2355
+ padding-inline: 0;
2356
+ min-width: 0;
2357
+ }
2358
+ .me-row > .me-empty-boundary:not(:focus-within) > .me-measure {
2359
+ min-width: 1px;
2360
+ width: 1px;
2361
+ padding-inline: 0;
2362
+ }
2363
+
2364
+ /* Function names contribute glyph width only. The row sets their thin spacing,
2365
+ including the suppressed gap before an opening parenthesis. */
2366
+ .me-operatorName > .me-slot > .me-row > .me-run:not(.me-empty) > .me-measure {
2367
+ min-width: 0;
2368
+ padding-inline: 0;
2369
+ }
2370
+ .me-row[data-layout-style='script'] {
2371
+ --me-tight-unit: calc(var(--me-font-size, 22px) * 0.7 / 18);
2372
+ }
2373
+ .me-row[data-layout-style='scriptscript'] {
2374
+ --me-tight-unit: calc(var(--me-font-size, 22px) * 0.5 / 18);
2375
+ }
2376
+ .me-row:is([data-layout-style='script'], [data-layout-style='scriptscript'])
2377
+ > [data-math-spacing='true'] {
2378
+ margin-left: calc(var(--me-tight-before, 0) * var(--me-tight-unit));
2379
+ margin-right: calc(var(--me-tight-after, 0) * var(--me-tight-unit));
2380
+ }