typography.scss 6.05 KB
Newer Older
1
@mixin md-typography {
2
  color: $gl-text-color;
3
  word-wrap: break-word;
4

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

9 10 11 12 13 14
  a {
    color: $md-link-color;
  }

  img {
    max-width: 100%;
15 16 17 18 19 20 21
    margin: 0 0 8px;
  }

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

24
  *:first-child:not(.katex-display) {
25 26 27
    margin-top: 0;
  }

28 29 30 31
  > :last-child {
    margin-bottom: 0;
  }

32
  // Single code lines should wrap
33 34
  code {
    font-family: $monospace_font;
35
    white-space: pre-wrap;
36 37 38
    word-wrap: normal;
  }

39 40 41 42 43 44 45
  // Multi-line code blocks should scroll horizontally
  pre {
    code {
      white-space: pre;
    }
  }

46 47 48 49 50
  kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
51
    color: $kdb-color;
52
    vertical-align: middle;
53
    background-color: $kdb-bg;
54 55
    border-width: 1px;
    border-style: solid;
56
    border-color: $kdb-border $kdb-border $kdb-border-bottom;
57 58
    border-image: none;
    border-radius: 3px;
59
    box-shadow: 0 -1px 0 $kdb-shadow inset;
60 61 62
  }

  h1 {
63
    font-size: 1.75em;
64
    font-weight: 600;
65 66
    margin: 24px 0 16px;
    padding-bottom: 0.3em;
67
    border-bottom: 1px solid $white-dark;
68
    color: $gl-text-color;
69 70 71 72

    &:first-child {
      margin-top: 0;
    }
73 74 75
  }

  h2 {
76
    font-size: 1.5em;
77
    font-weight: 600;
78 79 80
    margin: 24px 0 16px;
    padding-bottom: 0.3em;
    border-bottom: 1px solid $white-dark;
81
    color: $gl-text-color;
82 83 84
  }

  h3 {
85
    margin: 24px 0 16px;
86
    font-size: 1.3em;
87 88 89
  }

  h4 {
90
    margin: 24px 0 16px;
91
    font-size: 1.2em;
92 93 94
  }

  h5 {
95
    margin: 24px 0 16px;
96
    font-size: 1em;
97 98 99
  }

  h6 {
100
    margin: 24px 0 16px;
101
    font-size: 0.95em;
102 103 104
  }

  blockquote {
105
    color: $gl-grayish-blue;
106
    font-size: inherit;
107 108
    padding: 8px 24px;
    margin: 16px 0;
109
    border-left: 3px solid $white-dark;
110 111
  }

112 113
  blockquote:dir(rtl) {
    border-left: 0;
114
    border-right: 3px solid $white-dark;
115 116
  }

117
  blockquote p {
118
    color: $gl-grayish-blue !important;
119
    font-size: inherit;
120
    line-height: 1.5;
121 122 123 124

    &:last-child {
      margin: 0;
    }
125 126 127
  }

  p {
128
    color: $gl-text-color;
129
    margin: 0 0 16px;
130 131 132 133 134
  }

  table {
    @extend .table;
    @extend .table-bordered;
135
    margin: 16px 0;
136
    color: $gl-text-color;
137

138
    th {
139
      background: $label-gray-bg;
140 141 142
    }
  }

143 144 145 146
  table:dir(rtl) th {
    text-align: right;
  }

147
  pre {
148
    margin-bottom: 16px;
149 150 151
    font-size: 13px;
    line-height: 1.6em;
    overflow-x: auto;
Clement Ho's avatar
Clement Ho committed
152
    border-radius: 2px;
153 154 155 156 157 158 159 160 161


    &.plain-readme {
      background: none;
      border: none;
      padding: 0;
      margin: 0;
      font-size: 14px;
    }
162 163 164 165 166 167
  }

  p > code {
    font-weight: inherit;
  }

168 169
  ul,
  ol {
170
    padding: 0;
171
    margin: 0 0 16px;
172 173
  }

174 175
  ul:dir(rtl),
  ol:dir(rtl) {
176 177 178
    margin: 3px 28px 3px 0 !important;
  }

179 180
  li {
    line-height: 1.6em;
181 182 183 184 185 186 187 188 189 190 191
    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 {
192
    > li.task-list-item {
193 194
      list-style-type: none;
      position: relative;
195
      min-height: 22px;
196 197 198
      padding-left: 28px;
      margin-left: 0 !important;

199
      > input.task-list-item-checkbox {
200 201 202 203 204
        position: absolute;
        left: 8px;
        top: 5px;
      }
    }
205 206
  }

207 208
  a[href*="/uploads/"],
  a[href*="storage.googleapis.com/google-code-attachments/"] {
209
    &::before {
210 211 212 213 214 215 216 217 218
      margin-right: 4px;

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

219
    &:hover::before {
220 221 222
      text-decoration: none;
    }
  }
223

224
  a.no-attachment-icon {
225
    &::before {
226 227 228 229
      display: none;
    }
  }

230
  /* Link to current header. */
231 232 233 234 235 236
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
237 238 239
    position: relative;

    a.anchor {
240 241 242
      left: -16px;
      position: absolute;
      text-decoration: none;
243
      outline: none;
244

245
      &::after {
246
        content: image-url('icon_anchor.svg');
247 248
        visibility: hidden;
      }
249 250
    }

251
    &:hover > a.anchor::after {
252
      visibility: visible;
253 254
    }
  }
255 256 257
}


258
/**
259
 * Headers
260
 *
261
 */
Andrey's avatar
Andrey committed
262
body {
263
  -webkit-text-shadow: $body-text-shadow 0 0 1px;
Andrey's avatar
Andrey committed
264
}
265

266
.page-title {
267
  margin-top: $gl-padding;
268 269 270
  line-height: 1.3;
  font-size: 1.25em;
  font-weight: 600;
271 272 273 274

  &:last-child {
    margin-bottom: 0;
  }
Andrey's avatar
Andrey committed
275 276 277
}

.page-title-empty {
278
  margin-top: 0;
Andrey's avatar
Andrey committed
279 280 281
  line-height: 1.3;
  font-size: 1.25em;
  font-weight: 600;
282
  margin: 12px 7px;
283 284
}

285 286 287 288 289 290
h1,
h2,
h3,
h4,
h5,
h6 {
291
  color: $gl-text-color;
Phil Hughes's avatar
Phil Hughes committed
292
  font-weight: 600;
293 294
}

Phil Hughes's avatar
Phil Hughes committed
295 296 297 298
.light-header {
  font-weight: 600;
}

299 300
/** CODE **/
pre {
301
  font-family: $monospace_font;
302 303
}

304 305 306 307 308 309 310
code {
  &.key-fingerprint {
    background: $body-bg;
    color: $text-color;
  }
}

311 312 313 314
a > code {
  color: $link-color;
}

315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
.monospace {
  font-family: $monospace_font;
}

.commit-sha,
.ref-name {
  @extend .monospace;
  font-size: 95%;
}

.git-revision-dropdown-toggle {
  @extend .monospace;
}

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

333
/**
334
 * Apply Markdown typography
335 336 337
 *
 */
.wiki {
338
  @include md-typography;
339
}
340 341 342 343

.md {
  @include md-typography;
}
344 345 346 347 348

/**
 * Textareas intended for GFM
 *
 */
349 350 351 352 353
textarea.js-gfm-input {
  font-family: $monospace_font;
  font-size: 13px;
}

354 355
.strikethrough {
  text-decoration: line-through;
356
}
357

358 359 360 361
h1,
h2,
h3,
h4 {
362
  small {
363
    color: $gl-text-color;
364 365
  }
}
Phil Hughes's avatar
Phil Hughes committed
366 367 368 369 370 371

.text-right-lg {
  @media (min-width: $screen-lg-min) {
    text-align: right;
  }
}
372 373

.idiff.deletion {
374
  background: $line-removed-dark;
375 376 377
}

.idiff.addition {
378
  background: $line-added-dark;
379
}
Andy's avatar
Andy committed
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408


/**
 * form text input i.e. search bar, comments, forms, etc.
 */
input,
textarea {
  &::-webkit-input-placeholder {
    color: $placeholder-text-color;
  }

  // support firefox 19+ vendor prefix
  &::-moz-placeholder {
    color: $placeholder-text-color;
    opacity: 1; // FF defaults to 0.54
  }

  // scss-lint:disable PseudoElement
  // support Edge vendor prefix
  &::-ms-input-placeholder {
    color: $placeholder-text-color;
  }

  // scss-lint:disable PseudoElement
  // support IE vendor prefix
  &:-ms-input-placeholder {
    color: $placeholder-text-color;
  }
}