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

Fix a few accessibility violations #2547

Merged
merged 3 commits into from
Jan 16, 2025
Merged

Fix a few accessibility violations #2547

merged 3 commits into from
Jan 16, 2025

Conversation

henrif75
Copy link
Collaborator

  • Add chrome.css and general.css to override default css file. This is necessary to fix links without underline (hyperlinks relying only on color).
  • Fix pop-out button without id and wrong ARIA-ROLE
  • Speaker's notes now at correct heading sequence (H3)

henrif75 and others added 3 commits January 10, 2025 19:25
- Speaker's notes now at correct heading sequence
- Add chrome.css and general.css to override default css file. This is necessary to fix links without underline violation (hyperlinks relying only on color)
@henrif75 henrif75 marked this pull request as ready for review January 14, 2025 02:10
@henrif75 henrif75 requested review from mgeisler and djmitche January 14, 2025 02:10
Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was surprised to find that general.css and chrome.css are already referenced in index.hbs.

@@ -0,0 +1,279 @@
/* Base styles and content styles */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's strange that we've been missing it all along 😄

My understanding is that mdbook build will pull in theme files from https://github.com/rust-lang/mdBook/tree/master/src/theme/css, unless the local theme has a file with the same name.

But perhaps I've misunderstood this all along?

@@ -289,7 +289,6 @@

<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgeisler
Copy link
Collaborator

Thanks so much for looking at this, Henri!

@mgeisler
Copy link
Collaborator

I was surprised to find that general.css and chrome.css are already referenced in index.hbs.

I thought missing files were pulled in automatically from the basic theme. Loading the page with the inspector open shows

image

So I think the files were copied correctly already.

@henrif75 henrif75 merged commit f95c28f into google:main Jan 16, 2025
35 checks passed
@henrif75
Copy link
Collaborator Author

I was surprised to find that general.css and chrome.css are already referenced in index.hbs.

I thought missing files were pulled in automatically from the basic theme. Loading the page with the inspector open shows

image

So I think the files were copied correctly already.

FWIW, if any of the CSS files (e.g., general.css , chrome.css) is not available at the source when mdbook runs, it will use the default files and copy them to the target folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants