typography.scss 4.07 KB
Newer Older
1 2
@mixin md-typography {
  color: $md-text-color;
3
  word-wrap: break-word;
4 5 6 7 8 9 10 11 12 13 14 15 16

  a {
    color: $md-link-color;
  }

  img {
    max-width: 100%;
  }

  *:first-child {
    margin-top: 0;
  }

17
  // Single code lines should wrap
18 19
  code {
    font-family: $monospace_font;
20
    white-space: pre-wrap;
21 22 23
    word-wrap: normal;
  }

24 25 26 27 28 29 30
  // Multi-line code blocks should scroll horizontally
  pre {
    code {
      white-space: pre;
    }
  }

31 32 33 34 35 36 37
  kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
    color: #555;
    vertical-align: middle;
38
    background-color: #fcfcfc;
39 40
    border-width: 1px;
    border-style: solid;
41
    border-color: #ccc #ccc #bbb;
42 43
    border-image: none;
    border-radius: 3px;
44
    box-shadow: 0 -1px 0 #bbb inset;
45 46 47
  }

  h1 {
48
    font-size: 2em;
49
    font-weight: 600;
50 51 52
    margin: 1em 0 10px;
    padding: 0 0 0.3em;
    border-bottom: 1px solid $btn-default-border;
Annabel Dunstone's avatar
Annabel Dunstone committed
53
    color: $gl-gray-dark;
54 55 56
  }

  h2 {
57
    font-size: 1.6em;
58
    font-weight: 600;
59 60 61
    margin: 1em 0 10px;
    padding-bottom: 0.3em;
    border-bottom: 1px solid $btn-default-border;
Annabel Dunstone's avatar
Annabel Dunstone committed
62
    color: $gl-gray-dark;
63 64 65
  }

  h3 {
66
    margin: 1em 0 10px;
67
    font-size: 1.4em;
68 69 70
  }

  h4 {
71 72
    margin: 1em 0 10px;
    font-size: 1.25em;
73 74 75
  }

  h5 {
76 77
    margin: 1em 0 10px;
    font-size: 1em;
78 79 80
  }

  h6 {
81 82
    margin: 1em 0 10px;
    font-size: 0.95em;
83 84 85
  }

  blockquote {
86 87
    color: #7f8fa4;
    font-size: inherit;
88
    padding: 8px 21px;
89
    margin: 12px 0;
90 91 92 93 94
    border-left: 3px solid #e7e9ed;
  }

  blockquote p {
    color: #7f8fa4 !important;
95
    font-size: inherit;
96 97 98 99
    line-height: 1.5;
  }

  p {
100
    color: #5c5d5e;
101
    margin: 6px 0 0;
102 103 104 105 106
  }

  table {
    @extend .table;
    @extend .table-bordered;
107
    margin: 12px 0;
108 109 110 111 112 113 114
    color: #5c5d5e;
    th {
      background: #f8fafc;
    }
  }

  pre {
115
    margin: 12px 0;
116 117 118
    font-size: 13px;
    line-height: 1.6em;
    overflow-x: auto;
119 120 121 122 123 124 125
    @include border-radius(2px);
  }

  p > code {
    font-weight: inherit;
  }

126 127
  ul, ol {
    padding: 0;
128
    margin: 3px 0 3px 28px !important;
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
  }

  li {
    line-height: 1.6em;
  }

  a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] {
    &:before {
      margin-right: 4px;

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

    &:hover:before {
      text-decoration: none;
    }
  }
150

151 152 153 154 155 156
  a.no-attachment-icon {
    &:before {
      display: none;
    }
  }

157 158 159 160 161
  /* Link to current header. */
  h1, h2, h3, h4, h5, h6 {
    position: relative;

    a.anchor {
162 163 164 165 166
      left: -16px;
      position: absolute;
      text-decoration: none;

      &:after {
167
        content: image-url('icon_anchor.svg');
168 169
        visibility: hidden;
      }
170 171
    }

172 173
    &:hover > a.anchor:after {
      visibility: visible;
174 175
    }
  }
176 177 178
}


179
/**
180
 * Headers
181
 *
182
 */
Andrey's avatar
Andrey committed
183 184 185
body {
  -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px;
}
186

187
.page-title {
188
  margin-top: $gl-padding;
189 190 191
  line-height: 1.3;
  font-size: 1.25em;
  font-weight: 600;
192 193 194 195

  &:last-child {
    margin-bottom: 0;
  }
Andrey's avatar
Andrey committed
196 197 198
}

.page-title-empty {
199
  margin-top: 0;
Andrey's avatar
Andrey committed
200 201 202
  line-height: 1.3;
  font-size: 1.25em;
  font-weight: 600;
203
  margin: 12px 7px;
204 205
}

206 207
h1, h2, h3, h4, h5, h6 {
  color: $gl-header-color;
Phil Hughes's avatar
Phil Hughes committed
208
  font-weight: 600;
209 210
}

Phil Hughes's avatar
Phil Hughes committed
211 212 213 214
.light-header {
  font-weight: 600;
}

215 216
/** CODE **/
pre {
217
  font-family: $monospace_font;
218

219 220 221 222 223 224 225
  &.plain-readme {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
  }
226 227
}

228
.monospace {
229
  font-family: $monospace_font;
230
  font-size: 90%;
231
}
232

233 234 235 236 237 238 239
code {
  &.key-fingerprint {
    background: $body-bg;
    color: $text-color;
  }
}

240 241 242 243
a > code {
  color: $link-color;
}

244
/**
245
 * Apply Markdown typography
246 247 248
 *
 */
.wiki {
249
  @include md-typography;
250
}
251 252 253 254

.md {
  @include md-typography;
}
255 256 257 258 259

/**
 * Textareas intended for GFM
 *
 */
260 261
.strikethrough {
  text-decoration: line-through;
262
}
263 264 265 266 267 268

h1, h2, h3, h4 {
  small {
    color: $gl-gray;
  }
}
Phil Hughes's avatar
Phil Hughes committed
269 270 271 272 273 274

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

.idiff.deletion {
277
  background: $line-removed-dark;
278 279 280
}

.idiff.addition {
281
  background: $line-added-dark;
282
}