summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/collapsible.css
blob: edd9952d749c8ece858695d40e10597f053f6e0a (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
[data-component="collapsible"] {
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-inset-base);
  border: 1px solid var(--border-weaker-base);
  transition: background-color 0.15s ease;
  border-radius: var(--radius-md);
  overflow: clip;

  [data-slot="collapsible-trigger"] {
    width: 100%;
    display: flex;
    height: 32px;
    padding: 6px 8px 6px 12px;
    align-items: center;
    align-self: stretch;
    cursor: default;
    user-select: none;
    color: var(--text-base);

    /* text-12-medium */
    font-family: var(--font-family-sans);
    font-size: var(--font-size-small);
    font-style: normal;
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-large); /* 166.667% */
    letter-spacing: var(--letter-spacing-normal);

    /* &:hover { */
    /*   background-color: var(--surface-base); */
    /* } */
    &:focus-visible {
      outline: none;
    }
    &[data-disabled] {
      cursor: not-allowed;
    }

    [data-slot="collapsible-arrow"] {
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;

      /* [data-slot="collapsible-arrow-icon"] { */
      /* } */
    }
  }

  [data-slot="collapsible-content"] {
    overflow: hidden;
    /* animation: slideUp 250ms ease-out; */

    /* &[data-expanded] { */
    /*   animation: slideDown 250ms ease-out; */
    /* } */
  }

  &[data-variant="ghost"] {
    background-color: transparent;
    border: none;

    > [data-slot="collapsible-trigger"] {
      background-color: transparent;
      border: none;
      padding: 0;

      /* &:hover { */
      /*   color: var(--text-strong); */
      /* } */
      &:focus-visible {
        outline: none;
      }
      &[data-disabled] {
        cursor: not-allowed;
      }
    }
  }
}

@keyframes slideDown {
  from {
    height: 0;
  }
  to {
    height: var(--kb-collapsible-content-height);
  }
}

@keyframes slideUp {
  from {
    height: var(--kb-collapsible-content-height);
  }
  to {
    height: 0;
  }
}