typography.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /* ==========================================================================
  2. Typography
  3. ========================================================================== */
  4. /*
  5. Headings
  6. ========================================================================== */
  7. h1, h2, h3, h4, h5, h6 {
  8. font-family: $heading-font;
  9. }
  10. h1 {
  11. @include font-size(32);
  12. line-height: 1;
  13. }
  14. h2 {
  15. @include font-size(28);
  16. line-height: 1;
  17. }
  18. h3 {
  19. @include font-size(24);
  20. }
  21. h4 {
  22. @include font-size(18);
  23. }
  24. h5 {
  25. @include font-size(16);
  26. }
  27. h6 {
  28. @include font-size(14);
  29. }
  30. /*
  31. Links
  32. ========================================================================== */
  33. a {
  34. text-decoration: none;
  35. color: $link-coloralt;
  36. &:visited {
  37. color: $linkcoloraltvisited;
  38. }
  39. &:hover {
  40. color: $linkcoloralthover;
  41. }
  42. &:focus {
  43. outline: thin dotted;
  44. color: $linkcoloraltfocus;
  45. }
  46. &:hover,
  47. &:active {
  48. outline: 0;
  49. }
  50. }
  51. /*
  52. Figure captions
  53. ========================================================================== */
  54. figcaption {
  55. padding-top: 10px;
  56. @include font(14);
  57. line-height: 1.3;
  58. color: lighten($text-color, 10);
  59. }
  60. /*
  61. Feature image captions
  62. ========================================================================== */
  63. .image-credit {
  64. @include grid(12,10);
  65. @include prefix(12,1);
  66. @include suffix(12,1);
  67. display: block;
  68. text-align: right;
  69. @include font(12);
  70. line-height: 1.3;
  71. font-style: italic;
  72. color: lighten($text-color, 30);
  73. @media #{$small} {
  74. @include grid(12,9);
  75. @include prefix(12,0);
  76. @include suffix(12,0);
  77. }
  78. @media #{$x-large} {
  79. @include grid(12,8.5);
  80. }
  81. a {
  82. color: lighten($text-color, 30);
  83. }
  84. }
  85. /*
  86. Notices
  87. ========================================================================== */
  88. .notice {
  89. margin-top: 1.5em;
  90. padding: .5em 1em;
  91. text-indent: 0;
  92. @include font-rem(14);
  93. background-color: $body-color;
  94. border: 1px solid darken($body-color,20);
  95. @include rounded(3px);
  96. }
  97. /*
  98. Blockquotes
  99. ========================================================================== */
  100. blockquote {
  101. margin-left: -28px;
  102. padding-left: 20px;
  103. border-left: 8px solid $border-color;
  104. font-family: $alt-font;
  105. font-style: italic;
  106. }
  107. /*
  108. Footnotes
  109. ========================================================================== */
  110. .footnotes {
  111. ol, li, p {
  112. margin-bottom: 0;
  113. @include font-rem(14);
  114. }
  115. }
  116. /*
  117. Paragraphs
  118. ========================================================================== */
  119. p {
  120. font-size: 1.1rem;
  121. margin: 0 0 $indent-var;
  122. /* text-align: justify; */
  123. /* Do not justify the text until all major web browsers support
  124. hyphens for lang="fr" which is not the case for Chrome yet. See
  125. https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens#Browser_compatibility
  126. */
  127. -webkit-hyphens: auto;
  128. -ms-hyphens: auto;
  129. -o-hyphens: auto;
  130. -moz-hyphens: auto;
  131. hyphens: auto;
  132. & + p {
  133. margin-top: -($indent-var);
  134. }
  135. }
  136. .post article, .page article {
  137. @if $paragraph-indent == true {
  138. p {
  139. text-indent: $indent-var;
  140. &.noindent, &.notice {
  141. text-indent: 0;
  142. }
  143. }
  144. blockquote, table, figure, header, footer, .noindent {
  145. p {
  146. text-indent: 0;
  147. }
  148. }
  149. }
  150. }
  151. /*
  152. Code snippets
  153. ========================================================================== */
  154. tt, code, kbd, samp, pre {
  155. font-family: $code-font;
  156. }
  157. p,
  158. li {
  159. code {
  160. @include font-rem(12);
  161. line-height: 1.5;
  162. white-space: nowrap;
  163. margin: 0 2px;
  164. padding: 0 5px;
  165. border: 1px solid lighten($black, 90);
  166. background-color: #efefef;
  167. @include rounded(3px);
  168. }
  169. }
  170. pre {
  171. @include font-rem(12);
  172. line-height: 1.5;
  173. overflow-x: auto;
  174. }