summaryrefslogtreecommitdiff
path: root/client/simple/src/less/code.less
blob: 59d63a93195139f85c54073d81c44237774d967d (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
// SPDX-License-Identifier: AGPL-3.0-or-later

@import "../../generated/pygments.less";

.codelines {
  margin: @results-margin 0 0 0;
  padding: @result-padding 0 0 0;
}

.code-highlight-sxng() {
  .code-highlight {
    pre {
      overflow: auto;
      margin: 0;
      padding: 0 0 0.75rem 0;
    }

    .linenos {
      user-select: none;
      cursor: default;

      &::selection {
        background: transparent;
      }

      margin-right: 8px;
      text-align: right;
    }

    span.linenos {
      color: var(--color-line-number);
    }

    .err {
      // The code view in the result list should not act as a code-checker.
      border: none;
      color: inherit;
    }
  }
}

.code-highlight-sxng();

/// Dark Theme (autoswitch based on device pref)
@media (prefers-color-scheme: dark) {
  :root.theme-auto {
    .code-highlight-dark();
    .code-highlight-sxng();
  }
}

// Dark Theme by preferences
:root.theme-dark {
  .code-highlight-dark();
  .code-highlight-sxng();
}