Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the outline when clicking on math formulas #1423

Closed
photino opened this issue Mar 25, 2016 · 5 comments
Closed

Remove the outline when clicking on math formulas #1423

photino opened this issue Mar 25, 2016 · 5 comments
Labels
Expected Behavior This is how MathJax works

Comments

@photino
Copy link

photino commented Mar 25, 2016

I have updated my project to MathJax 2.6. But when I click on math formulas, there are solid outlines around them (see the snapshot on Chrome):

integral

On Firefox, the outlines are dotted lines. I would like to know how to remove these unnecessary styles. Thanks!

@photino photino changed the title Remove the outline when clicking math formulas Remove the outline when clicking on math formulas Mar 25, 2016
@dpvc
Copy link
Member

dpvc commented Mar 25, 2016

The styles are necessary. Version 2.6 added support for users using assistive technology, and that included making the MathJax menu accessible to keyboard users and those with screen readers. In order for that to work, the math expressions need to be able to accept the browser focus (so that keystrokes will be targeted to them, so the menu can be opened). The outlines you are seeing are the focus highlighting that is the default styling for focused items in the browser (that differs between browsers). Without that, keyboard users will not be able to know when and which math expressions are selected for keyboard focus. Removing that would make it harder (or impossible) for those users to properly interact with MathJax and its menus. While you certainly could add CSS to your page to remove the outlines, it would be a mistake to do so, unless you have no concern for those users who require assistive technology to support their reading of your pages. You should note that all focusable elements will get these outlines (buttons, menus, input areas, etc.) when you click on them. It is part of the standard interface for focusable items.

@dpvc dpvc added the Expected Behavior This is how MathJax works label Mar 25, 2016
@photino
Copy link
Author

photino commented Mar 25, 2016

@dpvc Thanks for your explanation. It seems that this is a new feature of version 2.6. I remember there are no outlines in version 2.5.

@dpvc
Copy link
Member

dpvc commented Mar 25, 2016

Yes, as I mentioned above, this was added in 2.6.

@pkra pkra closed this as completed Apr 15, 2016
@mumulinw
Copy link

mumulinw commented Jan 4, 2018

You can add the following style to Remove the outline when clicking on math formulas
.mjx-chtml[tabindex]:focus, body :focus .mjx-chtml[tabindex] {
display: inline-table;
outline: none!important;
}

@pkra
Copy link
Contributor

pkra commented Jan 4, 2018

No. Removing the outline from a focusable element is bad practice; in particular, it fails WCAG requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expected Behavior This is how MathJax works
Projects
None yet
Development

No branches or pull requests

4 participants