Skip to content

Commit

Permalink
Toc component: style improvements
Browse files Browse the repository at this point in the history
Improve the styles for the newly added Toc component, which adds a sticky table
of contents:

- Restore a background color for the table.

- With that background color, the table shouldn't take up the entire width of
the page, so remove the 100% width.

- Specify `z-index: 1;` for the wrapping div so that reference tooltips from
the Cite extension are not shown through the table of contents.

- Restore the ability to toggle the visibility of the table of contents.

WE-279
  • Loading branch information
DanielWTQ committed Nov 28, 2023
1 parent 1e091b9 commit b132b2c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions resources/styles/Components/Toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.chameleon-toc-wrapper {
position: sticky;
top: 0;
z-index: 1;

max-height: 100vh;
overflow: auto;
Expand All @@ -35,9 +36,7 @@

.toc {
border: unset;
background-color: unset;
font-size: unset;
width: 100%;

ul {
display: flex;
Expand All @@ -48,6 +47,13 @@
ul ul {
margin-left: 1rem;
}

// Add back the show-hide toggling, the `display: flex` styles above
// are more specific than core's `.toctogglecheckbox:checked ~ ul`
// but this will be even more specific
.toctogglecheckbox:checked ~ ul {
display: none;
}
}

.tocnumber {
Expand Down

0 comments on commit b132b2c

Please sign in to comment.