aboutsummaryrefslogtreecommitdiff
path: root/src/components/tab_switcher/tab_switcher.scss
blob: a443531ecaf981b054bf382820f636158506db46 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
@import '../../_variables.scss';

.tab-switcher {
  display: flex;

  &.top-tabs {
    flex-direction: column;
    > .tabs {
      width: 100%;
      overflow-y: hidden;
      overflow-x: auto;
      padding-top: 5px;
      flex-direction: row;
      &::after, &::before {
        content: '';
        flex: 1 1 auto;
        border-bottom: 1px solid;
        border-bottom-color: $fallback--border;
        border-bottom-color: var(--border, $fallback--border);
      }
      .tab-wrapper {
        height: 28px;

        &:not(.active)::after {
          left: 0;
          right: 0;
          bottom: 0;
          border-bottom: 1px solid;
          border-bottom-color: $fallback--border;
          border-bottom-color: var(--border, $fallback--border);
        }
      }
      .tab {
        width: 100%;
        min-width: 1px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding-bottom: 99px;
        margin-bottom: 6px - 99px;
      }
    }
    .contents.scrollable-tabs {
      flex-basis: 0;
    }
  }

  &.side-tabs {
    flex-direction: row;
    > .contents {
      flex: 0 1 80%;
    }
    > .tabs {
      flex: 1 0 auto;
      overflow-y: auto;
      overflow-x: hidden;
      padding-top: 5px;
      flex-direction: column;
      &::after {
        content: '';
        flex: 1 1 auto;
        border-right: 1px solid;
        border-right-color: $fallback--border;
        border-right-color: var(--border, $fallback--border);
      }
      .tab-wrapper {
        min-width: 10em;
        &:not(.active)::after {
          top: 0;
          right: 0;
          bottom: 0;
          border-right: 1px solid;
          border-right-color: $fallback--border;
          border-right-color: var(--border, $fallback--border);
        }
      }
      .tab {
        box-sizing: content-box;
        width: 100%;
        margin-bottom: 5px;
        min-width: 10em;
        min-width: 1px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        // padding-right: 200px;
        // margin-right: 6px - 200px;
        margin-left: 6px;
      }

      .tab-wrapper {
        min-width: 10em;
        &:not(.active)::after {
          top: 0;
          right: 0;
          bottom: 0;
          border-right: 1px solid;
          border-right-color: $fallback--border;
          border-right-color: var(--border, $fallback--border);
        }
      }
      .tab {
        box-sizing: content-box;
        width: 100%;
        margin-bottom: 5px;
        min-width: 10em;
        min-width: 1px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        // padding-right: 200px;
        // margin-right: 6px - 200px;
        margin-left: 6px;
      }
    }
  }


  .contents {
    flex: 1 0 auto;
    min-height: 0px;

    .hidden {
      display: none;
    }

    &.scrollable-tabs {
      overflow-y: auto;
    }
  }

  .tab {
    position: relative;
    white-space: nowrap;

    padding: 6px 1em;
    color: $fallback--text;
    color: var(--tabText, $fallback--text);
    background-color: $fallback--fg;
    background-color: var(--tab, $fallback--fg);

    &:not(.active) {
      z-index: 4;

      &:hover {
        z-index: 6;
      }
    }

    &.active {
      background: transparent;
      z-index: 5;
      color: $fallback--text;
      color: var(--tabActiveText, $fallback--text);
    }

    img {
      max-height: 26px;
      vertical-align: top;
      margin-top: -5px;
    }
  }


  .tabs {
    display: flex;
    position: relative;
    box-sizing: border-box;

    &::after, &::before {
      display: block;
      flex: 1 1 auto;
    }
  }

  .tab-wrapper {
    position: relative;
    display: flex;
    flex: 0 0 auto;

    &:not(.active) {
      &::after {
        content: '';
        position: absolute;
        z-index: 7;
      }
    }
  }
}