highlighted_diff_email.scss 5.52 KB
Newer Older
1 2
@import "framework/variables";

3 4 5 6 7 8 9 10 11 12
// This file is largely copied from `highlight/white.scss`, but modified to
// avoid all descendant selectors (`table td`). This is because the CSS inlining
// we use performs dramatically worse on descendant selectors than the
// alternatives.
// <https://gitlab.com/gitlab-org/gitlab-ee/issues/490#note_12283632>
//
// DO NOT ADD ANY DESCENDANT SELECTORS TO THIS FILE. Instead, use (in order of
// preference): plain class selectors, type (element name) selectors, or
// explicit child selectors.

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
/*
* Highlighted Diff Email Syntax Colors
*/
$highlighted-highlight-word: #fafe3d;
$highlighted-hll-bg: #f8f8f8;
$highlighted-c: #998;
$highlighted-err: #a61717;
$highlighted-err-bg: #e3d2d2;
$highlighted-cm: #998;
$highlighted-cp: #999;
$highlighted-c1: #998;
$highlighted-cs: #999;
$highlighted-gd: #000;
$highlighted-gd-bg: #fdd;
$highlighted-gd-x: #000;
$highlighted-gd-x-bg: #faa;
$highlighted-gr: #a00;
$highlighted-gh: #999;
$highlighted-gi: #000;
$highlighted-gi-bg: #dfd;
$highlighted-gi-x: #000;
$highlighted-gi-x-bg: #afa;
$highlighted-go: #888;
$highlighted-gp: #555;
$highlighted-gu: #800080;
$highlighted-gt: #a00;
$highlighted-kt: #458;
$highlighted-m: #099;
$highlighted-s: #d14;
$highlighted-n: #333;
$highlighted-na: teal;
$highlighted-nb: #0086b3;
$highlighted-nc: #458;
$highlighted-no: teal;
$highlighted-ni: purple;
$highlighted-ne: #900;
$highlighted-nf: #900;
$highlighted-nn: #555;
$highlighted-nt: navy;
$highlighted-nv: teal;
$highlighted-w: #bbb;
$highlighted-mf: #099;
$highlighted-mh: #099;
$highlighted-mi: #099;
$highlighted-mo: #099;
$highlighted-sb: #d14;
$highlighted-sc: #d14;
$highlighted-sd: #d14;
$highlighted-s2: #d14;
$highlighted-se: #d14;
$highlighted-sh: #d14;
$highlighted-si: #d14;
$highlighted-sx: #d14;
$highlighted-sr: #009926;
$highlighted-s1: #d14;
$highlighted-ss: #990073;
$highlighted-bp: #999;
$highlighted-vc: teal;
$highlighted-vg: teal;
$highlighted-vi: teal;
$highlighted-il: #099;
$highlighted-gc: #999;
$highlighted-gc-bg: #eaf2f5;

77
.code {
78
  background-color: $white-light;
79
  font-family: monospace;
Phil Hughes's avatar
Phil Hughes committed
80
  font-size: $code_font_size;
81 82 83 84
  -premailer-cellpadding: 0;
  -premailer-cellspacing: 0;
  -premailer-width: 100%;

85
  > tr {
86
    line-height: $code_line_height;
Phil Hughes's avatar
Phil Hughes committed
87
  }
88 89
}

90 91 92 93
.diff-line-num {
  padding: 0 5px;
  text-align: right;
  width: 35px;
94
  background-color: $background-color;
95
  color: $black-transparent;
Phil Hughes's avatar
Phil Hughes committed
96
  border-right: 1px solid $table-border-gray;
97 98 99

  &.old {
    background-color: $line-number-old;
Phil Hughes's avatar
Phil Hughes committed
100
    border-right-color: $line-removed-dark;
101 102
  }

103 104
  &.new {
    background-color: $line-number-new;
Phil Hughes's avatar
Phil Hughes committed
105
    border-right-color: $line-added-dark;
106 107 108 109
  }
}

.line_content {
110 111
  padding-left: 0.5em;
  padding-right: 0.5em;
Phil Hughes's avatar
Phil Hughes committed
112

113 114 115
  &.old {
    background-color: $line-removed;

116 117
    > .line > span.idiff,
    > .line > span > span.idiff {
118 119 120 121 122 123 124
      background-color: $line-removed-dark;
    }
  }

  &.new {
    background-color: $line-added;

125 126
    > .line > span.idiff,
    > .line > span > span.idiff {
127 128 129 130 131 132 133 134 135 136
      background-color: $line-added-dark;
    }
  }

  &.match {
    color: $black-transparent;
    background-color: $match-line;
  }
}

137 138 139 140
pre {
  margin: 0;
}

141
span.highlight_word {
142
  background-color: $highlighted-highlight-word !important;
143 144
}

145 146 147
.hll { background-color: $highlighted-hll-bg; }
.c { color: $highlighted-c; font-style: italic; }
.err { color: $highlighted-err; background-color: $highlighted-err-bg; }
148 149
.k { font-weight: bold; }
.o { font-weight: bold; }
150 151 152 153 154 155
.cm { color: $highlighted-cm; font-style: italic; }
.cp { color: $highlighted-cp; font-weight: bold; }
.c1 { color: $highlighted-c1; font-style: italic; }
.cs { color: $highlighted-cs; font-weight: bold; font-style: italic; }
.gd { color: $highlighted-gd; background-color: $highlighted-gd-bg; }
.gd .x { color: $highlighted-gd; background-color: $highlighted-gd-x-bg; }
156
.ge { font-style: italic; }
157 158 159 160 161 162
.gr { color: $highlighted-gr; }
.gh { color: $highlighted-gh; }
.gi { color: $highlighted-gi; background-color: $highlighted-gi-bg; }
.gi .x { color: $highlighted-gi; background-color: $highlighted-gi-x-bg; }
.go { color: $highlighted-go; }
.gp { color: $highlighted-gp; }
163
.gs { font-weight: bold; }
164 165
.gu { color: $highlighted-gu; font-weight: bold; }
.gt { color: $highlighted-gt; }
166 167 168 169 170
.kc { font-weight: bold; }
.kd { font-weight: bold; }
.kn { font-weight: bold; }
.kp { font-weight: bold; }
.kr { font-weight: bold; }
171 172 173 174 175 176 177 178 179 180 181 182 183 184
.kt { color: $highlighted-kt; font-weight: bold; }
.m { color: $highlighted-m; }
.s { color: $highlighted-s; }
.n { color: $highlighted-n; }
.na { color: $highlighted-na; }
.nb { color: $highlighted-nb; }
.nc { color: $highlighted-nc; font-weight: bold; }
.no { color: $highlighted-no; }
.ni { color: $highlighted-ni; }
.ne { color: $highlighted-ne; font-weight: bold; }
.nf { color: $highlighted-nf; font-weight: bold; }
.nn { color: $highlighted-nn; }
.nt { color: $highlighted-nt; }
.nv { color: $highlighted-nv; }
185
.ow { font-weight: bold; }
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
.w { color: $highlighted-w; }
.mf { color: $highlighted-mf; }
.mh { color: $highlighted-mh; }
.mi { color: $highlighted-mi; }
.mo { color: $highlighted-mo; }
.sb { color: $highlighted-sb; }
.sc { color: $highlighted-sc; }
.sd { color: $highlighted-sd; }
.s2 { color: $highlighted-s2; }
.se { color: $highlighted-se; }
.sh { color: $highlighted-sh; }
.si { color: $highlighted-si; }
.sx { color: $highlighted-sx; }
.sr { color: $highlighted-sr; }
.s1 { color: $highlighted-s1; }
.ss { color: $highlighted-ss; }
.bp { color: $highlighted-bp; }
.vc { color: $highlighted-vc; }
.vg { color: $highlighted-vg; }
.vi { color: $highlighted-vi; }
.il { color: $highlighted-il; }
.gc { color: $highlighted-gc; background-color: $highlighted-gc-bg; }