From 36f1ca59e9f51efe5b380a2430b9a42e0e47fab3 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 10 Sep 2025 12:42:04 -0400 Subject: [PATCH 1/3] Change CSS for help icon so that when scroll or truncate is used, it is not clipped. (mathjax/MathJax#3432) --- ts/a11y/explorer.ts | 6 +++--- ts/output/common.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ts/a11y/explorer.ts b/ts/a11y/explorer.ts index 7964807c0..3fe4ae6e1 100644 --- a/ts/a11y/explorer.ts +++ b/ts/a11y/explorer.ts @@ -380,9 +380,9 @@ export function ExplorerMathDocumentMixin< }, 'mjx-container > mjx-help': { display: 'none', - position: 'absolute', - top: '-.33em', - right: '-.5em', + position: 'sticky', + inset: '-100% 0 100% 0', + margin: '-.3em -.5em 0 -.1em', width: '.6em', height: '.6em', cursor: 'pointer', diff --git a/ts/output/common.ts b/ts/output/common.ts index 23e04e865..5f2abbf7e 100644 --- a/ts/output/common.ts +++ b/ts/output/common.ts @@ -167,8 +167,8 @@ export abstract class CommonOutputJax< display: 'block', 'text-align': 'center', 'justify-content': 'center', - margin: 'calc(1em - 2px) 0', - padding: '2px 0', + marign: '.7em 0', + padding: '.3em 2px', }, 'mjx-container[display][width="full"]': { display: 'flex', From aa73c479029eff0912a4d65b30f601d8cd8a8712 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 10 Sep 2025 13:42:09 -0400 Subject: [PATCH 2/3] Fix spelling error and adjust scaling to accommodate new padding needed for the explorer highlighting. --- ts/output/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/output/common.ts b/ts/output/common.ts index 5f2abbf7e..f8b4608b6 100644 --- a/ts/output/common.ts +++ b/ts/output/common.ts @@ -167,7 +167,7 @@ export abstract class CommonOutputJax< display: 'block', 'text-align': 'center', 'justify-content': 'center', - marign: '.7em 0', + margin: '.7em 0', padding: '.3em 2px', }, 'mjx-container[display][width="full"]': { @@ -374,7 +374,7 @@ export abstract class CommonOutputJax< this.math.display ) { const w = wrapper.getOuterBBox().w; - const W = this.math.metrics.containerWidth / this.pxPerEm; + const W = Math.max(0, this.math.metrics.containerWidth - 4) / this.pxPerEm; if (w > W && w) { scale *= W / w; } From 654924f967aef3070465f0a33be5e26f31316745 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Thu, 11 Sep 2025 09:29:33 -0400 Subject: [PATCH 3/3] Fix formatting for prettier --- ts/output/common.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/output/common.ts b/ts/output/common.ts index f8b4608b6..4f6ce8377 100644 --- a/ts/output/common.ts +++ b/ts/output/common.ts @@ -374,7 +374,8 @@ export abstract class CommonOutputJax< this.math.display ) { const w = wrapper.getOuterBBox().w; - const W = Math.max(0, this.math.metrics.containerWidth - 4) / this.pxPerEm; + const W = + Math.max(0, this.math.metrics.containerWidth - 4) / this.pxPerEm; if (w > W && w) { scale *= W / w; }