summaryrefslogtreecommitdiffhomepage
path: root/packages/css/src/components/tabs.css
blob: 3790859d12e459dc4bcb27f7eb30fb92c863ab03 (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
[data-component="tabs"] {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-width: 1px;
  border-style: solid;
  border-radius: var(--radius-sm);
  border-color: var(--border-weak-base);
  background-color: var(--background-weaker);
  overflow: clip;

  & [data-slot="list"] {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    overflow-x: auto;

    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    &::-webkit-scrollbar {
      display: none;
    }

    /* After element to fill remaining space */
    &::after {
      content: "";
      display: block;
      flex-grow: 1;
      height: 100%;
      border-bottom: 1px solid var(--border-weak-base);
      background-color: var(--background-weak);
      border-top-right-radius: var(--radius-sm);
    }

    &:empty::after {
      display: none;
    }
  }

  & [data-slot="trigger"] {
    position: relative;
    height: 36px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-weak);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-weak-base);
    border-right: 1px solid var(--border-weak-base);
    background-color: var(--background-weak);
    transition:
      background-color 0.15s ease,
      color 0.15s ease;

    &:disabled {
      pointer-events: none;
      color: var(--text-weaker);
    }
    &:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px var(--border-focus);
    }
    &[data-selected] {
      color: var(--text-base);
      background-color: transparent;
      border-bottom-color: transparent;
    }
    &:hover:not(:disabled):not([data-selected]) {
      color: var(--text-strong);
    }
  }

  & [data-slot="content"] {
    overflow-y: auto;
    flex: 1;

    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    &::-webkit-scrollbar {
      display: none;
    }

    &:focus-visible {
      outline: none;
    }
  }
}