summaryrefslogtreecommitdiff
path: root/sysret.org/themes/tabi-lean/sass/parts/_quick_navigation_buttons.scss
blob: 768592fae33f4a7e9583817e59dea9b2a66da243 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#button-container {
    display: flex;
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 2; // Above "copy-code" buttons. Important for the ToC.

    #toc-button,
    #comments-button,
    #top-button {
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 2;
        cursor: pointer;
        border: none;
        border-radius: 50%;
        background-color: var(--bg-1);
        padding: 0.4rem;
        width: 1rem;
        height: 1rem;
        text-align: center;

        &:hover {
            background-color: var(--bg-3);

            svg {
                fill: var(--primary-color);
            }

            &::before {
                background-color: transparent;
            }
        }

        svg {
            fill: var(--text-color);
            width: 1rem;
            height: 1rem;
        }
    }

    #toc-floating-container {

        $padding-vertical: 0.7rem;
        $padding-horizontal: 1rem;

        #toc-button {
            position: relative;
            z-index: 2;
        }

        .toc-container {
            margin: 0;
            margin-top: $padding-vertical;
            max-width: 80vw;
        }

        .toc-content {
            display: none;
            position: absolute;
            right: 0;
            bottom: 100%;
            z-index: 2;
            margin-block-end: $padding-vertical;
            box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;
            border: 1px solid var(--divider-color);
            border-radius: 5px;
            background-color: var(--background-color);
            padding-inline-end: $padding-horizontal;
            max-height: 70vh;
            overflow-y: auto;
            font-size: 0.8rem;
            text-align: start;
            white-space: nowrap; // Prevents wrapping, allowing content to define width.

            ul {
                padding-inline-start: $padding-horizontal;
                list-style: none;
            }
        }

        .toggle {
            display: none;

            &:checked {

                + .overlay,
                + .overlay + #toc-button + .toc-content {
                    display: block;
                }

                + .overlay + #toc-button svg {
                    fill: var(--primary-color); // Show the ToC icon as toggled.
                }
            }
        }

        .overlay {
            display: none;
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            opacity: 40%;
            z-index: 1; // Lower than the Table of Contents
            background: var(--background-color);
        }

    }
}

@media (max-width: 700px) {
    #button-container {
        display: none !important;
    }
}

@media print {
    #button-container {
        display: none;
    }
}