typography.scss 6.8 KB
Newer Older
1
@mixin md-typography {
T
tauriedavis 已提交
2
  color: $gl-text-color;
3
  word-wrap: break-word;
4

5 6 7 8
  [dir="auto"] {
    text-align: initial;
  }

9
  a {
10
    color: $blue-600;
11 12
  }

13
  img:not(.emoji) {
14
    margin: 0 0 8px;
15 16 17
  }

  img.lazy {
18 19 20 21 22
    min-width: 200px;
    min-height: 100px;
    background-color: $gray-lightest;
  }

23 24
  img.js-lazy-loaded,
  img.emoji {
25 26 27
    min-width: inherit;
    min-height: inherit;
    background-color: inherit;
28
    max-width: 100%;
29 30 31 32 33 34
  }

  p a:not(.no-attachment-icon) img {
    // Remove bottom padding because
    // <p> already has $gl-padding bottom
    margin-bottom: 0;
35 36
  }

37
  *:first-child {
38 39 40
    margin-top: 0;
  }

41 42 43 44
  > :last-child {
    margin-bottom: 0;
  }

45
  // Single code lines should wrap
46
  code {
47
    font-family: $monospace-font;
48
    white-space: pre-wrap;
49 50 51
    word-wrap: normal;
  }

52 53 54 55 56 57 58
  // Multi-line code blocks should scroll horizontally
  pre {
    code {
      white-space: pre;
    }
  }

59 60 61 62 63
  kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
64
    color: $gl-gray-700;
65
    vertical-align: middle;
S
Sam Rose 已提交
66
    background-color: $kdb-bg;
67 68
    border-width: 1px;
    border-style: solid;
69
    border-color: $gl-gray-200 $gl-gray-200 $kdb-border-bottom;
70 71
    border-image: none;
    border-radius: 3px;
S
Sam Rose 已提交
72
    box-shadow: 0 -1px 0 $kdb-shadow inset;
73 74 75
  }

  h1 {
76
    font-size: 1.75em;
77
    font-weight: $gl-font-weight-bold;
78 79
    margin: 24px 0 16px;
    padding-bottom: 0.3em;
T
tauriedavis 已提交
80
    border-bottom: 1px solid $white-dark;
T
tauriedavis 已提交
81
    color: $gl-text-color;
82 83 84 85

    &:first-child {
      margin-top: 0;
    }
86 87 88
  }

  h2 {
89
    font-size: 1.5em;
90
    font-weight: $gl-font-weight-bold;
91 92 93
    margin: 24px 0 16px;
    padding-bottom: 0.3em;
    border-bottom: 1px solid $white-dark;
T
tauriedavis 已提交
94
    color: $gl-text-color;
95 96 97
  }

  h3 {
98
    margin: 24px 0 16px;
99
    font-size: 1.3em;
100 101 102
  }

  h4 {
103
    margin: 24px 0 16px;
104
    font-size: 1.2em;
105 106 107
  }

  h5 {
108
    margin: 24px 0 16px;
109
    font-size: 1em;
110 111 112
  }

  h6 {
113
    margin: 24px 0 16px;
114
    font-size: 0.95em;
115 116
  }

117
  blockquote,
118
  .blockquote {
S
Sam Rose 已提交
119
    color: $gl-grayish-blue;
120
    font-size: inherit;
121 122
    padding: 8px 24px;
    margin: 16px 0;
T
tauriedavis 已提交
123
    border-left: 3px solid $white-dark;
124

125 126 127 128
    &:dir(rtl) {
      border-left: 0;
      border-right: 3px solid $white-dark;
    }
129

130 131 132 133
    p {
      color: $gl-grayish-blue !important;
      font-size: inherit;
      line-height: 1.5;
134

135 136 137
      &:last-child {
        margin: 0;
      }
138
    }
139 140 141
  }

  p {
T
tauriedavis 已提交
142
    color: $gl-text-color;
143
    margin: 0 0 16px;
144 145 146 147 148
  }

  table {
    @extend .table;
    @extend .table-bordered;
149
    margin: 16px 0;
T
tauriedavis 已提交
150
    color: $gl-text-color;
151

152
    th {
S
Sam Rose 已提交
153
      background: $label-gray-bg;
154 155 156
    }
  }

157 158 159 160
  table:dir(rtl) th {
    text-align: right;
  }

161
  pre {
162
    margin-bottom: 16px;
163 164 165
    font-size: 13px;
    line-height: 1.6em;
    overflow-x: auto;
C
Clement Ho 已提交
166
    border-radius: 2px;
167 168 169 170


    &.plain-readme {
      background: none;
171
      border: 0;
172 173 174 175
      padding: 0;
      margin: 0;
      font-size: 14px;
    }
176 177 178 179 180 181
  }

  p > code {
    font-weight: inherit;
  }

182
  a > code {
A
Annabel Gray 已提交
183
    color: $blue-600;
184 185
  }

186 187 188 189
  dd {
    margin-left: $gl-padding;
  }

190 191
  ul,
  ol {
192
    padding: 0;
193
    margin: 0 0 16px;
194 195
  }

196 197
  ul:dir(rtl),
  ol:dir(rtl) {
198 199 200
    margin: 3px 28px 3px 0 !important;
  }

201 202
  li {
    line-height: 1.6em;
203 204 205 206 207 208 209 210 211 212 213
    margin-left: 25px;
    padding-left: 3px;

    /* Normalize the bullet position on webkit. */
    @include on-webkit-only {
      margin-left: 28px;
      padding-left: 0;
    }
  }

  ul.task-list {
J
Jared Deckard 已提交
214
    > li.task-list-item {
215 216
      list-style-type: none;
      position: relative;
217
      min-height: 22px;
218 219 220
      padding-left: 28px;
      margin-left: 0 !important;

J
Jared Deckard 已提交
221
      > input.task-list-item-checkbox {
222 223 224 225 226
        position: absolute;
        left: 8px;
        top: 5px;
      }
    }
227 228
  }

229 230
  a[href*="/uploads/"],
  a[href*="storage.googleapis.com/google-code-attachments/"] {
C
Clement Ho 已提交
231
    &::before {
232 233 234 235 236 237 238 239 240
      margin-right: 4px;

      font: normal normal normal 14px/1 FontAwesome;
      font-size: inherit;
      text-rendering: auto;
      -webkit-font-smoothing: antialiased;
      content: "\f0c6";
    }

C
Clement Ho 已提交
241
    &:hover::before {
242 243 244
      text-decoration: none;
    }
  }
245

246
  a.no-attachment-icon {
C
Clement Ho 已提交
247
    &::before {
248 249 250 251
      display: none;
    }
  }

252
  /* Link to current header. */
253 254 255 256 257 258
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
259 260 261
    position: relative;

    a.anchor {
262 263 264
      left: -16px;
      position: absolute;
      text-decoration: none;
265
      outline: none;
266

C
Clement Ho 已提交
267
      &::after {
268
        content: image-url('icon_anchor.svg');
269 270
        visibility: hidden;
      }
271 272
    }

C
Clement Ho 已提交
273
    &:hover > a.anchor::after {
274
      visibility: visible;
275 276
    }
  }
277 278 279
}


280
/**
281
 * Headers
282
 *
283
 */
A
Andrey 已提交
284
body {
S
Sam Rose 已提交
285
  -webkit-text-shadow: $body-text-shadow 0 0 1px;
A
Andrey 已提交
286
}
287

D
Dmitriy Zaporozhets 已提交
288
.page-title {
289
  margin: #{2 * $grid-size} 0;
290 291
  line-height: 1.3;
  font-size: 1.25em;
292
  font-weight: $gl-font-weight-bold;
D
Douwe Maan 已提交
293 294 295 296

  &:last-child {
    margin-bottom: 0;
  }
297 298 299 300 301

  &.with-button {
    line-height: 34px;
  }

A
Andrey 已提交
302 303 304
}

.page-title-empty {
305
  margin-top: 0;
A
Andrey 已提交
306 307
  line-height: 1.3;
  font-size: 1.25em;
308
  font-weight: $gl-font-weight-bold;
309
  margin: 12px 0;
310 311
}

312 313 314 315 316 317
h1,
h2,
h3,
h4,
h5,
h6 {
T
tauriedavis 已提交
318
  color: $gl-text-color;
319
  font-weight: $gl-font-weight-bold;
320 321
}

P
Phil Hughes 已提交
322
.light-header {
323
  font-weight: $gl-font-weight-bold;
P
Phil Hughes 已提交
324 325
}

326 327
/** CODE **/
pre {
328
  font-family: $monospace-font;
329
  display: block;
330
  padding: $gl-padding-8 $input-horizontal-padding;
331 332 333 334 335 336 337 338
  margin: 0 0 $gl-padding-8;
  font-size: 13px;
  word-break: break-all;
  word-wrap: break-word;
  color: $gl-text-color;
  background-color: $gray-light;
  border: 1px solid $border-color;
  border-radius: $border-radius-small;
339 340
}

341 342 343 344 345 346 347
code {
  &.key-fingerprint {
    background: $body-bg;
    color: $text-color;
  }
}

348
.monospace {
349
  font-family: $monospace-font;
350 351
}

352 353 354 355
.weight-normal {
  font-weight: $gl-font-weight-normal;
}

356
.commit-sha,
357 358
.ref-name,
.pipeline-number {
359 360 361 362 363 364 365 366
  @extend .monospace;
  font-size: 95%;
}

.git-revision-dropdown .dropdown-content ul li a {
  @extend .ref-name;
}

D
Dmitriy Zaporozhets 已提交
367
/**
368
 * Apply Markdown typography
D
Dmitriy Zaporozhets 已提交
369 370
 *
 */
C
Clement Ho 已提交
371
.wiki:not(.use-csslab) {
372
  @include md-typography;
D
Dmitriy Zaporozhets 已提交
373
}
374

C
Clement Ho 已提交
375
.md:not(.use-csslab) {
376 377
  @include md-typography;
}
378 379 380 381 382

/**
 * Textareas intended for GFM
 *
 */
383
textarea.js-gfm-input {
384
  font-family: $monospace-font;
385 386 387
  font-size: 13px;
}

M
Michael Clarke 已提交
388 389
.strikethrough {
  text-decoration: line-through;
390
}
391

392 393 394 395
h1,
h2,
h3,
h4 {
396
  small {
T
tauriedavis 已提交
397
    color: $gl-text-color;
398 399
  }
}
P
Phil Hughes 已提交
400 401

.text-right-lg {
C
Clement Ho 已提交
402
  @include media-breakpoint-up(lg) {
P
Phil Hughes 已提交
403 404 405
    text-align: right;
  }
}
406 407

.idiff.deletion {
R
Rémy Coutable 已提交
408
  background: $line-removed-dark;
409 410 411
}

.idiff.addition {
R
Rémy Coutable 已提交
412
  background: $line-added-dark;
413
}
A
Andy 已提交
414 415 416 417 418 419 420 421


/**
 * form text input i.e. search bar, comments, forms, etc.
 */
input,
textarea {
  &::-webkit-input-placeholder {
A
Annabel Gray 已提交
422
    color: $gl-text-color-tertiary;
A
Andy 已提交
423 424 425 426
  }

  // support firefox 19+ vendor prefix
  &::-moz-placeholder {
A
Annabel Gray 已提交
427
    color: $gl-text-color-tertiary;
A
Andy 已提交
428 429 430 431 432 433
    opacity: 1; // FF defaults to 0.54
  }

  // scss-lint:disable PseudoElement
  // support Edge vendor prefix
  &::-ms-input-placeholder {
A
Annabel Gray 已提交
434
    color: $gl-text-color-tertiary;
A
Andy 已提交
435 436 437 438 439
  }

  // scss-lint:disable PseudoElement
  // support IE vendor prefix
  &:-ms-input-placeholder {
A
Annabel Gray 已提交
440
    color: $gl-text-color-tertiary;
A
Andy 已提交
441 442
  }
}
443 444

.lh-100 { line-height: 1; }