_type.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. // Foundation by ZURB
  2. // foundation.zurb.com
  3. // Licensed under MIT Open Source
  4. @import "global";
  5. $include-html-type-classes: $include-html-classes !default;
  6. // We use these to control header font styles
  7. $header-font-family: $body-font-family !default;
  8. $header-font-weight: $font-weight-normal !default;
  9. $header-font-style: normal !default;
  10. $header-font-color: $jet !default;
  11. $header-line-height: 1.4 !default;
  12. $header-top-margin: .2rem !default;
  13. $header-bottom-margin: .5rem !default;
  14. $header-text-rendering: optimizeLegibility !default;
  15. // We use these to control header font sizes
  16. $h1-font-size: rem-calc(44) !default;
  17. $h2-font-size: rem-calc(37) !default;
  18. $h3-font-size: rem-calc(27) !default;
  19. $h4-font-size: rem-calc(23) !default;
  20. $h5-font-size: rem-calc(18) !default;
  21. $h6-font-size: 1rem !default;
  22. // We use these to control header size reduction on small screens
  23. $h1-font-reduction: rem-calc(10) !default;
  24. $h2-font-reduction: rem-calc(10) !default;
  25. $h3-font-reduction: rem-calc(5) !default;
  26. $h4-font-reduction: rem-calc(5) !default;
  27. $h5-font-reduction: 0 !default;
  28. $h6-font-reduction: 0 !default;
  29. // These control how subheaders are styled.
  30. $subheader-line-height: 1.4 !default;
  31. $subheader-font-color: scale-color($header-font-color, $lightness: 35%) !default;
  32. $subheader-font-weight: $font-weight-normal !default;
  33. $subheader-top-margin: .2rem !default;
  34. $subheader-bottom-margin: .5rem !default;
  35. // A general <small> styling
  36. $small-font-size: 60% !default;
  37. $small-font-color: scale-color($header-font-color, $lightness: 35%) !default;
  38. // We use these to style paragraphs
  39. $paragraph-font-family: inherit !default;
  40. $paragraph-font-weight: $font-weight-normal !default;
  41. $paragraph-font-size: 1rem !default;
  42. $paragraph-line-height: 1.6 !default;
  43. $paragraph-margin-bottom: rem-calc(20) !default;
  44. $paragraph-aside-font-size: rem-calc(14) !default;
  45. $paragraph-aside-line-height: 1.35 !default;
  46. $paragraph-aside-font-style: italic !default;
  47. $paragraph-text-rendering: optimizeLegibility !default;
  48. // We use these to style <code> tags
  49. $code-color: $oil !default;
  50. $code-font-family: $font-family-monospace !default;
  51. $code-font-weight: $font-weight-normal !default;
  52. $code-background-color: scale-color($secondary-color, $lightness: 70%) !default;
  53. $code-border-size: 1px !default;
  54. $code-border-style: solid !default;
  55. $code-border-color: scale-color($code-background-color, $lightness: -10%) !default;
  56. $code-padding: rem-calc(2) rem-calc(5) rem-calc(1) !default;
  57. // We use these to style anchors
  58. $anchor-text-decoration: none !default;
  59. $anchor-text-decoration-hover: none !default;
  60. $anchor-font-color: $primary-color !default;
  61. $anchor-font-color-hover: scale-color($anchor-font-color, $lightness: -14%) !default;
  62. // We use these to style the <hr> element
  63. $hr-border-width: 1px !default;
  64. $hr-border-style: solid !default;
  65. $hr-border-color: $gainsboro !default;
  66. $hr-margin: rem-calc(20) !default;
  67. // We use these to style lists
  68. $list-font-family: $paragraph-font-family !default;
  69. $list-font-size: $paragraph-font-size !default;
  70. $list-line-height: $paragraph-line-height !default;
  71. $list-margin-bottom: $paragraph-margin-bottom !default;
  72. $list-style-position: outside !default;
  73. $list-side-margin: 1.1rem !default;
  74. $list-ordered-side-margin: 1.4rem !default;
  75. $list-side-margin-no-bullet: 0 !default;
  76. $list-nested-margin: rem-calc(20) !default;
  77. $definition-list-header-weight: $font-weight-bold !default;
  78. $definition-list-header-margin-bottom: .3rem !default;
  79. $definition-list-margin-bottom: rem-calc(12) !default;
  80. // We use these to style blockquotes
  81. $blockquote-font-color: scale-color($header-font-color, $lightness: 35%) !default;
  82. $blockquote-padding: rem-calc(9 20 0 19) !default;
  83. $blockquote-border: 1px solid $gainsboro !default;
  84. $blockquote-cite-font-size: rem-calc(13) !default;
  85. $blockquote-cite-font-color: scale-color($header-font-color, $lightness: 23%) !default;
  86. $blockquote-cite-link-color: $blockquote-cite-font-color !default;
  87. // Acronym styles
  88. $acronym-underline: 1px dotted $gainsboro !default;
  89. // We use these to control padding and margin
  90. $microformat-padding: rem-calc(10 12) !default;
  91. $microformat-margin: rem-calc(0 0 20 0) !default;
  92. // We use these to control the border styles
  93. $microformat-border-width: 1px !default;
  94. $microformat-border-style: solid !default;
  95. $microformat-border-color: $gainsboro !default;
  96. // We use these to control full name font styles
  97. $microformat-fullname-font-weight: $font-weight-bold !default;
  98. $microformat-fullname-font-size: rem-calc(15) !default;
  99. // We use this to control the summary font styles
  100. $microformat-summary-font-weight: $font-weight-bold !default;
  101. // We use this to control abbr padding
  102. $microformat-abbr-padding: rem-calc(0 1) !default;
  103. // We use this to control abbr font styles
  104. $microformat-abbr-font-weight: $font-weight-bold !default;
  105. $microformat-abbr-font-decoration: none !default;
  106. // Text alignment class names
  107. $align-class-names:
  108. small-only,
  109. small,
  110. medium-only,
  111. medium,
  112. large-only,
  113. large,
  114. xlarge-only,
  115. xlarge,
  116. xxlarge-only,
  117. xxlarge;
  118. // Text alignment breakpoints
  119. $align-class-breakpoints:
  120. $small-only,
  121. $small-up,
  122. $medium-only,
  123. $medium-up,
  124. $large-only,
  125. $large-up,
  126. $xlarge-only,
  127. $xlarge-up,
  128. $xxlarge-only,
  129. $xxlarge-up;
  130. // Generates text align and justify classes
  131. @mixin align-classes{
  132. .text-left { text-align: left !important; }
  133. .text-right { text-align: right !important; }
  134. .text-center { text-align: center !important; }
  135. .text-justify { text-align: justify !important; }
  136. @for $i from 1 through length($align-class-names) {
  137. @media #{(nth($align-class-breakpoints, $i))} {
  138. .#{(nth($align-class-names, $i))}-text-left { text-align: left !important; }
  139. .#{(nth($align-class-names, $i))}-text-right { text-align: right !important; }
  140. .#{(nth($align-class-names, $i))}-text-center { text-align: center !important; }
  141. .#{(nth($align-class-names, $i))}-text-justify { text-align: justify !important; }
  142. }
  143. }
  144. }
  145. //
  146. // Typography Placeholders
  147. //
  148. // These will throw a deprecation warning if used within a media query.
  149. @mixin lead {
  150. font-size: $paragraph-font-size + rem-calc(3.5);
  151. line-height: 1.6;
  152. }
  153. @mixin subheader {
  154. line-height: $subheader-line-height;
  155. color: $subheader-font-color;
  156. font-weight: $subheader-font-weight;
  157. margin-top: $subheader-top-margin;
  158. margin-bottom: $subheader-bottom-margin;
  159. }
  160. @include exports("type") {
  161. @if $include-html-type-classes {
  162. // Responsive Text alignment
  163. @include align-classes;
  164. /* Typography resets */
  165. div,
  166. dl,
  167. dt,
  168. dd,
  169. ul,
  170. ol,
  171. li,
  172. h1,
  173. h2,
  174. h3,
  175. h4,
  176. h5,
  177. h6,
  178. pre,
  179. form,
  180. p,
  181. blockquote,
  182. th,
  183. td {
  184. margin:0;
  185. padding:0;
  186. }
  187. /* Default Link Styles */
  188. a {
  189. color: $anchor-font-color;
  190. text-decoration: $anchor-text-decoration;
  191. line-height: inherit;
  192. &:hover,
  193. &:focus {
  194. color: $anchor-font-color-hover;
  195. @if $anchor-text-decoration-hover != $anchor-text-decoration {
  196. text-decoration: $anchor-text-decoration-hover;
  197. }
  198. }
  199. img { border:none; }
  200. }
  201. /* Default paragraph styles */
  202. p {
  203. font-family: $paragraph-font-family;
  204. font-weight: $paragraph-font-weight;
  205. font-size: $paragraph-font-size;
  206. line-height: $paragraph-line-height;
  207. margin-bottom: $paragraph-margin-bottom;
  208. text-rendering: $paragraph-text-rendering;
  209. &.lead { @include lead; }
  210. & aside {
  211. font-size: $paragraph-aside-font-size;
  212. line-height: $paragraph-aside-line-height;
  213. font-style: $paragraph-aside-font-style;
  214. }
  215. }
  216. /* Default header styles */
  217. h1, h2, h3, h4, h5, h6 {
  218. font-family: $header-font-family;
  219. font-weight: $header-font-weight;
  220. font-style: $header-font-style;
  221. color: $header-font-color;
  222. text-rendering: $header-text-rendering;
  223. margin-top: $header-top-margin;
  224. margin-bottom: $header-bottom-margin;
  225. line-height: $header-line-height;
  226. small {
  227. font-size: $small-font-size;
  228. color: $small-font-color;
  229. line-height: 0;
  230. }
  231. }
  232. h1 { font-size: $h1-font-size - $h1-font-reduction; }
  233. h2 { font-size: $h2-font-size - $h2-font-reduction; }
  234. h3 { font-size: $h3-font-size - $h3-font-reduction; }
  235. h4 { font-size: $h4-font-size - $h4-font-reduction; }
  236. h5 { font-size: $h5-font-size - $h5-font-reduction; }
  237. h6 { font-size: $h6-font-size - $h6-font-reduction; }
  238. .subheader { @include subheader; }
  239. hr {
  240. border: $hr-border-style $hr-border-color;
  241. border-width: $hr-border-width 0 0;
  242. clear: both;
  243. margin: $hr-margin 0 ($hr-margin - rem-calc($hr-border-width));
  244. height: 0;
  245. }
  246. /* Helpful Typography Defaults */
  247. em,
  248. i {
  249. font-style: italic;
  250. line-height: inherit;
  251. }
  252. strong,
  253. b {
  254. font-weight: $font-weight-bold;
  255. line-height: inherit;
  256. }
  257. small {
  258. font-size: $small-font-size;
  259. line-height: inherit;
  260. }
  261. code {
  262. font-family: $code-font-family;
  263. font-weight: $code-font-weight;
  264. color: $code-color;
  265. background-color: $code-background-color;
  266. border-width: $code-border-size;
  267. border-style: $code-border-style;
  268. border-color: $code-border-color;
  269. padding: $code-padding;
  270. }
  271. /* Lists */
  272. ul,
  273. ol,
  274. dl {
  275. font-size: $list-font-size;
  276. line-height: $list-line-height;
  277. margin-bottom: $list-margin-bottom;
  278. list-style-position: $list-style-position;
  279. font-family: $list-font-family;
  280. }
  281. ul {
  282. margin-#{$default-float}: $list-side-margin;
  283. &.no-bullet {
  284. margin-#{$default-float}: $list-side-margin-no-bullet;
  285. li {
  286. ul,
  287. ol {
  288. margin-#{$default-float}: $list-nested-margin;
  289. margin-bottom: 0;
  290. list-style: none;
  291. }
  292. }
  293. }
  294. }
  295. /* Unordered Lists */
  296. ul {
  297. li {
  298. ul,
  299. ol {
  300. margin-#{$default-float}: $list-nested-margin;
  301. margin-bottom: 0;
  302. }
  303. }
  304. &.square,
  305. &.circle,
  306. &.disc {
  307. li ul { list-style: inherit; }
  308. }
  309. &.square { list-style-type: square; margin-#{$default-float}: $list-side-margin;}
  310. &.circle { list-style-type: circle; margin-#{$default-float}: $list-side-margin;}
  311. &.disc { list-style-type: disc; margin-#{$default-float}: $list-side-margin;}
  312. &.no-bullet { list-style: none; }
  313. }
  314. /* Ordered Lists */
  315. ol {
  316. margin-#{$default-float}: $list-ordered-side-margin;
  317. li {
  318. ul,
  319. ol {
  320. margin-#{$default-float}: $list-nested-margin;
  321. margin-bottom: 0;
  322. }
  323. }
  324. }
  325. /* Definition Lists */
  326. dl {
  327. dt {
  328. margin-bottom: $definition-list-header-margin-bottom;
  329. font-weight: $definition-list-header-weight;
  330. }
  331. dd { margin-bottom: $definition-list-margin-bottom; }
  332. }
  333. /* Abbreviations */
  334. abbr,
  335. acronym {
  336. text-transform: uppercase;
  337. font-size: 90%;
  338. color: $body-font-color;
  339. cursor: $cursor-help-value;
  340. }
  341. abbr {
  342. text-transform: none;
  343. &[title] {
  344. border-bottom: $acronym-underline;
  345. }
  346. }
  347. /* Blockquotes */
  348. blockquote {
  349. margin: 0 0 $paragraph-margin-bottom;
  350. padding: $blockquote-padding;
  351. border-#{$default-float}: $blockquote-border;
  352. cite {
  353. display: block;
  354. font-size: $blockquote-cite-font-size;
  355. color: $blockquote-cite-font-color;
  356. &:before {
  357. content: "\2014 \0020";
  358. }
  359. a,
  360. a:visited {
  361. color: $blockquote-cite-link-color;
  362. }
  363. }
  364. }
  365. blockquote,
  366. blockquote p {
  367. line-height: $paragraph-line-height;
  368. color: $blockquote-font-color;
  369. }
  370. /* Microformats */
  371. .vcard {
  372. display: inline-block;
  373. margin: $microformat-margin;
  374. border: $microformat-border-width $microformat-border-style $microformat-border-color;
  375. padding: $microformat-padding;
  376. li {
  377. margin: 0;
  378. display: block;
  379. }
  380. .fn {
  381. font-weight: $microformat-fullname-font-weight;
  382. font-size: $microformat-fullname-font-size;
  383. }
  384. }
  385. .vevent {
  386. .summary { font-weight: $microformat-summary-font-weight; }
  387. abbr {
  388. cursor: $cursor-default-value;
  389. text-decoration: $microformat-abbr-font-decoration;
  390. font-weight: $microformat-abbr-font-weight;
  391. border: none;
  392. padding: $microformat-abbr-padding;
  393. }
  394. }
  395. @media #{$medium-up} {
  396. h1,h2,h3,h4,h5,h6 { line-height: $header-line-height; }
  397. h1 { font-size: $h1-font-size; }
  398. h2 { font-size: $h2-font-size; }
  399. h3 { font-size: $h3-font-size; }
  400. h4 { font-size: $h4-font-size; }
  401. h5 { font-size: $h5-font-size; }
  402. h6 { font-size: $h6-font-size; }
  403. }
  404. }
  405. }