type.less 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. //
  2. // Typography
  3. // --------------------------------------------------
  4. // Headings
  5. // -------------------------
  6. h1, h2, h3, h4, h5, h6,
  7. .h1, .h2, .h3, .h4, .h5, .h6 {
  8. font-family: @headings-font-family;
  9. font-weight: @headings-font-weight;
  10. line-height: @headings-line-height;
  11. color: @headings-color;
  12. small,
  13. .small {
  14. font-weight: normal;
  15. line-height: 1;
  16. color: @headings-small-color;
  17. }
  18. }
  19. h1, .h1,
  20. h2, .h2,
  21. h3, .h3 {
  22. margin-top: @line-height-computed;
  23. margin-bottom: (@line-height-computed / 2);
  24. small,
  25. .small {
  26. font-size: 65%;
  27. }
  28. }
  29. h4, .h4,
  30. h5, .h5,
  31. h6, .h6 {
  32. margin-top: (@line-height-computed / 2);
  33. margin-bottom: (@line-height-computed / 2);
  34. small,
  35. .small {
  36. font-size: 75%;
  37. }
  38. }
  39. h1, .h1 { font-size: @font-size-h1; }
  40. h2, .h2 { font-size: @font-size-h2; }
  41. h3, .h3 { font-size: @font-size-h3; }
  42. h4, .h4 { font-size: @font-size-h4; }
  43. h5, .h5 { font-size: @font-size-h5; }
  44. h6, .h6 { font-size: @font-size-h6; }
  45. // Body text
  46. // -------------------------
  47. p {
  48. margin: 0 0 (@line-height-computed / 2);
  49. }
  50. .lead {
  51. margin-bottom: @line-height-computed;
  52. font-size: floor((@font-size-base * 1.15));
  53. font-weight: 300;
  54. line-height: 1.4;
  55. @media (min-width: @screen-sm-min) {
  56. font-size: (@font-size-base * 1.5);
  57. }
  58. }
  59. // Emphasis & misc
  60. // -------------------------
  61. // Ex: (12px small font / 14px base font) * 100% = about 85%
  62. small,
  63. .small {
  64. font-size: floor((100% * @font-size-small / @font-size-base));
  65. }
  66. mark,
  67. .mark {
  68. background-color: @state-warning-bg;
  69. padding: .2em;
  70. }
  71. // Alignment
  72. .text-left { text-align: left; }
  73. .text-right { text-align: right; }
  74. .text-center { text-align: center; }
  75. .text-justify { text-align: justify; }
  76. .text-nowrap { white-space: nowrap; }
  77. // Transformation
  78. .text-lowercase { text-transform: lowercase; }
  79. .text-uppercase { text-transform: uppercase; }
  80. .text-capitalize { text-transform: capitalize; }
  81. // Contextual colors
  82. .text-muted {
  83. color: @text-muted;
  84. }
  85. .text-primary {
  86. .text-emphasis-variant(@brand-primary);
  87. }
  88. .text-success {
  89. .text-emphasis-variant(@state-success-text);
  90. }
  91. .text-info {
  92. .text-emphasis-variant(@state-info-text);
  93. }
  94. .text-warning {
  95. .text-emphasis-variant(@state-warning-text);
  96. }
  97. .text-danger {
  98. .text-emphasis-variant(@state-danger-text);
  99. }
  100. // Contextual backgrounds
  101. // For now we'll leave these alongside the text classes until v4 when we can
  102. // safely shift things around (per SemVer rules).
  103. .bg-primary {
  104. // Given the contrast here, this is the only class to have its color inverted
  105. // automatically.
  106. color: #fff;
  107. .bg-variant(@brand-primary);
  108. }
  109. .bg-success {
  110. .bg-variant(@state-success-bg);
  111. }
  112. .bg-info {
  113. .bg-variant(@state-info-bg);
  114. }
  115. .bg-warning {
  116. .bg-variant(@state-warning-bg);
  117. }
  118. .bg-danger {
  119. .bg-variant(@state-danger-bg);
  120. }
  121. // Page header
  122. // -------------------------
  123. .page-header {
  124. padding-bottom: ((@line-height-computed / 2) - 1);
  125. margin: (@line-height-computed * 2) 0 @line-height-computed;
  126. border-bottom: 1px solid @page-header-border-color;
  127. }
  128. // Lists
  129. // -------------------------
  130. // Unordered and Ordered lists
  131. ul,
  132. ol {
  133. margin-top: 0;
  134. margin-bottom: (@line-height-computed / 2);
  135. ul,
  136. ol {
  137. margin-bottom: 0;
  138. }
  139. }
  140. // List options
  141. // Unstyled keeps list items block level, just removes default browser padding and list-style
  142. .list-unstyled {
  143. padding-left: 0;
  144. list-style: none;
  145. }
  146. // Inline turns list items into inline-block
  147. .list-inline {
  148. .list-unstyled();
  149. margin-left: -5px;
  150. > li {
  151. display: inline-block;
  152. padding-left: 5px;
  153. padding-right: 5px;
  154. }
  155. }
  156. // Description Lists
  157. dl {
  158. margin-top: 0; // Remove browser default
  159. margin-bottom: @line-height-computed;
  160. }
  161. dt,
  162. dd {
  163. line-height: @line-height-base;
  164. }
  165. dt {
  166. font-weight: bold;
  167. }
  168. dd {
  169. margin-left: 0; // Undo browser default
  170. }
  171. // Horizontal description lists
  172. //
  173. // Defaults to being stacked without any of the below styles applied, until the
  174. // grid breakpoint is reached (default of ~768px).
  175. .dl-horizontal {
  176. dd {
  177. &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present
  178. }
  179. @media (min-width: @grid-float-breakpoint) {
  180. dt {
  181. float: left;
  182. width: (@dl-horizontal-offset - 20);
  183. clear: left;
  184. text-align: right;
  185. .text-overflow();
  186. }
  187. dd {
  188. margin-left: @dl-horizontal-offset;
  189. }
  190. }
  191. }
  192. // Misc
  193. // -------------------------
  194. // Abbreviations and acronyms
  195. abbr[title],
  196. // Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257
  197. abbr[data-original-title] {
  198. cursor: help;
  199. border-bottom: 1px dotted @abbr-border-color;
  200. }
  201. .initialism {
  202. font-size: 90%;
  203. text-transform: uppercase;
  204. }
  205. // Blockquotes
  206. blockquote {
  207. padding: (@line-height-computed / 2) @line-height-computed;
  208. margin: 0 0 @line-height-computed;
  209. font-size: @blockquote-font-size;
  210. border-left: 5px solid @blockquote-border-color;
  211. p,
  212. ul,
  213. ol {
  214. &:last-child {
  215. margin-bottom: 0;
  216. }
  217. }
  218. // Note: Deprecated small and .small as of v3.1.0
  219. // Context: https://github.com/twbs/bootstrap/issues/11660
  220. footer,
  221. small,
  222. .small {
  223. display: block;
  224. font-size: 80%; // back to default font-size
  225. line-height: @line-height-base;
  226. color: @blockquote-small-color;
  227. &:before {
  228. content: '\2014 \00A0'; // em dash, nbsp
  229. }
  230. }
  231. }
  232. // Opposite alignment of blockquote
  233. //
  234. // Heads up: `blockquote.pull-right` has been deprecated as of v3.1.0.
  235. .blockquote-reverse,
  236. blockquote.pull-right {
  237. padding-right: 15px;
  238. padding-left: 0;
  239. border-right: 5px solid @blockquote-border-color;
  240. border-left: 0;
  241. text-align: right;
  242. // Account for citation
  243. footer,
  244. small,
  245. .small {
  246. &:before { content: ''; }
  247. &:after {
  248. content: '\00A0 \2014'; // nbsp, em dash
  249. }
  250. }
  251. }
  252. // Addresses
  253. address {
  254. margin-bottom: @line-height-computed;
  255. font-style: normal;
  256. line-height: @line-height-base;
  257. }