typography-helpers.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. ---
  2. title: Typography helpers
  3. layout: documentation
  4. doc-tab: modifiers
  5. doc-subtab: typography-helpers
  6. ---
  7. {% capture thead %}
  8. <thead>
  9. <tr>
  10. <th>
  11. Class
  12. </th>
  13. <th>
  14. Mobile<br>
  15. Up to <code>768px</code>
  16. </th>
  17. <th>
  18. Tablet<br>
  19. Between <code>769px</code> and <code>1007px</code>
  20. </th>
  21. <th>
  22. Desktop<br>
  23. Between <code>1008px</code> and <code>1199px</code>
  24. </th>
  25. <th>
  26. Widescreen<br>
  27. Between <code>1200px</code> and <code>1391px</code>
  28. </th>
  29. <th>
  30. FullHD<br>
  31. Above <code>1392px</code>
  32. </th>
  33. </tr>
  34. </thead>
  35. {% endcapture %}
  36. {% capture size1 %}
  37. <td class="is-narrow">
  38. <p class="notification is-success"><code>3rem</code></p>
  39. </td>
  40. {% endcapture %}
  41. {% capture unchanged %}
  42. <td class="is-narrow">
  43. <p class="notification">unchanged</p>
  44. </td>
  45. {% endcapture %}
  46. {% capture left %}
  47. <td class="is-narrow">
  48. <p class="notification is-success">left-aligned</p>
  49. </td>
  50. {% endcapture %}
  51. {% include subnav-modifiers.html %}
  52. <section class="section">
  53. <div class="container">
  54. <h1 class="title">Typography helpers</h1>
  55. <h2 class="subtitle">
  56. Change the <strong>size</strong> and <strong>color</strong> of the text for one or multiple viewport width
  57. </h2>
  58. {% include anchor.html name="Size" %}
  59. <div class="content">
  60. <p>
  61. There are <strong>7 sizes</strong> to choose from:
  62. </p>
  63. </div>
  64. <table class="table is-bordered">
  65. <thead>
  66. <tr>
  67. <th>
  68. Class
  69. </th>
  70. <th>
  71. Font-size
  72. </th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. <tr>
  77. <td><code>is-size-1</code></td>
  78. <td><code>3rem</code></td>
  79. </tr>
  80. <tr>
  81. <td><code>is-size-2</code></td>
  82. <td><code>2.5rem</code></td>
  83. </tr>
  84. <tr>
  85. <td><code>is-size-3</code></td>
  86. <td><code>2rem</code></td>
  87. </tr>
  88. <tr>
  89. <td><code>is-size-4</code></td>
  90. <td><code>1.5rem</code></td>
  91. </tr>
  92. <tr>
  93. <td><code>is-size-5</code></td>
  94. <td><code>1.25rem</code></td>
  95. </tr>
  96. <tr>
  97. <td><code>is-size-6</code></td>
  98. <td><code>1rem</code></td>
  99. </tr>
  100. <tr>
  101. <td><code>is-size-7</code></td>
  102. <td><code>0.75rem</code></td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. {% include anchor.html name="Responsive size" %}
  107. <div class="content">
  108. <p>
  109. You can choose a <strong>specific</strong> size for <em>each</em> viewport width. You simply needed to append the <strong>viewport width</strong> to the size modifier.
  110. </p>
  111. <p>
  112. For example, here are the modifiers for <code>$size-1</code>:
  113. </p>
  114. </div>
  115. <table class="table is-bordered">
  116. {{ thead }}
  117. <tbody>
  118. <tr>
  119. <td><code>is-size-1-mobile</code></td>
  120. {{ size1 }}
  121. {{ unchanged }}
  122. {{ unchanged }}
  123. {{ unchanged }}
  124. {{ unchanged }}
  125. </tr>
  126. <tr>
  127. <td><code>is-size-1-tablet</code></td>
  128. {{ unchanged }}
  129. {{ size1 }}
  130. {{ unchanged }}
  131. {{ unchanged }}
  132. {{ unchanged }}
  133. </tr>
  134. <tr>
  135. <td><code>is-size-1-touch</code></td>
  136. {{ size1 }}
  137. {{ size1 }}
  138. {{ unchanged }}
  139. {{ unchanged }}
  140. {{ unchanged }}
  141. </tr>
  142. <tr>
  143. <td><code>is-size-1-desktop</code></td>
  144. {{ unchanged }}
  145. {{ unchanged }}
  146. {{ size1 }}
  147. {{ size1 }}
  148. {{ size1 }}
  149. </tr>
  150. <tr>
  151. <td><code>is-size-1-widescreen</code></td>
  152. {{ unchanged }}
  153. {{ unchanged }}
  154. {{ unchanged }}
  155. {{ size1 }}
  156. {{ size1 }}
  157. </tr>
  158. <tr>
  159. <td><code>is-size-1-fullhd</code></td>
  160. {{ unchanged }}
  161. {{ unchanged }}
  162. {{ unchanged }}
  163. {{ unchanged }}
  164. {{ size1 }}
  165. </tr>
  166. </tbody>
  167. </table>
  168. <div class="content">
  169. <p>
  170. You can use the same logic for each of the <strong>7 sizes</strong>.
  171. </p>
  172. </div>
  173. {% include anchor.html name="Colors" %}
  174. <div class="content">
  175. <p>
  176. You can set any element to one of the <strong>9 colors</strong> or <strong>9 shades of grey</strong>:
  177. </p>
  178. </div>
  179. <table class="table is-bordered">
  180. <thead>
  181. <tr>
  182. <th>
  183. Class
  184. </th>
  185. <th>
  186. Color
  187. </th>
  188. </tr>
  189. </thead>
  190. <tbody>
  191. <tr><td><code>.has-text-white</code></td><td>{% include color/white.html %}</td></tr>
  192. <tr><td><code>.has-text-black</code></td><td>{% include color/black.html %}</td></tr>
  193. <tr><td><code>.has-text-light</code></td><td>{% include color/white-ter.html %}</td></tr>
  194. <tr><td><code>.has-text-dark</code></td><td>{% include color/grey-darker.html %}</td></tr>
  195. <tr><td><code>.has-text-primary</code></td><td>{% include color/turquoise.html %}</td></tr>
  196. <tr><td><code>.has-text-info</code></td><td>{% include color/blue.html %}</td></tr>
  197. <tr><td><code>.has-text-success</code></td><td>{% include color/green.html %}</td></tr>
  198. <tr><td><code>.has-text-warning</code></td><td>{% include color/yellow.html %}</td></tr>
  199. <tr><td><code>.has-text-danger</code></td><td>{% include color/red.html %}</td></tr>
  200. <tr><td><code>.has-text-black-bis</code></td><td>{% include color/black-bis.html %}</td></tr>
  201. <tr><td><code>.has-text-black-ter</code></td><td>{% include color/black-ter.html %}</td></tr>
  202. <tr><td><code>.has-text-grey-darker</code></td><td>{% include color/grey-darker.html %}</td></tr>
  203. <tr><td><code>.has-text-grey-dark</code></td><td>{% include color/grey-dark.html %}</td></tr>
  204. <tr><td><code>.has-text-grey</code></td><td>{% include color/grey.html %}</td></tr>
  205. <tr><td><code>.has-text-grey-light</code></td><td>{% include color/grey-light.html %}</td></tr>
  206. <tr><td><code>.has-text-grey-lighter</code></td><td>{% include color/grey-lighter.html %}</td></tr>
  207. <tr><td><code>.has-text-white-ter</code></td><td>{% include color/white-ter.html %}</td></tr>
  208. <tr><td><code>.has-text-white-bis</code></td><td>{% include color/white-bis.html %}</td></tr>
  209. </tbody>
  210. </table>
  211. {% include anchor.html name="Alignment" %}
  212. <div class="content">
  213. <p>
  214. You can align the text with the use of one of <strong>3 alignment helpers</strong>:
  215. </p>
  216. </div>
  217. <table class="table is-bordered">
  218. <thead>
  219. <tr>
  220. <th>
  221. Class
  222. </th>
  223. <th>
  224. Alignment
  225. </th>
  226. </tr>
  227. </thead>
  228. <tbody>
  229. <tr>
  230. <td><code>.has-text-centered</code></td>
  231. <td>Makes the text <strong>centered</strong></td>
  232. </tr>
  233. <tr>
  234. <td><code>.has-text-left</code></td>
  235. <td>Makes the text aligned to the <strong>left</strong></td>
  236. </tr>
  237. <tr>
  238. <td><code>.has-text-right</code></td>
  239. <td>Makes the text aligned to the <strong>right</strong></td>
  240. </tr>
  241. </tbody>
  242. </table>
  243. {% include anchor.html name="Responsive Alignment" %}
  244. <div class="content">
  245. <p>
  246. You can now <strong>align text</strong> for <em>each</em> viewport width. You simply need to append the <strong>viewport width</strong> to the alignment modifier.
  247. </p>
  248. <p>
  249. For example, here are the modifiers for <code>.has-text-left</code>:
  250. </p>
  251. </div>
  252. <table class="table is-bordered">
  253. {{ thead }}
  254. <tbody>
  255. <tr>
  256. <td><code>has-text-left-mobile</code></td>
  257. {{ left }}
  258. {{ unchanged }}
  259. {{ unchanged }}
  260. {{ unchanged }}
  261. {{ unchanged }}
  262. </tr>
  263. <tr>
  264. <td><code>has-text-left-tablet</code></td>
  265. {{ unchanged }}
  266. {{ left }}
  267. {{ left }}
  268. {{ left }}
  269. {{ left }}
  270. </tr>
  271. <tr>
  272. <td><code>has-text-left-tablet-only</code></td>
  273. {{ unchanged }}
  274. {{ left }}
  275. {{ unchanged }}
  276. {{ unchanged }}
  277. {{ unchanged }}
  278. </tr>
  279. <tr>
  280. <td><code>has-text-left-touch</code></td>
  281. {{ left }}
  282. {{ left }}
  283. {{ unchanged }}
  284. {{ unchanged }}
  285. {{ unchanged }}
  286. </tr>
  287. <tr>
  288. <td><code>has-text-left-desktop</code></td>
  289. {{ unchanged }}
  290. {{ unchanged }}
  291. {{ left }}
  292. {{ left }}
  293. {{ left }}
  294. </tr>
  295. <tr>
  296. <td><code>has-text-left-desktop-only</code></td>
  297. {{ unchanged }}
  298. {{ unchanged }}
  299. {{ left }}
  300. {{ unchanged }}
  301. {{ unchanged }}
  302. </tr>
  303. <tr>
  304. <td><code>has-text-left-widescreen</code></td>
  305. {{ unchanged }}
  306. {{ unchanged }}
  307. {{ unchanged }}
  308. {{ left }}
  309. {{ left }}
  310. </tr>
  311. <tr>
  312. <td><code>has-text-left-widescreen-only</code></td>
  313. {{ unchanged }}
  314. {{ unchanged }}
  315. {{ unchanged }}
  316. {{ left }}
  317. {{ unchanged }}
  318. </tr>
  319. <tr>
  320. <td><code>has-text-left-fullhd</code></td>
  321. {{ unchanged }}
  322. {{ unchanged }}
  323. {{ unchanged }}
  324. {{ unchanged }}
  325. {{ left }}
  326. </tr>
  327. </tbody>
  328. </table>
  329. {% include anchor.html name="Text transformation" %}
  330. <div class="content">
  331. <p>
  332. You can transform the text with the use of one of <strong>3 text transformation helpers</strong>:
  333. </p>
  334. </div>
  335. <table class="table is-bordered">
  336. <thead>
  337. <tr>
  338. <th>
  339. Class
  340. </th>
  341. <th>
  342. Transformation
  343. </th>
  344. </tr>
  345. </thead>
  346. <tbody>
  347. <tr>
  348. <td><code>.is-capitalized</code></td>
  349. <td>Transforms <strong>the first character</strong> of each word to <strong>uppercase</strong></td>
  350. </tr>
  351. <tr>
  352. <td><code>.is-lowercase</code></td>
  353. <td>Transforms all characters to <strong>lowercase</strong></td>
  354. </tr>
  355. <tr>
  356. <td><code>.is-uppercase</code></td>
  357. <td>Transforms all characters to <strong>uppercase</strong></td>
  358. </tr>
  359. </tbody>
  360. </table>
  361. </div>
  362. </section>