-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Table of Contents to preferences
- Implement tocbot library for generating table of contents - Modify general.js to initialize and handle table of contents generation - Update preferences-general.xhtml to include tocbot styles and scripts - Add placeholder for table of contents in the preferences UI - Implement smooth scrolling and highlighting for table of contents items - Adjust styling for table of contents to match preferences design
- Loading branch information
Showing
5 changed files
with
1,306 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
waterfox/browser/components/preferences/content/tocbot.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.toc{overflow-y:auto}.toc>.toc-list{overflow:hidden;position:relative}.toc>.toc-list li{list-style:none}.toc-list{margin:0;padding-left:10px}a.toc-link{color:currentColor;height:100%}.is-collapsible{max-height:1000px;overflow:hidden;transition:all 300ms ease-in-out}.is-collapsed{max-height:0}.is-position-fixed{position:fixed !important;top:0}.is-active-link{font-weight:700}.toc-link::before{background-color:#eee;content:" ";display:inline-block;height:inherit;left:0;margin-top:-1px;position:absolute;width:2px}.is-active-link::before{background-color:#54bc4b}/*# sourceMappingURL=tocbot.css.map */ | ||
|
||
/* Patched version */ | ||
.toc { | ||
--uc-toc-margin: 0.5em; | ||
display: block; | ||
position: fixed; | ||
width: 300px; | ||
height: calc(100vh - 90px); /* .main-content inline style scroll-padding-top: 90px; */ | ||
transform: translateX(calc(var(--main-pane-width, 664px) + max(60px, 8vw))); | ||
scrollbar-width: none; | ||
} | ||
@media (max-width: 1280px) { | ||
.toc { | ||
display: none; | ||
} | ||
} | ||
.toc-list > .toc-list-item:only-child:not(:has(.toc-list)) { | ||
/* If only one exists, remove it. */ | ||
display: none; | ||
} | ||
|
||
.toc-list-item { | ||
cursor: pointer; | ||
} | ||
.toc-list-item > .toc-list:not(.is-collapsed) { | ||
margin-top: var(--uc-toc-margin); | ||
} | ||
.toc-list-item:not(:last-child) { | ||
margin-bottom: var(--uc-toc-margin); | ||
} | ||
|
||
.toc-link { | ||
font-size: 1.14em; /* as h2 */ | ||
text-decoration: none; | ||
} | ||
.toc-link::before { | ||
background-color: #eeeeef; | ||
} | ||
.is-active-link::before{ | ||
background-color: var(--in-content-accent-color, AccentColor); | ||
} | ||
|
||
.toc-list-item:hover:not(:has(> .toc-list:hover)) > .toc-link { | ||
font-weight: 700; | ||
} | ||
.toc-list-item:hover:not(:has(> .toc-list:hover)) > .toc-link:not(.is-active-link)::before { | ||
background-color: #d1d1d6; | ||
} | ||
@media (prefers-color-scheme: dark) { | ||
.toc-link:not(.is-active-link)::before { | ||
background-color: #2c2b32; | ||
} | ||
.toc-list-item:hover:not(:has(> .toc-list:hover)) > .toc-link:not(.is-active-link)::before { | ||
background-color: #57575d; | ||
} | ||
} |
Oops, something went wrong.