Skip to content

Commit 068e587

Browse files
authored
Merge pull request #1092 from isaacphysics/hotfix/latex-dropdown-improvements
Fix dropdowns being clipped around latex
2 parents 98cbab5 + 21e2797 commit 068e587

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/scss/common/questions.scss

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ISAAC
22

33
$cloze-dropdown-height: 300px;
4-
$cloze-scrollbar-height: 0px;
4+
$cloze-scrollbar-height: 4px;
55

66
.question-panel, .question-panel > .examboard-special-tabs {
77
> .content-chunk > .content-value {
@@ -379,38 +379,28 @@ $cloze-scrollbar-height: 0px;
379379
white-space: nowrap !important;
380380
padding-top: 0.25rem !important;
381381
padding-bottom: 0.25rem !important;
382-
display: inline-flex;
382+
display: inline-table;
383383
}
384384

385385
// cloze dropdowns inside katex are normally cut off due to content-driven overflows we cannot control easily. this:
386386
// a) enforces that dropdowns are provided $cloze-dropdown-height of space (maximum height before scrolling);
387387
// b) sets the correct overflow behaviour for the parent of the katex containing the dropdown;
388388
// c) if webkit exists, recreates the scrollbar to forcibly display it on OSX.
389389

390-
p:has(> .katex.katex .cloze-dropdown.show) {
391-
padding-bottom: calc(1rem + $cloze-dropdown-height + $cloze-scrollbar-height) !important;
392-
margin-bottom: -$cloze-dropdown-height !important;
393-
overflow-x: hidden !important;
394-
}
395-
396-
.katex-display:has(.cloze-dropdown.show) {
397-
padding-bottom: calc(0.25rem + $cloze-dropdown-height + $cloze-scrollbar-height) !important;
390+
p > .katex:has(.cloze-dropdown.show), .katex-display:has(.cloze-dropdown.show) {
391+
padding-bottom: calc(0.25rem + $cloze-dropdown-height) !important;
398392
margin-bottom: -$cloze-dropdown-height !important;
399393
overflow-x: hidden !important;
400394
}
401395

402-
p:has(> .katex.katex), .katex-display {
396+
p > .katex, .katex-display {
403397
overflow: auto hidden;
404398

405399
.katex .vlist-t2 {
406400
margin-right: 0 !important;
407401
}
408402

409403
&::-webkit-scrollbar {
410-
// if the webkit scrollbar exists we can customise it;
411-
// so enable the offset to include our scrollbar padding in calculations
412-
$cloze-scrollbar-height: 4px !important;
413-
414404
-webkit-appearance: none;
415405
height: $cloze-scrollbar-height;
416406
}

0 commit comments

Comments
 (0)