typography-helpers.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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. <hr>
  59. <h3 class="title">Size</h3>
  60. <div class="content">
  61. <p>
  62. There are <strong>7 sizes</strong> to choose from:
  63. </p>
  64. </div>
  65. <table class="table is-bordered">
  66. <thead>
  67. <tr>
  68. <th>
  69. Class
  70. </th>
  71. <th>
  72. Font-size
  73. </th>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. <tr>
  78. <td><code>is-size-1</code></td>
  79. <td><code>3rem</code></td>
  80. </tr>
  81. <tr>
  82. <td><code>is-size-2</code></td>
  83. <td><code>2.5rem</code></td>
  84. </tr>
  85. <tr>
  86. <td><code>is-size-3</code></td>
  87. <td><code>2rem</code></td>
  88. </tr>
  89. <tr>
  90. <td><code>is-size-4</code></td>
  91. <td><code>1.5rem</code></td>
  92. </tr>
  93. <tr>
  94. <td><code>is-size-5</code></td>
  95. <td><code>1.25rem</code></td>
  96. </tr>
  97. <tr>
  98. <td><code>is-size-6</code></td>
  99. <td><code>1rem</code></td>
  100. </tr>
  101. <tr>
  102. <td><code>is-size-7</code></td>
  103. <td><code>0.75rem</code></td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. <hr>
  108. <h3 class="title">
  109. Responsive size
  110. </h3>
  111. <div class="content">
  112. <p>
  113. 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.
  114. </p>
  115. <p>
  116. For example, here are the modifiers for <code>$size-1</code>:
  117. </p>
  118. </div>
  119. <table class="table is-bordered">
  120. {{ thead }}
  121. <tbody>
  122. <tr>
  123. <td><code>is-size-1-mobile</code></td>
  124. {{ size1 }}
  125. {{ unchanged }}
  126. {{ unchanged }}
  127. {{ unchanged }}
  128. {{ unchanged }}
  129. </tr>
  130. <tr>
  131. <td><code>is-size-1-tablet</code></td>
  132. {{ unchanged }}
  133. {{ size1 }}
  134. {{ unchanged }}
  135. {{ unchanged }}
  136. {{ unchanged }}
  137. </tr>
  138. <tr>
  139. <td><code>is-size-1-touch</code></td>
  140. {{ size1 }}
  141. {{ size1 }}
  142. {{ unchanged }}
  143. {{ unchanged }}
  144. {{ unchanged }}
  145. </tr>
  146. <tr>
  147. <td><code>is-size-1-desktop</code></td>
  148. {{ unchanged }}
  149. {{ unchanged }}
  150. {{ size1 }}
  151. {{ size1 }}
  152. {{ size1 }}
  153. </tr>
  154. <tr>
  155. <td><code>is-size-1-widescreen</code></td>
  156. {{ unchanged }}
  157. {{ unchanged }}
  158. {{ unchanged }}
  159. {{ size1 }}
  160. {{ size1 }}
  161. </tr>
  162. <tr>
  163. <td><code>is-size-1-fullhd</code></td>
  164. {{ unchanged }}
  165. {{ unchanged }}
  166. {{ unchanged }}
  167. {{ unchanged }}
  168. {{ size1 }}
  169. </tr>
  170. </tbody>
  171. </table>
  172. <div class="content">
  173. <p>
  174. You can use the same logic for each of the <strong>7 sizes</strong>.
  175. </p>
  176. </div>
  177. <hr>
  178. <h3 class="title">
  179. Colors
  180. </h3>
  181. <div class="content">
  182. <p>
  183. You can set any element to one of the <strong>9 colors</strong> or <strong>9 shades of grey</strong>:
  184. </p>
  185. </div>
  186. <table class="table is-bordered">
  187. <thead>
  188. <tr>
  189. <th>
  190. Class
  191. </th>
  192. <th>
  193. Color
  194. </th>
  195. </tr>
  196. </thead>
  197. <tbody>
  198. <tr><td><code>.has-text-white</code></td><td>{% include color/white.html %}</td></tr>
  199. <tr><td><code>.has-text-black</code></td><td>{% include color/black.html %}</td></tr>
  200. <tr><td><code>.has-text-light</code></td><td>{% include color/white-ter.html %}</td></tr>
  201. <tr><td><code>.has-text-dark</code></td><td>{% include color/grey-darker.html %}</td></tr>
  202. <tr><td><code>.has-text-primary</code></td><td>{% include color/turquoise.html %}</td></tr>
  203. <tr><td><code>.has-text-info</code></td><td>{% include color/blue.html %}</td></tr>
  204. <tr><td><code>.has-text-success</code></td><td>{% include color/green.html %}</td></tr>
  205. <tr><td><code>.has-text-warning</code></td><td>{% include color/yellow.html %}</td></tr>
  206. <tr><td><code>.has-text-danger</code></td><td>{% include color/red.html %}</td></tr>
  207. <tr><td><code>.has-text-black-bis</code></td><td>{% include color/black-bis.html %}</td></tr>
  208. <tr><td><code>.has-text-black-ter</code></td><td>{% include color/black-ter.html %}</td></tr>
  209. <tr><td><code>.has-text-grey-darker</code></td><td>{% include color/grey-darker.html %}</td></tr>
  210. <tr><td><code>.has-text-grey-dark</code></td><td>{% include color/grey-dark.html %}</td></tr>
  211. <tr><td><code>.has-text-grey</code></td><td>{% include color/grey.html %}</td></tr>
  212. <tr><td><code>.has-text-grey-light</code></td><td>{% include color/grey-light.html %}</td></tr>
  213. <tr><td><code>.has-text-grey-lighter</code></td><td>{% include color/grey-lighter.html %}</td></tr>
  214. <tr><td><code>.has-text-white-ter</code></td><td>{% include color/white-ter.html %}</td></tr>
  215. <tr><td><code>.has-text-white-bis</code></td><td>{% include color/white-bis.html %}</td></tr>
  216. </tbody>
  217. </table>
  218. <hr>
  219. <h3 class="title">Alignment</h3>
  220. <div class="content">
  221. <p>
  222. You can align the text with the use of one of <strong>3 alignment helpers</strong>:
  223. </p>
  224. </div>
  225. <table class="table is-bordered">
  226. <thead>
  227. <tr>
  228. <th>
  229. Class
  230. </th>
  231. <th>
  232. Alignment
  233. </th>
  234. </tr>
  235. </thead>
  236. <tbody>
  237. <tr>
  238. <td><code>.has-text-centered</code></td>
  239. <td>Makes the text <strong>centered</strong></td>
  240. </tr>
  241. <tr>
  242. <td><code>.has-text-left</code></td>
  243. <td>Makes the text aligned to the <strong>left</strong></td>
  244. </tr>
  245. <tr>
  246. <td><code>.has-text-right</code></td>
  247. <td>Makes the text aligned to the <strong>right</strong></td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. <hr>
  252. <h3 class="title">Responsive Alignment</h3>
  253. <div class="content">
  254. <p>
  255. 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.
  256. </p>
  257. <p>
  258. For example, here are the modifiers for <code>.has-text-left</code>:
  259. </p>
  260. </div>
  261. <table class="table is-bordered">
  262. {{ thead }}
  263. <tbody>
  264. <tr>
  265. <td><code>has-text-left-mobile</code></td>
  266. {{ left }}
  267. {{ unchanged }}
  268. {{ unchanged }}
  269. {{ unchanged }}
  270. {{ unchanged }}
  271. </tr>
  272. <tr>
  273. <td><code>has-text-left-tablet</code></td>
  274. {{ unchanged }}
  275. {{ left }}
  276. {{ left }}
  277. {{ left }}
  278. {{ left }}
  279. </tr>
  280. <tr>
  281. <td><code>has-text-left-tablet-only</code></td>
  282. {{ unchanged }}
  283. {{ left }}
  284. {{ unchanged }}
  285. {{ unchanged }}
  286. {{ unchanged }}
  287. </tr>
  288. <tr>
  289. <td><code>has-text-left-touch</code></td>
  290. {{ left }}
  291. {{ left }}
  292. {{ unchanged }}
  293. {{ unchanged }}
  294. {{ unchanged }}
  295. </tr>
  296. <tr>
  297. <td><code>has-text-left-desktop</code></td>
  298. {{ unchanged }}
  299. {{ unchanged }}
  300. {{ left }}
  301. {{ left }}
  302. {{ left }}
  303. </tr>
  304. <tr>
  305. <td><code>has-text-left-desktop-only</code></td>
  306. {{ unchanged }}
  307. {{ unchanged }}
  308. {{ left }}
  309. {{ unchanged }}
  310. {{ unchanged }}
  311. </tr>
  312. <tr>
  313. <td><code>has-text-left-widescreen</code></td>
  314. {{ unchanged }}
  315. {{ unchanged }}
  316. {{ unchanged }}
  317. {{ left }}
  318. {{ left }}
  319. </tr>
  320. <tr>
  321. <td><code>has-text-left-widescreen-only</code></td>
  322. {{ unchanged }}
  323. {{ unchanged }}
  324. {{ unchanged }}
  325. {{ left }}
  326. {{ unchanged }}
  327. </tr>
  328. <tr>
  329. <td><code>has-text-left-fullhd</code></td>
  330. {{ unchanged }}
  331. {{ unchanged }}
  332. {{ unchanged }}
  333. {{ unchanged }}
  334. {{ left }}
  335. </tr>
  336. </tbody>
  337. </table>
  338. <hr>
  339. <h3 class="title">Text transformation</h3>
  340. <div class="content">
  341. <p>
  342. You can transform the text with the use of one of <strong>3 text transformation helpers</strong>:
  343. </p>
  344. </div>
  345. <table class="table is-bordered">
  346. <thead>
  347. <tr>
  348. <th>
  349. Class
  350. </th>
  351. <th>
  352. Transformation
  353. </th>
  354. </tr>
  355. </thead>
  356. <tbody>
  357. <tr>
  358. <td><code>.is-capitalized</code></td>
  359. <td>Transforms <strong>the first character</strong> of each word to <strong>uppercase</strong></td>
  360. </tr>
  361. <tr>
  362. <td><code>.is-lowercase</code></td>
  363. <td>Transforms all characters to <strong>lowercase</strong></td>
  364. </tr>
  365. <tr>
  366. <td><code>.is-uppercase</code></td>
  367. <td>Transforms all characters to <strong>uppercase</strong></td>
  368. </tr>
  369. </tbody>
  370. </table>
  371. </div>
  372. </section>