about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/pagetoc.css
blob: fa709194f37553669ddbde54e589cc9d8271e2bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* Inspired by https://github.com/JorelAli/mdBook-pagetoc/tree/98ee241 (under WTFPL) */

:root {
    --toc-width: 270px;
    --center-content-toc-shift: calc(-1 * var(--toc-width) / 2);
}

.nav-chapters {
    /* adjust width of buttons that bring to the previous or the next page */
    min-width: 50px;
}

@media only screen {
    @media (max-width: 1179px) {
        .sidebar-hidden #sidetoc {
            display: none;
        }
    }

    @media (max-width: 1439px) {
        .sidebar-visible #sidetoc {
            display: none;
        }
    }

    @media (1180px <= width <= 1439px) {
        .sidebar-hidden main {
            position: relative;
            left: var(--center-content-toc-shift);
        }
    }

    @media (1440px <= width <= 1700px) {
        .sidebar-visible main {
            position: relative;
            left: var(--center-content-toc-shift);
        }
    }

    #sidetoc {
        margin-left: calc(100% + 20px);
    }
    #pagetoc {
        position: fixed;
        /* adjust TOC width */
        width: var(--toc-width);
        height: calc(100vh - var(--menu-bar-height) - 0.67em * 4);
        overflow: auto;
    }
    #pagetoc a {
        border-left: 1px solid var(--sidebar-bg);
        color: var(--fg);
        display: block;
        padding-bottom: 5px;
        padding-top: 5px;
        padding-left: 10px;
        text-align: left;
        text-decoration: none;
    }
    #pagetoc a:hover,
    #pagetoc a.active {
        background: var(--sidebar-bg);
        color: var(--sidebar-active) !important;
    }
    #pagetoc .active {
        background: var(--sidebar-bg);
        color: var(--sidebar-active);
    }
    #pagetoc .pagetoc-H2 {
        padding-left: 20px;
    }
    #pagetoc .pagetoc-H3 {
        padding-left: 40px;
    }
    #pagetoc .pagetoc-H4 {
        padding-left: 60px;
    }
}

@media print {
    #sidetoc {
        display: none;
    }
}