Welcome to mirror list, hosted at ThFree Co, Russian Federation.

toc.scss « stylesheets « assets « content - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 669a6584e23909b9a49844b5b8984fdf04ab79c3 (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
127
128
129
130
131
132
133
134
---
version: 20
---
@import 'variables';
@import 'utilities';

$base-nav-link-padding: 0.75rem;
$sm-nav-link-padding: 0.25rem;
$nav-link-font-size: 0.875rem;

// ToC styles
.table-of-contents {
  padding: 1rem 1rem 0;
  margin-top: 35px;

  li {
    list-style: none;
  }

  .nav-link {
    font-size: $nav-link-font-size;
    color: $toc-link-color;
    border-radius: 0;
    border-left: 3px solid $gds-indigo-100;
    border-bottom: 0;

    &:hover {
      color: $link-color-nav-hover;
      text-decoration: underline;
      background-color: transparent;
      box-shadow: none;
      border-bottom: 0;
    }

    &.active {
      color: $link-color-nav;
      background-color: transparent;
      border-color: $gds-indigo-800;

      /* stylelint-disable-next-line selector-list-comma-newline-after */
      &:hover, &:only-child {
        color: $link-color-nav-hover;
        background-color: transparent;
      }
    }
  }
}

.markdown-toc {
  top: 0;

  @media(min-width: $bp-lg) {
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    overflow-y: scroll;
    height: 100vh;
  }
}

.nav-pills {
  flex-wrap: nowrap;
}

// NOTE: This only allows for 10 levels.
// This should be acceptable since levels are determined by the `<h1-6>` which is less
// than 10 anyways...
@for $i from 0 to 10 {
  .nav-link.toc-level-#{$i} {
    padding-left: $base-nav-link-padding * ($i + 0.75);
    padding-top: 0;
    line-height: 1rem;
  }
}

@media(max-width: $bp-lg) {
  .doc-nav {
    margin-left: -20px;
    margin-top: -55px;
  }

  .table-of-contents {
    padding: 0 1rem;
    font-size: 0.875rem;

    .nav-link {
      border-left: 0;
      padding: $sm-nav-link-padding;
    }

    h4 {
      font-size: $nav-link-font-size;
    }
  }

  .sm-collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
  }

  .sm-collapsed {
    display: none;
  }

  .toc-lg {
    display: none;
  }

  .toc-sm {
    display: block;
  }
}

// wide enough to show toc but not quick nav
@media(min-width: $bp-lg) {
  .header {
    top: 0;
    left: 0;
  }

  .doc-nav {
    &.toc-no-breadcrumbs {
      padding-top: 6px;
    }
  }

  .toc-lg {
    display: block;
  }

  .toc-sm {
    display: none;
  }
}