typography-helpers.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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-justified</code></td>
  235. <td>Makes the text <strong>justified</strong></td>
  236. </tr>
  237. <tr>
  238. <td><code>has-text-left</code></td>
  239. <td>Makes the text aligned to the <strong>left</strong></td>
  240. </tr>
  241. <tr>
  242. <td><code>has-text-right</code></td>
  243. <td>Makes the text aligned to the <strong>right</strong></td>
  244. </tr>
  245. </tbody>
  246. </table>
  247. {% include anchor.html name="Responsive Alignment" %}
  248. <div class="content">
  249. <p>
  250. 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.
  251. </p>
  252. <p>
  253. For example, here are the modifiers for <code>has-text-left</code>:
  254. </p>
  255. </div>
  256. <table class="table is-bordered">
  257. {{ thead }}
  258. <tbody>
  259. <tr>
  260. <td><code>has-text-left-mobile</code></td>
  261. {{ left }}
  262. {{ unchanged }}
  263. {{ unchanged }}
  264. {{ unchanged }}
  265. {{ unchanged }}
  266. </tr>
  267. <tr>
  268. <td><code>has-text-left-tablet</code></td>
  269. {{ unchanged }}
  270. {{ left }}
  271. {{ left }}
  272. {{ left }}
  273. {{ left }}
  274. </tr>
  275. <tr>
  276. <td><code>has-text-left-tablet-only</code></td>
  277. {{ unchanged }}
  278. {{ left }}
  279. {{ unchanged }}
  280. {{ unchanged }}
  281. {{ unchanged }}
  282. </tr>
  283. <tr>
  284. <td><code>has-text-left-touch</code></td>
  285. {{ left }}
  286. {{ left }}
  287. {{ unchanged }}
  288. {{ unchanged }}
  289. {{ unchanged }}
  290. </tr>
  291. <tr>
  292. <td><code>has-text-left-desktop</code></td>
  293. {{ unchanged }}
  294. {{ unchanged }}
  295. {{ left }}
  296. {{ left }}
  297. {{ left }}
  298. </tr>
  299. <tr>
  300. <td><code>has-text-left-desktop-only</code></td>
  301. {{ unchanged }}
  302. {{ unchanged }}
  303. {{ left }}
  304. {{ unchanged }}
  305. {{ unchanged }}
  306. </tr>
  307. <tr>
  308. <td><code>has-text-left-widescreen</code></td>
  309. {{ unchanged }}
  310. {{ unchanged }}
  311. {{ unchanged }}
  312. {{ left }}
  313. {{ left }}
  314. </tr>
  315. <tr>
  316. <td><code>has-text-left-widescreen-only</code></td>
  317. {{ unchanged }}
  318. {{ unchanged }}
  319. {{ unchanged }}
  320. {{ left }}
  321. {{ unchanged }}
  322. </tr>
  323. <tr>
  324. <td><code>has-text-left-fullhd</code></td>
  325. {{ unchanged }}
  326. {{ unchanged }}
  327. {{ unchanged }}
  328. {{ unchanged }}
  329. {{ left }}
  330. </tr>
  331. </tbody>
  332. </table>
  333. {% include anchor.html name="Text transformation" %}
  334. <div class="content">
  335. <p>
  336. You can transform the text with the use of one of <strong>3 text transformation helpers</strong>:
  337. </p>
  338. </div>
  339. <table class="table is-bordered">
  340. <thead>
  341. <tr>
  342. <th>
  343. Class
  344. </th>
  345. <th>
  346. Transformation
  347. </th>
  348. </tr>
  349. </thead>
  350. <tbody>
  351. <tr>
  352. <td><code>is-capitalized</code></td>
  353. <td>Transforms <strong>the first character</strong> of each word to <strong>uppercase</strong></td>
  354. </tr>
  355. <tr>
  356. <td><code>is-lowercase</code></td>
  357. <td>Transforms all characters to <strong>lowercase</strong></td>
  358. </tr>
  359. <tr>
  360. <td><code>is-uppercase</code></td>
  361. <td>Transforms all characters to <strong>uppercase</strong></td>
  362. </tr>
  363. </tbody>
  364. </table>
  365. {% include anchor.html name="Text weight" %}
  366. <div class="content">
  367. <p>
  368. You can transform the text weight with the use of one of <strong>4 text weight helpers</strong>:
  369. </p>
  370. </div>
  371. <table class="table is-bordered">
  372. <thead>
  373. <tr>
  374. <th>
  375. Class
  376. </th>
  377. <th>
  378. Weight
  379. </th>
  380. </tr>
  381. </thead>
  382. <tbody>
  383. <tr>
  384. <td><code>has-text-weight-light</code></td>
  385. <td>Transforms text weight to <strong>light</strong></td>
  386. </tr>
  387. <tr>
  388. <td><code>has-text-weight-normal</code></td>
  389. <td>Transforms text weight to <strong>normal</strong></td>
  390. </tr>
  391. <tr>
  392. <td><code>has-text-weight-semibold</code></td>
  393. <td>Transforms text weight to <strong>semi-bold</strong></td>
  394. </tr>
  395. <tr>
  396. <td><code>has-text-weight-bold</code></td>
  397. <td>Transforms text weight to <strong>bold</strong></td>
  398. </tr>
  399. </tbody>
  400. </table>
  401. </div>
  402. </section>