summaryrefslogtreecommitdiff
path: root/_sass/common/components/_toc.scss
blob: 9fd142183a1721cb7ba56a7d8ef7a9a5cc9bfb0f (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
ul.toc {
  display: block;
  margin: 0;
  color: $text-color;
  list-style-type: none;
  & > li {
    margin: map-get($spacers, 1) / 2 0;
    a {
      display: inline-block;
      margin: map-get($spacers, 1) / 4 0;
      text-decoration: none !important;
    }
  }
  .toc-h1,
  .toc-h2,
  .toc-h3,
  .toc-h4,
  .toc-h5,
  .toc-h6 {
    a {
      @include link-colors($text-color, $main-color-1);
    }
    &.active {
      a {
        @include link-colors($main-color-1);
      }
    }
  }

  .toc-h2,
  .toc-h3,
  .toc-h4,
  .toc-h5,
  .toc-h6 {
    &, a {
      font-size: map-get($base, font-size-xs);
      font-weight: map-get($base, font-weight);
      line-height: map-get($base, line-height-xs);
    }
  }
  .toc-h1 {
    @include split-line(bottom);
    padding: map-get($spacers, 2) 0 map-get($spacers, 1) 0;
    margin-bottom: map-get($spacers, 2);
    color: $text-color-d;
    &, a {
      font-size: map-get($base, font-size-sm);
      font-weight: map-get($base, font-weight-bold);
      line-height: map-get($base, line-height-sm);
    }
    a {
      @include link-colors($text-color-d, $main-color-1);
    }
  }
  .toc-h2 {
    &, a {
      font-weight: map-get($base, font-weight-bold);
    }
  }
  .toc-h3 {
    margin-left: map-get($spacers, 3);
  }
  .toc-h4 {
    margin-left: map-get($spacers, 3) * 2;
  }
  .toc-h5,
  .toc-h6 {
    margin-left: map-get($spacers, 3) * 3;
  }
  .toc-h6 {
    color: $text-color-l;
    a {
      @include link-colors($text-color-l, $main-color-1);
    }
  }
}

ul.toc--ellipsis {
  & > li {
    @include overflow(hidden);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

ul.toc--navigator {
  & > li {
    a {
      padding-left: map-get($spacers, 2);
      margin: map-get($spacers, 1) 0;
    }
    &.active {
      a {
        margin-left: -4px;
        @include split-line(left, 4px, $main-color-1);
      }
    }
  }
  .toc-h2,
  .toc-h3,
  .toc-h4 {
    color: $text-color-l;
    a {
      @include link-colors($text-color-l);
    }
  }
  .toc-h1 {
    &, a {
      font-size: map-get($base, font-size);
      line-height: map-get($base, line-height);
    }
    color: $text-color;
    a {
      @include link-colors($text-color-d);
    }
  }
  .toc-h2 {
    &, a {
      font-size: map-get($base, font-size-sm);
      font-weight: map-get($base, font-weight-bold);
      line-height: map-get($base, line-height-sm);
    }
  }
}