-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTOC.CSS
More file actions
82 lines (68 loc) · 1.84 KB
/
TOC.CSS
File metadata and controls
82 lines (68 loc) · 1.84 KB
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
.toc-wrapper {
overflow: visible;
}
.toc h2 {
margin-top: 0;
}
.toc {
display:flex;
flex-direction: column;
border: 1px solid color(3);
border-radius: var(--bor-rad-50);
box-shadow: 4px 4px 0 color(1);
padding: 7%;
}
.toc ul {
list-style-type: none;
padding-left: 0;
}
.toc li {
margin-bottom: 5px;
}
.toc a {
color: color(3);
text-decoration: none;
font-weight: 400;
transition: 0.4s ease-in-out;
}
/*Stuling TOC elements on hover and when they enter the viewport*/
.toc a:hover,.toc .highlight {
color: color(1);
letter-spacing: 0.01em;
}
/*TOC styles on mobile devices*/
@media (max-width: 800px) {
.sidebar--toc {
z-index: 5;
}
.toc {
position: fixed; /* Fix the TOC to the viewport */
padding: 2.5%;
left: 0;
right: 0;
bottom: 0;
z-index: 5; /* Make sure it's above other content */
background: color(4); /* Background color for visibility */
transition: top 0.3s ease-in-out;
}
.toc h3 {
order: +1;
bottom: 0; /* Position at the bottom of the viewport */
left: 0;
width: 100%; /* Span the full width of the container */
margin: 0; /* Reset margin */
color: white; /* Color of the text */
text-align: center;
cursor: pointer;
}
.toc ul {
display: none; /* Initially hide the TOC list */
width: 100%; /* Full width */
padding: 0; /* Reset padding */
flex-direction: column;
margin-bottom: 2rem; /* Give space for the toggle button */
}
.toc ul.show {
display: flex; /* Show the TOC list when toggled */
}
}