Skip to content

Commit c693d1b

Browse files
authored
Merge pull request #1295 from mathjax/update/explorer-keys
Add explorer key actions and improve auto-voice handling
2 parents e7ee4e0 + a16ca58 commit c693d1b

File tree

8 files changed

+508
-79
lines changed

8 files changed

+508
-79
lines changed

ts/a11y/complexity/collapse.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export class Collapse {
195195
(node, complexity) => {
196196
complexity = this.uncollapseChild(complexity, node, 0);
197197
if (complexity > (this.cutoff.sqrt as number)) {
198+
node.setProperty('collapse-variant', true);
198199
complexity = this.recordCollapse(
199200
node,
200201
complexity,
@@ -209,6 +210,7 @@ export class Collapse {
209210
(node, complexity) => {
210211
complexity = this.uncollapseChild(complexity, node, 0, 2);
211212
if (complexity > (this.cutoff.sqrt as number)) {
213+
node.setProperty('collapse-variant', true);
212214
complexity = this.recordCollapse(
213215
node,
214216
complexity,
@@ -582,6 +584,9 @@ export class Collapse {
582584
const factory = this.complexity.factory;
583585
const marker = node.getProperty('collapse-marker') as string;
584586
const parent = node.parent;
587+
const variant = node.getProperty('collapse-variant')
588+
? { mathvariant: '-tex-variant' }
589+
: {};
585590
const maction = factory.create(
586591
'maction',
587592
{
@@ -594,7 +599,7 @@ export class Collapse {
594599
),
595600
},
596601
[
597-
factory.create('mtext', { mathcolor: 'blue' }, [
602+
factory.create('mtext', { mathcolor: 'blue', ...variant }, [
598603
(factory.create('text') as TextNode).setText(marker),
599604
]),
600605
]

ts/a11y/explorer.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,32 @@ export function ExplorerMathDocumentMixin<
463463
'mjx-help-dialog > input': {
464464
margin: '.5em 2em',
465465
},
466+
'mjx-help-dialog kbd': {
467+
display: 'inline-block',
468+
padding: '3px 5px',
469+
'font-size': '11px',
470+
'line-height': '10px',
471+
color: '#444d56',
472+
'vertical-align': 'middle',
473+
'background-color': '#fafbfc',
474+
border: 'solid 1.5px #c6cbd1',
475+
'border-bottom-color': '#959da5',
476+
'border-radius': '3px',
477+
'box-shadow': 'inset -.5px -1px 0 #959da5',
478+
},
479+
'mjx-help-dialog ul': {
480+
'list-style-type': 'none',
481+
},
482+
'mjx-help-dialog li': {
483+
'margin-bottom': '.5em',
484+
},
485+
'mjx-help-background': {
486+
position: 'fixed',
487+
top: 0,
488+
left: 0,
489+
right: 0,
490+
bottom: 0,
491+
},
466492
};
467493

468494
/**

0 commit comments

Comments
 (0)