mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-31 21:36:26 +00:00
7c54965b11
Closes https://github.com/zed-industries/zed/issues/17911 This PR enables dark mode on the documentation. This is done without any special plugins, just pure JavaScript and CSS variables. I may open fast-follow PRs to fine-tune design and code details that haven't been super polished yet. For example, when switching to dark mode, the `class` attribute on the `html` tag would change immediately, whereas other attributes such as `data-theme` and `data-color-scheme` would require a full refresh. This seems to be resolved, but not 100% confident yet. --- Release Notes: - Enabled dark mode on the documentation
79 lines
1.7 KiB
CSS
79 lines
1.7 KiB
CSS
@media only screen and (max-width: 1674px) {
|
|
.sidetoc {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
@media only screen and (min-width: 1675px) {
|
|
main {
|
|
position: relative;
|
|
}
|
|
.sidetoc {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
left: calc(100% + (var(--content-max-width)) / 3 - 160px);
|
|
position: absolute;
|
|
}
|
|
.pagetoc {
|
|
position: fixed;
|
|
top: 64px;
|
|
width: 220px;
|
|
height: calc(100vh - var(--menu-bar-height) - 0.67em * 4);
|
|
padding-top: 80px;
|
|
margin-right: 16px;
|
|
padding-bottom: 40px;
|
|
overflow: auto;
|
|
}
|
|
.pagetoc > :last-child {
|
|
margin-bottom: 64px;
|
|
}
|
|
.pagetoc a {
|
|
width: fit-content;
|
|
font-size: 1.4rem;
|
|
border-left: 1px solid var(--sidebar-bg);
|
|
color: var(--fg) !important;
|
|
display: block;
|
|
padding: 2px;
|
|
margin: 8px 0 8px 12px;
|
|
text-align: left;
|
|
text-decoration: underline;
|
|
text-decoration-color: hsl(0, 0%, 0%, 0.1);
|
|
}
|
|
.pagetoc a:hover {
|
|
text-decoration-color: hsl(0, 0%, 0%, 0.5);
|
|
}
|
|
.pagetoc a.active {
|
|
background-color: var(--sidebar-active-bg);
|
|
color: var(--sidebar-active) !important;
|
|
text-decoration-color: hsl(219, 93%, 42%, 0.1);
|
|
}
|
|
.pagetoc a.active:hover {
|
|
text-decoration-color: hsl(219, 93%, 42%, 0.8);
|
|
}
|
|
.pagetoc .active {
|
|
background: var(--sidebar-bg);
|
|
color: var(--sidebar-fg);
|
|
}
|
|
.pagetoc .pagetoc-H1 {
|
|
display: none;
|
|
}
|
|
.pagetoc .pagetoc-H3 {
|
|
margin-left: 24px;
|
|
}
|
|
.pagetoc .pagetoc-H4 {
|
|
margin-left: 42px;
|
|
}
|
|
.pagetoc .pagetoc-H5 {
|
|
display: none;
|
|
}
|
|
.pagetoc .pagetoc-H6 {
|
|
display: none;
|
|
}
|
|
.toc-title {
|
|
margin: 0;
|
|
margin-bottom: 12px;
|
|
padding-left: 12px;
|
|
font-size: 1.4rem;
|
|
color: var(--full-contrast);
|
|
}
|
|
}
|