summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/resize-handle.css
blob: c309ff838bc4f378a0e95368de2548168b377ce1 (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
[data-component="resize-handle"] {
  position: absolute;
  z-index: 10;

  &::after {
    content: "";
    position: absolute;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
  }

  &:hover::after,
  &:active::after {
    opacity: 1;
  }

  &[data-direction="horizontal"] {
    inset-block: 0;
    inset-inline-end: 0;
    width: 8px;
    transform: translateX(50%);
    cursor: col-resize;

    &[data-edge="start"] {
      inset-inline-start: 0;
      inset-inline-end: auto;
      transform: translateX(-50%);
    }

    &::after {
      width: 3px;
      inset-block: 0;
      inset-inline-start: 50%;
      transform: translateX(-50%);
    }
  }

  &[data-direction="vertical"] {
    inset-inline: 0;
    inset-block-start: 0;
    height: 8px;
    transform: translateY(-50%);
    cursor: row-resize;

    &[data-edge="end"] {
      inset-block-start: auto;
      inset-block-end: 0;
      transform: translateY(50%);
    }

    &::after {
      height: 3px;
      inset-inline: 0;
      inset-block-start: 50%;
      transform: translateY(-50%);
    }
  }
}