Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/mdbook-html/front-end/css/chrome.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
/* CSS for UI elements (a.k.a. chrome) */

.skip-to-content {
position: absolute;
top: -100px;
left: 0;
padding: 0.5rem 1rem;
background-color: var(--bg);
color: var(--fg);
z-index: 1000;
text-decoration: none;
border: 2px solid var(--links);
}

.skip-to-content:focus {
top: 0;
}

html {
scrollbar-color: var(--scrollbar) transparent;
}
Expand Down
7 changes: 4 additions & 3 deletions crates/mdbook-html/front-end/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<script src="{{ resource "toc.js" }}"></script>
</head>
<body>
<a class="skip-to-content" href="#mdbook-content">Skip to main content</a>
<div id="mdbook-help-container">
<div id="mdbook-help-popup">
<h2 class="mdbook-help-title">Keyboard shortcuts</h2>
Expand Down Expand Up @@ -143,9 +144,9 @@
<div id="mdbook-menu-bar-hover-placeholder"></div>
<div id="mdbook-menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="mdbook-sidebar-toggle" class="icon-button" for="mdbook-sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="mdbook-sidebar">
<button id="mdbook-sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="mdbook-sidebar">
{{fa "solid" "bars"}}
</label>
</button>
<button id="mdbook-theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="mdbook-theme-list">
{{fa "solid" "paintbrush"}}
</button>
Expand Down Expand Up @@ -213,7 +214,7 @@
});
</script>

<div id="mdbook-content" class="content">
<div id="mdbook-content" class="content" tabindex="-1">
<main>
{{{ content }}}
</main>
Expand Down
Loading