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

refactor(v2): clean-ups and fixes #4244

Merged
merged 1 commit into from
Feb 18, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@

.sidebarItem {
list-style-type: none;
margin-top: 0.8rem;
margin-bottom: 0.8rem;
margin: 0.8rem 0;
}

.sidebarItemLink {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

.tableOfContents {
display: inherit;
max-height: calc(100vh - (var(--ifm-navbar-height) + 2rem));
overflow-y: auto;
position: sticky;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import type {TOCProps} from '@theme/TOC';
import styles from './styles.module.css';
import {TOCItem} from '@docusaurus/types';

const LINK_CLASS_NAME = styles['table-of-contents__link--inline'];

/* eslint-disable jsx-a11y/control-has-associated-label */
function HeadingsInline({
toc,
Expand All @@ -30,7 +28,6 @@ function HeadingsInline({
<li key={heading.id}>
<a
href={`#${heading.id}`}
className={LINK_CLASS_NAME}
// Developer provided the HTML, so assume it's safe.
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{__html: heading.value}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
}

:global(.react-toggle--focus .react-toggle-thumb),
:global(.react-toggle-thumb:hover) {
:global(.react-toggle:hover .react-toggle-thumb) {
box-shadow: 0px 0px 2px 3px var(--ifm-color-primary);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const useHideableNavbar = (hideOnScroll: boolean): useHideableNavbarReturns => {
}

if (scrollTop < navbarHeight) {
setIsNavbarVisible(true);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import {useEffect, useState} from 'react';

import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
import type {WindowSize} from '@theme/hooks/useWindowSize';

const desktopThresholdWidth = 996;
Expand All @@ -17,7 +18,7 @@ const windowSizes = {
} as const;

function useWindowSize(): WindowSize | undefined {
const isClient = typeof window !== 'undefined';
const isClient = ExecutionEnvironment.canUseDOM;

function getSize() {
if (!isClient) {
Expand Down