summaryrefslogtreecommitdiffhomepage
path: root/app/packages/web/src/components/diffview.module.css
blob: 94911d06f1d1e95d5e10f16533a5baf0ff83a7cd (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
.diff {
  display: grid;
  row-gap: 0;
  border: 1px solid var(--sl-color-divider);
  background-color: var(--sl-color-bg-surface);
  border-radius: 0.25rem;

  [data-section="row"] {
    display: grid;
    grid-template-columns: 1fr 1fr;

    &:first-child [data-section="cell"] {
      padding-top: 0.375rem;
    }
    &:last-child [data-section="cell"] {
      padding-bottom: 0.375rem;
    }
  }

  [data-section="cell"] {
    position: relative;
    padding-left: 1.5ch;
    padding: 0.25rem 0.5rem 0.25rem 1.5ch;
    overflow-x: auto;
    margin: 0;

    pre {
      background-color: var(--sl-color-bg-surface) !important;
    }

    &:first-child {
      border-right: 1px solid var(--sl-color-divider);
    }
  }

  [data-diff-type="removed"] {
    background-color: var(--sl-color-red-low);

    & > pre {
      --shiki-dark-bg: var(--sl-color-red-low) !important;
      background-color: transparent !important;
    }

    &::before {
      content: "-";
      position: absolute;
      left: 0.5ch;
      user-select: none;
      color: var(--sl-color-red-high);
    }
  }

  [data-diff-type="added"] {
    background-color: var(--sl-color-green-low);

    & > pre {
      --shiki-dark-bg: var(--sl-color-green-low) !important;
      background-color: transparent !important;
    }

    &::before {
      content: "+";
      position: absolute;
      left: 0.6ch;
      user-select: none;
      color: var(--sl-color-green-high);
    }
  }
}