_sidebar.scss 3.28 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
2
// scss-lint:disable VendorPrefix

3
4
5
6
//
// Side navigation
//

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.bd-toc {
  position: sticky;
  top: 4rem;
  max-height: calc(100vh - 4rem);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  overflow-y: auto;
  font-size: .85rem;
}

.section-nav {
  padding-left: 0;
  border-left: 1px solid #eee;

  ul {
    padding-left: 1rem;
Mark Otto's avatar
Mark Otto committed
23
24
25
26

    ul {
      display: none;
    }
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  }
}

.toc-entry {
  display: block;

  a {
    display: block;
    padding: .25rem 1.5rem;
    color: #99979c;

    &:hover {
      color: $brand-primary;
      text-decoration: none;
    }
  }
}

45
.bd-sidebar {
Mark Otto's avatar
Mark Otto committed
46
47
48
  background-color: #f5f5f5;
  border-right: 1px solid rgba(0,0,0,.1);

49
50
  @include media-breakpoint-up(md) {
    position: sticky;
Mark Otto's avatar
Mark Otto committed
51
    top: 4rem;
52
53
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
54
  }
Mark Otto's avatar
Mark Otto committed
55
56
57
58

  @include media-breakpoint-up(xl) {
    max-width: 320px;
  }
59
60
}

Mark Otto's avatar
Mark Otto committed
61
.bd-links {
Mark Otto's avatar
Mark Otto committed
62
63
  margin-right: -15px;
  margin-left: -15px;
Mark Otto's avatar
Mark Otto committed
64
65
}

66
.bd-search {
Maxime Locqueville's avatar
Maxime Locqueville committed
67
  position: relative; // To contain the Algolia search
Mark Otto's avatar
Mark Otto committed
68
69
  padding-top: 1rem;
  padding-bottom: 1rem;
70
71
}

Mark Otto's avatar
Mark Otto committed
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
127
128
129
130
131
// Docsearch overrides
//
// `!important` indicates overridden properties.
.algolia-autocomplete {
  // Menu container
  .ds-dropdown-menu {
    width: 100%;
    min-width: 0 !important;
    max-width: none !important;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.175);

    // Caret
    &::before {
      left: 1rem !important;
    }
  }

  // Section header
  .algolia-docsearch-suggestion--subcategory-column {
    float: none !important;
    width: auto !important;
    padding: 0 !important;
    text-align: left !important;
  }

  .algolia-docsearch-suggestion--content {
    float: none !important;
    width: auto !important;
    padding: 0 !important;

    // Vertical divider between column header and content
    &::before {
      display: none !important;
    }
  }

  .ds-suggestion {
    .algolia-docsearch-suggestion--subcategory-column {
      display: none !important;
    }
  }

  .algolia-docsearch-footer {
    display: none !important;
  }

  .algolia-docsearch-suggestion--highlight {
    color: #5f2dab;
    background-color: rgba(154, 132, 187, .12);
  }

  .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight {
    box-shadow: inset 0 -2px 0 0 rgba(95, 45, 171, .8) !important;
  }

  .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content {
    background-color: rgba(208, 189, 236, .12) !important;
  }
}

132
133
134
135
136
137
.bd-sidenav {
  display: none;
}

.bd-toc-link {
  display: block;
Mark Otto's avatar
Mark Otto committed
138
  padding: .75rem 1.5rem;
Mark Otto's avatar
Mark Otto committed
139
  font-weight: 500;
140
141
  color: $gray;
}
Mark Otto's avatar
Mark Otto committed
142
143

.bd-toc-link:hover {
144
145
  color: $brand-primary;
  text-decoration: none;
Mark Otto's avatar
Mark Otto committed
146
  background-color: #fafafa;
147
148
}

Mark Otto's avatar
Mark Otto committed
149
.bd-toc-item {
Mark Otto's avatar
Mark Otto committed
150
151
152
  &:first-child {
    border-top: 1px solid $gray-lighter;
  }
Mark Otto's avatar
Mark Otto committed
153
154
155
  &:not(:last-child) {
    border-bottom: 1px solid $gray-lighter;
  }
Mark Otto's avatar
Mark Otto committed
156
157
158
159
160
161
162
163
164
165

  &.active {
    background-color: #fafafa;

    > .bd-toc-link {
      color: $gray-dark;
    }

    > .bd-sidenav {
      display: block;
166
      padding-bottom: .75rem;
Mark Otto's avatar
Mark Otto committed
167
168
    }
  }
Mark Otto's avatar
Mark Otto committed
169
170
}

171
172
173
// All levels of nav
.bd-sidebar .nav > li > a {
  display: block;
Mark Otto's avatar
Mark Otto committed
174
  padding: .25rem 1.5rem;
175
176
177
  font-size: 90%;
  color: #99979c;
}
Mark Otto's avatar
Mark Otto committed
178
179

.bd-sidebar .nav > li > a:hover {
180
181
182
183
  color: $brand-primary;
  text-decoration: none;
  background-color: transparent;
}
Mark Otto's avatar
Mark Otto committed
184

185
.bd-sidebar .nav > .active > a,
Mark Otto's avatar
Mark Otto committed
186
.bd-sidebar .nav > .active:hover > a {
187
188
189
190
  font-weight: 500;
  color: $gray-dark;
  background-color: transparent;
}