Skip to content

Commit

Permalink
Fix "On this page" block on "Classes" article (#2940)
Browse files Browse the repository at this point in the history
  • Loading branch information
kharitonovVlad authored Sep 11, 2023
1 parent 5329034 commit 6db303a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/typescriptlang-org/src/templates/documentation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,9 @@
-webkit-animation: 0.1s ease forwards;
animation: 0.1s ease forwards;
}
}
}

.handbook-on-this-page-section-list {
overflow: auto;
max-height: 80vh;
}
5 changes: 2 additions & 3 deletions packages/typescriptlang-org/src/templates/documentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const HandbookTemplate: React.FC<Props> = (props) => {
const sidebarHeaders = post.headings?.filter(h => (h?.depth || 0) <= 3) || []
const showSidebar = !post.frontmatter.disable_toc
const showExperimental = post.frontmatter.experimental
const showSidebarHeadings = post.headings && sidebarHeaders.length <= 30
const navigation = getDocumentationNavForLanguage(props.pageContext.lang)
const isHandbook = post.frontmatter.handbook
const prefix = isHandbook ? "Handbook" : "Documentation"
Expand Down Expand Up @@ -161,9 +160,9 @@ const HandbookTemplate: React.FC<Props> = (props) => {
{showSidebar &&
<aside className="handbook-toc">
<nav className={deprecationURL ? "deprecated" : ""}>
{showSidebarHeadings && <>
{<>
<h5>{i("handb_on_this_page")}</h5>
<ul>
<ul className="handbook-on-this-page-section-list">
{
sidebarHeaders.map(heading => {
const id = slug.slug(heading!.value, false)
Expand Down

0 comments on commit 6db303a

Please sign in to comment.