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

chore: reduce cumulative layout shifts #15926

Closed
wants to merge 8 commits into from
Closed
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
4 changes: 2 additions & 2 deletions docs/src/_includes/components/docs-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</li>
{%- endmacro %}

<nav class="docs-index" id="docs-index">
<button class="docs-index-toggle" aria-label="Index" id="js-docs-index-toggle" hidden>
mdjermanovic marked this conversation as resolved.
Show resolved Hide resolved
<nav class="docs-index" id="docs-index" >
<button class="docs-index-toggle" aria-label="Index" id="js-docs-index-toggle">
Index
<svg width="20" height="20" viewBox="20 20 60 60">
<path id="ham-top" d="M30,37 L70,37 Z" stroke="currentColor"></path>
Expand Down
3 changes: 2 additions & 1 deletion docs/src/_includes/components/nav-version-switcher.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div class="version-switcher">

<a href="/versions/" class="switcher-fallback">Versions</a>

<div hidden role="region" class="switcher switcher--version" aria-labelledby="nav-version-switcher-label" id="nav-version-switcher">
<div role="region" class="switcher switcher--version" aria-labelledby="nav-version-switcher-label" id="nav-version-switcher">
amareshsm marked this conversation as resolved.
Show resolved Hide resolved
<span id="nav-version-switcher-label" hidden>Language Switcher</span>
<div class="infobox visually-hidden" id="nav-version-infobox">
Selecting a language will take you to the ESLint Web site in that language.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/_includes/components/navigation.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<nav class="docs-site-nav" aria-label="Main">
<div class="flexer">
<a href="https://eslint.org/donate" class="c-btn c-btn--primary donate-link">Donate</a>
<button class="docs-site-nav-toggle" aria-label="Menu" id="nav-toggle" hidden>
<button class="docs-site-nav-toggle" aria-label="Menu" id="nav-toggle">
<svg width="20" height="20" viewBox="20 20 60 60">
<path id="ham-top" d="M30,37 L70,37 Z" stroke="currentColor"></path>
<path id="ham-middle" d="M30,50 L70,50 Z" stroke="currentColor"></path>
Expand Down
12 changes: 7 additions & 5 deletions docs/src/_includes/components/version-switcher.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<div class="version-switcher">

<a href="/versions/" class="switcher-fallback">Versions</a>

<div hidden role="region" class="switcher switcher--version" aria-labelledby="version-switcher-label" id="version-switcher">
<div role="region" class="switcher switcher--version" aria-labelledby="version-switcher-label"
id="version-switcher">
<span id="version-switcher-label" hidden>Version Switcher</span>
<div class="infobox visually-hidden" id="version-infobox">
Selecting a version will take you to the ESLint Web site for that version.
Expand All @@ -10,16 +12,16 @@
<label class="switcher__label label--block" for="version-select">
Version
</label>
<select name="version selector" id="version-select" aria-describedby="version-infobox" class="c-custom-select switcher__select auto-switcher">
<select name="version selector" id="version-select" aria-describedby="version-infobox"
class="c-custom-select switcher__select auto-switcher">
<option value="{{ eslintVersion }}" selected>
v{{ eslintVersion }}
</option>
{% for version in versions.items %}
<option value="{{ version.number }}"
data-url="{{ version.url }}">
<option value="{{ version.number }}" data-url="{{ version.url }}">
v{{ version.number }}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
20 changes: 18 additions & 2 deletions docs/src/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,29 @@
<meta name="twitter:image" content="{{ cover }}">
<meta name="twitter:creator" content="@geteslint">


<script type="module">
<script>
// This is a capable browser, let's improve the UI further!
document.documentElement.classList.add("enhanced");
document.documentElement.classList.remove('no-js');
</script>

<style>
.enhanced .switcher-fallback {
display: none !important
}
.no-js #js-docs-index-toggle, .no-js #nav-toggle, .no-js #version-switcher, .no-js #nav-version-switcher {
display: none;
}
.no-js #js-docs-index-list {
display: block !important
}
@media all and (max-width: 1023px) {
.no-js #nav-panel {
display: block !important;
}
}
</style>

<link rel="preload" href="{{ '/assets/fonts/SpaceGrotesk-Medium-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ '/assets/fonts/Inter-Regular-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ '/assets/fonts/SpaceMono-Regular-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
Expand Down
209 changes: 133 additions & 76 deletions docs/src/assets/css/components/docs-navigation.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading