summaryrefslogtreecommitdiff
path: root/partials/_x-normalize.scss
blob: 4cf2de309ab413d0ee9742bbc7dd2544c2f5655c (plain)
  1. // fork of compass-h5bp 0.1.2, with overridable sizes
  2. //
  3. // No styleguide reference.
  4. @import "h5bp";
  5. $x-normalize-typography-p-margin: 1em 0 !default;
  6. $x-normalize-typography-h1-fontsize: 2em !default;
  7. $x-normalize-typography-h2-fontsize: 1.5em !default;
  8. $x-normalize-typography-h3-fontsize: 1.17em !default;
  9. $x-normalize-typography-h4-fontsize: 1em !default;
  10. $x-normalize-typography-h5-fontsize: 0.83em !default;
  11. $x-normalize-typography-h6-fontsize: 0.67em !default;
  12. $x-normalize-typography-h1-margin: 0.67em 0 !default;
  13. $x-normalize-typography-h2-margin: 0.83em 0 !default;
  14. $x-normalize-typography-h3-margin: 1em 0 !default;
  15. $x-normalize-typography-h4-margin: 1.33em 0 !default;
  16. $x-normalize-typography-h5-margin: 1.67em 0 !default;
  17. $x-normalize-typography-h6-margin: 2.33em 0 !default;
  18. $x-normalize-typography-blockquote-margin: 1em 40px !default;
  19. $x-normalize-typography-pre-fontsize: 1em !default;
  20. $x-normalize-lists-lists-margin: 1em 0 !default;
  21. $x-normalize-lists-dd-margin: 0 0 0 40px !default;
  22. $x-normalize-lists-lists-padding: 0 0 0 40px !default;
  23. $x-normalize-typography-small-fontsize: 80% !default;
  24. $x-normalize-typography-supsub-fontsize: 75% !default;
  25. $x-normalize-typography-sup-top: -0.5em !default;
  26. $x-normalize-typography-sub-bottom: -0.25em !default;
  27. @mixin x-normalize {
  28. @include x-normalize-display;
  29. @include x-normalize-base;
  30. @include x-normalize-links;
  31. @include x-normalize-typography;
  32. @include x-normalize-lists;
  33. @include x-normalize-embeds;
  34. @include x-normalize-figures;
  35. @include x-normalize-forms;
  36. @include x-normalize-tables;
  37. }
  38. @mixin x-normalize-display {
  39. @include h5bp-display;
  40. }
  41. @mixin x-normalize-base {
  42. @include h5bp-base;
  43. }
  44. @mixin x-normalize-links {
  45. @include h5bp-links;
  46. }
  47. @mixin x-normalize-typography (
  48. $p-margin: $x-normalize-typography-p-margin,
  49. $h1-fontsize: $x-normalize-typography-h1-fontsize,
  50. $h2-fontsize: $x-normalize-typography-h2-fontsize,
  51. $h3-fontsize: $x-normalize-typography-h3-fontsize,
  52. $h4-fontsize: $x-normalize-typography-h4-fontsize,
  53. $h5-fontsize: $x-normalize-typography-h5-fontsize,
  54. $h6-fontsize: $x-normalize-typography-h6-fontsize,
  55. $h1-margin: $x-normalize-typography-h1-margin,
  56. $h2-margin: $x-normalize-typography-h2-margin,
  57. $h3-margin: $x-normalize-typography-h3-margin,
  58. $h4-margin: $x-normalize-typography-h4-margin,
  59. $h5-margin: $x-normalize-typography-h5-margin,
  60. $h6-margin: $x-normalize-typography-h6-margin,
  61. $blockquote-margin: $x-normalize-typography-blockquote-margin,
  62. $pre-fontsize: $x-normalize-typography-pre-fontsize,
  63. $mall-fontsize: $x-normalize-typography-small-fontsize,
  64. $supsub-fontsize: $x-normalize-typography-supsub-fontsize,
  65. $sup-top: $x-normalize-typography-sup-top,
  66. $sub-bottom: $x-normalize-typography-sub-bottom
  67. ) {
  68. // Address font sizes and margins set differently in IE 6/7.
  69. // Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
  70. // and Chrome.
  71. h1 {
  72. font-size: $h1-fontsize;
  73. margin: $h1-margin;
  74. }
  75. h2 {
  76. font-size: $h2-fontsize;
  77. margin: $h2-margin;
  78. }
  79. h3 {
  80. font-size: $h3-fontsize;
  81. margin: $h3-margin;
  82. }
  83. h4 {
  84. font-size: $h4-fontsize;
  85. margin: $h4-margin;
  86. }
  87. h5 {
  88. font-size: $h5-fontsize;
  89. margin: $h5-margin;
  90. }
  91. h6 {
  92. font-size: $h6-fontsize;
  93. margin: $h6-margin;
  94. }
  95. // Address styling not present in IE 7/8/9, Safari 5, and Chrome.
  96. abbr[title] {
  97. border-bottom: 1px dotted;
  98. }
  99. // Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
  100. b,
  101. strong {
  102. font-weight: bold;
  103. }
  104. blockquote {
  105. margin: $blockquote-margin;
  106. }
  107. // Address styling not present in Safari 5 and Chrome.
  108. dfn {
  109. font-style: italic;
  110. }
  111. // Address differences between Firefox and other browsers.
  112. // Known issue: no IE 6/7 normalization.
  113. hr {
  114. -moz-box-sizing: content-box;
  115. box-sizing: content-box;
  116. height: 0;
  117. }
  118. // Address styling not present in IE 6/7/8/9.
  119. mark {
  120. background: #ff0;
  121. color: #000;
  122. }
  123. // Address margins set differently in IE 6/7.
  124. p,
  125. pre {
  126. margin: $p-margin;
  127. }
  128. // Correct font family set oddly in IE 6, Safari 4/5, and Chrome.
  129. code,
  130. kbd,
  131. pre,
  132. samp {
  133. font-family: monospace, serif;
  134. _font-family: 'courier new', monospace;
  135. font-size: $pre-fontsize;
  136. }
  137. // Improve readability of pre-formatted text in all browsers.
  138. pre {
  139. white-space: pre;
  140. white-space: pre-wrap;
  141. word-wrap: break-word;
  142. }
  143. // Address CSS quotes not supported in IE 6/7.
  144. q {
  145. quotes: none;
  146. }
  147. // Address `quotes` property not supported in Safari 4.
  148. q:before,
  149. q:after {
  150. content: '';
  151. content: none;
  152. }
  153. // Address inconsistent and variable font size in all browsers.
  154. small {
  155. font-size: $mall-fontsize;
  156. }
  157. // Prevent `sub` and `sup` affecting `line-height` in all browsers.
  158. sub,
  159. sup {
  160. font-size: $supsub-fontsize;
  161. line-height: 0;
  162. position: relative;
  163. vertical-align: baseline;
  164. }
  165. sup {
  166. top: $sup-top;
  167. }
  168. sub {
  169. bottom: $sub-bottom;
  170. }
  171. }
  172. @mixin x-normalize-lists (
  173. // $margin-vertical: $x-normalize-lists-margin-vertical,
  174. $lists-margin: $x-normalize-lists-lists-margin,
  175. $dd-margin: $x-normalize-lists-dd-margin,
  176. $lists-padding: $x-normalize-lists-lists-padding
  177. ) {
  178. // Address margins set differently in IE 6/7.
  179. dl,
  180. menu,
  181. ol,
  182. ul {
  183. margin: $lists-margin;
  184. }
  185. dd {
  186. margin: $dd-margin;
  187. }
  188. // Address paddings set differently in IE 6/7.
  189. menu,
  190. ol,
  191. ul {
  192. padding: $lists-padding;
  193. }
  194. // Correct list images handled incorrectly in IE 7.
  195. nav ul,
  196. nav ol {
  197. list-style: none;
  198. list-style-image: none;
  199. }
  200. }
  201. @mixin x-normalize-embeds {
  202. @include h5bp-embeds;
  203. }
  204. @mixin x-normalize-figures {
  205. @include h5bp-figures;
  206. }
  207. @mixin x-normalize-forms {
  208. @include h5bp-forms;
  209. }
  210. @mixin x-normalize-tables {
  211. @include h5bp-tables;
  212. }