summaryrefslogtreecommitdiffstats
path: root/site/assets/scss/_toc.scss
blob: 512a11b42029fd1838dc0d1a7d735367072b1916 (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
// stylelint-disable selector-max-type

.bd-toc {
  @include media-breakpoint-up(lg) {
    position: sticky;
    top: 5rem;
    right: 0;
    z-index: 2;
    height: subtract(100vh, 7rem);
    overflow-y: auto;
  }

  nav {
    @include font-size(.875rem);

    ul {
      padding-left: 0;
      margin-bottom: 0;
      list-style: none;

      ul {
        padding-left: 1rem;
        margin-top: .25rem;
      }
    }

    li {
      margin-bottom: .25rem;
    }

    a {
      color: inherit;

      &:not(:hover) {
        text-decoration: none;
      }

      code {
        font: inherit;
      }
    }
  }
}

.bd-toc-toggle {
  display: flex;
  align-items: center;

  @include media-breakpoint-down(sm) {
    justify-content: space-between;
    width: 100%;
  }

  @include media-breakpoint-down(md) {
    border: 1px solid $border-color;
    @include border-radius(.4rem);

    &:hover,
    &:focus,
    &:active,
    &[aria-expanded="true"] {
      color: var(--bd-violet);
      background-color: $white;
      border-color: var(--bd-violet);
    }

    &:focus,
    &[aria-expanded="true"] {
      box-shadow: 0 0 0 3px rgba(var(--bd-violet-rgb), .25);
    }
  }
}

.bd-toc-collapse {
  @include media-breakpoint-down(md) {
    nav {
      padding: 1.25rem;
      background-color: var(--bs-gray-100);
      border: 1px solid $border-color;
      @include border-radius(.25rem);
    }
  }

  @include media-breakpoint-up(md) {
    display: block !important; // stylelint-disable-line declaration-no-important
  }
}