_type.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  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. // Controls the page margin when printing the website
  107. $print-margin: 0.34in !default;
  108. // Text alignment class names
  109. $align-class-names:
  110. small-only,
  111. small,
  112. medium-only,
  113. medium,
  114. large-only,
  115. large,
  116. xlarge-only,
  117. xlarge,
  118. xxlarge-only,
  119. xxlarge;
  120. // Text alignment breakpoints
  121. $align-class-breakpoints:
  122. $small-only,
  123. $small-up,
  124. $medium-only,
  125. $medium-up,
  126. $large-only,
  127. $large-up,
  128. $xlarge-only,
  129. $xlarge-up,
  130. $xxlarge-only,
  131. $xxlarge-up;
  132. // Generates text align and justify classes
  133. @mixin align-classes{
  134. .text-left { text-align: left !important; }
  135. .text-right { text-align: right !important; }
  136. .text-center { text-align: center !important; }
  137. .text-justify { text-align: justify !important; }
  138. @for $i from 1 through length($align-class-names) {
  139. @media #{(nth($align-class-breakpoints, $i))} {
  140. .#{(nth($align-class-names, $i))}-text-left { text-align: left !important; }
  141. .#{(nth($align-class-names, $i))}-text-right { text-align: right !important; }
  142. .#{(nth($align-class-names, $i))}-text-center { text-align: center !important; }
  143. .#{(nth($align-class-names, $i))}-text-justify { text-align: justify !important; }
  144. }
  145. }
  146. }
  147. //
  148. // Typography Placeholders
  149. //
  150. // These will throw a deprecation warning if used within a media query.
  151. @mixin lead {
  152. font-size: $paragraph-font-size + rem-calc(3.5);
  153. line-height: 1.6;
  154. }
  155. @mixin subheader {
  156. line-height: $subheader-line-height;
  157. color: $subheader-font-color;
  158. font-weight: $subheader-font-weight;
  159. margin-top: $subheader-top-margin;
  160. margin-bottom: $subheader-bottom-margin;
  161. }
  162. @include exports("type") {
  163. @if $include-html-type-classes {
  164. // Responsive Text alignment
  165. @include align-classes;
  166. /* Typography resets */
  167. div,
  168. dl,
  169. dt,
  170. dd,
  171. ul,
  172. ol,
  173. li,
  174. h1,
  175. h2,
  176. h3,
  177. h4,
  178. h5,
  179. h6,
  180. pre,
  181. form,
  182. p,
  183. blockquote,
  184. th,
  185. td {
  186. margin:0;
  187. padding:0;
  188. }
  189. /* Default Link Styles */
  190. a {
  191. color: $anchor-font-color;
  192. line-height: inherit;
  193. text-decoration: $anchor-text-decoration;
  194. &:hover,
  195. &:focus {
  196. color: $anchor-font-color-hover;
  197. @if $anchor-text-decoration-hover != $anchor-text-decoration {
  198. text-decoration: $anchor-text-decoration-hover;
  199. }
  200. }
  201. img { border:none; }
  202. }
  203. /* Default paragraph styles */
  204. p {
  205. font-family: $paragraph-font-family;
  206. font-size: $paragraph-font-size;
  207. font-weight: $paragraph-font-weight;
  208. line-height: $paragraph-line-height;
  209. margin-bottom: $paragraph-margin-bottom;
  210. text-rendering: $paragraph-text-rendering;
  211. &.lead { @include lead; }
  212. & aside {
  213. font-size: $paragraph-aside-font-size;
  214. font-style: $paragraph-aside-font-style;
  215. line-height: $paragraph-aside-line-height;
  216. }
  217. }
  218. /* Default header styles */
  219. h1, h2, h3, h4, h5, h6 {
  220. color: $header-font-color;
  221. font-family: $header-font-family;
  222. font-style: $header-font-style;
  223. font-weight: $header-font-weight;
  224. line-height: $header-line-height;
  225. margin-bottom: $header-bottom-margin;
  226. margin-top: $header-top-margin;
  227. text-rendering: $header-text-rendering;
  228. small {
  229. color: $small-font-color;
  230. font-size: $small-font-size;
  231. line-height: 0;
  232. }
  233. }
  234. h1 { font-size: $h1-font-size - $h1-font-reduction; }
  235. h2 { font-size: $h2-font-size - $h2-font-reduction; }
  236. h3 { font-size: $h3-font-size - $h3-font-reduction; }
  237. h4 { font-size: $h4-font-size - $h4-font-reduction; }
  238. h5 { font-size: $h5-font-size - $h5-font-reduction; }
  239. h6 { font-size: $h6-font-size - $h6-font-reduction; }
  240. .subheader { @include subheader; }
  241. hr {
  242. border: $hr-border-style $hr-border-color;
  243. border-width: $hr-border-width 0 0;
  244. clear: both;
  245. height: 0;
  246. margin: $hr-margin 0 ($hr-margin - rem-calc($hr-border-width));
  247. }
  248. /* Helpful Typography Defaults */
  249. em,
  250. i {
  251. font-style: italic;
  252. line-height: inherit;
  253. }
  254. strong,
  255. b {
  256. font-weight: $font-weight-bold;
  257. line-height: inherit;
  258. }
  259. small {
  260. font-size: $small-font-size;
  261. line-height: inherit;
  262. }
  263. code {
  264. background-color: $code-background-color;
  265. border-color: $code-border-color;
  266. border-style: $code-border-style;
  267. border-width: $code-border-size;
  268. color: $code-color;
  269. font-family: $code-font-family;
  270. font-weight: $code-font-weight;
  271. padding: $code-padding;
  272. }
  273. /* Lists */
  274. ul,
  275. ol,
  276. dl {
  277. font-family: $list-font-family;
  278. font-size: $list-font-size;
  279. line-height: $list-line-height;
  280. list-style-position: $list-style-position;
  281. margin-bottom: $list-margin-bottom;
  282. }
  283. ul {
  284. margin-#{$default-float}: $list-side-margin;
  285. }
  286. /* Unordered Lists */
  287. ul {
  288. li {
  289. ul,
  290. ol {
  291. margin-#{$default-float}: $list-nested-margin;
  292. margin-bottom: 0;
  293. }
  294. }
  295. &.square,
  296. &.circle,
  297. &.disc {
  298. li ul { list-style: inherit; }
  299. }
  300. &.square { list-style-type: square; margin-#{$default-float}: $list-side-margin;}
  301. &.circle { list-style-type: circle; margin-#{$default-float}: $list-side-margin;}
  302. &.disc { list-style-type: disc; margin-#{$default-float}: $list-side-margin;}
  303. }
  304. /* Ordered Lists */
  305. ol {
  306. margin-#{$default-float}: $list-ordered-side-margin;
  307. li {
  308. ul,
  309. ol {
  310. margin-#{$default-float}: $list-nested-margin;
  311. margin-bottom: 0;
  312. }
  313. }
  314. }
  315. // Lists without bullets
  316. .no-bullet {
  317. list-style-type: none;
  318. margin-#{$default-float}: $list-side-margin-no-bullet;
  319. li {
  320. ul,
  321. ol {
  322. margin-#{$default-float}: $list-nested-margin;
  323. margin-bottom: 0;
  324. list-style: none;
  325. }
  326. }
  327. }
  328. /* Definition Lists */
  329. dl {
  330. dt {
  331. margin-bottom: $definition-list-header-margin-bottom;
  332. font-weight: $definition-list-header-weight;
  333. }
  334. dd { margin-bottom: $definition-list-margin-bottom; }
  335. }
  336. /* Abbreviations */
  337. abbr,
  338. acronym {
  339. text-transform: uppercase;
  340. font-size: 90%;
  341. color: $body-font-color;
  342. cursor: $cursor-help-value;
  343. }
  344. abbr {
  345. text-transform: none;
  346. &[title] {
  347. border-bottom: $acronym-underline;
  348. }
  349. }
  350. /* Blockquotes */
  351. blockquote {
  352. margin: 0 0 $paragraph-margin-bottom;
  353. padding: $blockquote-padding;
  354. border-#{$default-float}: $blockquote-border;
  355. cite {
  356. display: block;
  357. font-size: $blockquote-cite-font-size;
  358. color: $blockquote-cite-font-color;
  359. &:before {
  360. content: "\2014 \0020";
  361. }
  362. a,
  363. a:visited {
  364. color: $blockquote-cite-link-color;
  365. }
  366. }
  367. }
  368. blockquote,
  369. blockquote p {
  370. line-height: $paragraph-line-height;
  371. color: $blockquote-font-color;
  372. }
  373. /* Microformats */
  374. .vcard {
  375. display: inline-block;
  376. margin: $microformat-margin;
  377. border: $microformat-border-width $microformat-border-style $microformat-border-color;
  378. padding: $microformat-padding;
  379. li {
  380. margin: 0;
  381. display: block;
  382. }
  383. .fn {
  384. font-weight: $microformat-fullname-font-weight;
  385. font-size: $microformat-fullname-font-size;
  386. }
  387. }
  388. .vevent {
  389. .summary { font-weight: $microformat-summary-font-weight; }
  390. abbr {
  391. cursor: $cursor-default-value;
  392. text-decoration: $microformat-abbr-font-decoration;
  393. font-weight: $microformat-abbr-font-weight;
  394. border: none;
  395. padding: $microformat-abbr-padding;
  396. }
  397. }
  398. @media #{$medium-up} {
  399. h1, h2, h3, h4, h5, h6 { line-height: $header-line-height; }
  400. h1 { font-size: $h1-font-size; }
  401. h2 { font-size: $h2-font-size; }
  402. h3 { font-size: $h3-font-size; }
  403. h4 { font-size: $h4-font-size; }
  404. h5 { font-size: $h5-font-size; }
  405. h6 { font-size: $h6-font-size; }
  406. }
  407. // Only include these styles if you want them.
  408. @if $include-print-styles {
  409. /*
  410. * Print styles.
  411. *
  412. * Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
  413. * Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com)
  414. */
  415. @media print {
  416. * {
  417. background: transparent !important;
  418. color: $black !important; /* Black prints faster: h5bp.com/s */
  419. box-shadow: none !important;
  420. text-shadow: none !important;
  421. }
  422. a,
  423. a:visited { text-decoration: underline;}
  424. a[href]:after { content: " (" attr(href) ")"; }
  425. abbr[title]:after { content: " (" attr(title) ")"; }
  426. // Don't show links for images, or javascript/internal links
  427. .ir a:after,
  428. a[href^="javascript:"]:after,
  429. a[href^="#"]:after { content: ""; }
  430. pre,
  431. blockquote {
  432. border: 1px solid $aluminum;
  433. page-break-inside: avoid;
  434. }
  435. thead { display: table-header-group; /* h5bp.com/t */ }
  436. tr,
  437. img { page-break-inside: avoid; }
  438. img { max-width: 100% !important; }
  439. @page { margin: $print-margin; }
  440. p,
  441. h2,
  442. h3 {
  443. orphans: 3;
  444. widows: 3;
  445. }
  446. h2,
  447. h3 { page-break-after: avoid; }
  448. }
  449. }
  450. }
  451. }