aboutsummaryrefslogtreecommitdiff
path: root/src/components/tab_switcher/tab_switcher.scss
blob: df585faa3883777a540a579d77d950f5f3518e58 (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
@import '../../_variables.scss';

.tab-switcher {
  display: flex;
  flex-direction: column;

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

    .hidden {
      display: none;
    }

    &.scrollable-tabs {
      flex-basis: 0;
      overflow-y: auto;
    }
  }
  .tabs {
    display: flex;
    position: relative;
    width: 100%;
    overflow-y: hidden;
    overflow-x: auto;
    padding-top: 5px;
    box-sizing: border-box;

    &::after, &::before {
      display: block;
      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;
      position: relative;
      display: flex;
      flex: 0 0 auto;

      .tab {
        width: 100%;
        min-width: 1px;
        position: relative;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding: 6px 1em;
        padding-bottom: 99px;
        margin-bottom: 6px - 99px;
        white-space: nowrap;

        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;
        }
      }

      &:not(.active) {
        &::after {
          content: '';
          position: absolute;
          left: 0;
          right: 0;
          bottom: 0;
          z-index: 7;
          border-bottom: 1px solid;
          border-bottom-color: $fallback--border;
          border-bottom-color: var(--border, $fallback--border);
        }
      }
    }

  }
}