responsive-helpers.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. ---
  2. title: Responsive helpers
  3. layout: documentation
  4. doc-tab: modifiers
  5. doc-subtab: responsive-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 flex %}
  37. <td class="is-narrow">
  38. <p class="notification is-success">flex</p>
  39. </td>
  40. {% endcapture %}
  41. {% capture visible %}
  42. <td class="is-narrow">
  43. <p class="notification is-success">visible</p>
  44. </td>
  45. {% endcapture %}
  46. {% capture hidden %}
  47. <td class="is-narrow">
  48. <p class="notification">hidden</p>
  49. </td>
  50. {% endcapture %}
  51. {% capture unchanged %}
  52. <td class="is-narrow">
  53. <p class="notification">unchanged</p>
  54. </td>
  55. {% endcapture %}
  56. {% include subnav-modifiers.html %}
  57. <section class="section">
  58. <div class="container">
  59. <h1 class="title">Responsive helpers</h1>
  60. <h2 class="subtitle"><strong>Show/hide content</strong> depending on the width of the viewport</h2>
  61. <hr>
  62. <h3 class="title">Show</h3>
  63. <div class="content">
  64. <p>
  65. You can use one of the following <code>display</code> classes:
  66. </p>
  67. <ul>
  68. <li><code>block</code></li>
  69. <li><code>flex</code></li>
  70. <li><code>inline</code></li>
  71. <li><code>inline-block</code></li>
  72. <li><code>inline-flex</code></li>
  73. </ul>
  74. <p>For example, here's what the <code>is-flex</code> helper works:</p>
  75. </div>
  76. <table class="table is-bordered">
  77. {{ thead }}
  78. <tbody>
  79. <tr>
  80. <td class="is-narrow">
  81. <code>is-flex-mobile</code>
  82. </td>
  83. {{ flex }}
  84. {{ unchanged }}
  85. {{ unchanged }}
  86. {{ unchanged }}
  87. {{ unchanged }}
  88. </tr>
  89. <tr>
  90. <td class="is-narrow">
  91. <code>is-flex-tablet-only</code>
  92. </td>
  93. {{ unchanged }}
  94. {{ flex }}
  95. {{ unchanged }}
  96. {{ unchanged }}
  97. {{ unchanged }}
  98. </tr>
  99. <tr>
  100. <td class="is-narrow">
  101. <code>is-flex-desktop-only</code>
  102. </td>
  103. {{ unchanged }}
  104. {{ unchanged }}
  105. {{ flex }}
  106. {{ unchanged }}
  107. {{ unchanged }}
  108. </tr>
  109. <tr>
  110. <td class="is-narrow">
  111. <code>is-flex-widescreen-only</code>
  112. </td>
  113. {{ unchanged }}
  114. {{ unchanged }}
  115. {{ unchanged }}
  116. {{ flex }}
  117. {{ unchanged }}
  118. </tr>
  119. <tr>
  120. <th colspan="5">
  121. <p>Classes to display <strong>up to</strong> or <strong>from</strong> a specific breakpoint</p>
  122. </th>
  123. </tr>
  124. <tr>
  125. <td class="is-narrow">
  126. <code>is-flex-touch</code>
  127. </td>
  128. {{ flex }}
  129. {{ flex }}
  130. {{ unchanged }}
  131. {{ unchanged }}
  132. {{ unchanged }}
  133. </tr>
  134. <tr>
  135. <td class="is-narrow">
  136. <code>is-flex-tablet</code>
  137. </td>
  138. {{ unchanged }}
  139. {{ flex }}
  140. {{ flex }}
  141. {{ flex }}
  142. {{ flex }}
  143. </tr>
  144. <tr>
  145. <td class="is-narrow">
  146. <code>is-flex-desktop</code>
  147. </td>
  148. {{ unchanged }}
  149. {{ unchanged }}
  150. {{ flex }}
  151. {{ flex }}
  152. {{ flex }}
  153. </tr>
  154. <tr>
  155. <td class="is-narrow">
  156. <code>is-flex-widescreen</code>
  157. </td>
  158. {{ unchanged }}
  159. {{ unchanged }}
  160. {{ unchanged }}
  161. {{ flex }}
  162. {{ flex }}
  163. </tr>
  164. <tr>
  165. <td class="is-narrow">
  166. <code>is-flex-fullhd</code>
  167. </td>
  168. {{ unchanged }}
  169. {{ unchanged }}
  170. {{ unchanged }}
  171. {{ unchanged }}
  172. {{ flex }}
  173. </tr>
  174. </tbody>
  175. </table>
  176. <div class="content">
  177. <p>For the other display options, just replace <code>is-flex</code> with <code>is-block</code> <code>is-inline</code> <code>is-inline-block</code> or <code>is-inline-flex</code>
  178. <hr>
  179. <h3 class="title">Hide</h3>
  180. <table class="table is-bordered">
  181. {{ thead }}
  182. <tbody>
  183. <tr>
  184. <td class="is-narrow">
  185. <code>is-hidden-mobile</code>
  186. </td>
  187. {{ hidden }}
  188. {{ visible }}
  189. {{ visible }}
  190. {{ visible }}
  191. {{ visible }}
  192. </tr>
  193. <tr>
  194. <td class="is-narrow">
  195. <code>is-hidden-tablet-only</code>
  196. </td>
  197. {{ visible }}
  198. {{ hidden }}
  199. {{ visible }}
  200. {{ visible }}
  201. {{ visible }}
  202. </tr>
  203. <tr>
  204. <td class="is-narrow">
  205. <code>is-hidden-desktop-only</code>
  206. </td>
  207. {{ visible }}
  208. {{ visible }}
  209. {{ hidden }}
  210. {{ visible }}
  211. {{ visible }}
  212. </tr>
  213. <tr>
  214. <td class="is-narrow">
  215. <code>is-hidden-widescreen-only</code>
  216. </td>
  217. {{ visible }}
  218. {{ visible }}
  219. {{ visible }}
  220. {{ hidden }}
  221. {{ visible }}
  222. </tr>
  223. <tr>
  224. <th colspan="5">
  225. <p>Classes to hide <strong>up to</strong> or <strong>from</strong> a specific breakpoint</p>
  226. </th>
  227. </tr>
  228. <tr>
  229. <td class="is-narrow">
  230. <code>is-hidden-touch</code>
  231. </td>
  232. {{ hidden }}
  233. {{ hidden }}
  234. {{ visible }}
  235. {{ visible }}
  236. {{ visible }}
  237. </tr>
  238. <tr>
  239. <td class="is-narrow">
  240. <code>is-hidden-tablet</code>
  241. </td>
  242. {{ visible }}
  243. {{ hidden }}
  244. {{ hidden }}
  245. {{ hidden }}
  246. {{ hidden }}
  247. </tr>
  248. <tr>
  249. <td class="is-narrow">
  250. <code>is-hidden-desktop</code>
  251. </td>
  252. {{ visible }}
  253. {{ visible }}
  254. {{ hidden }}
  255. {{ hidden }}
  256. {{ hidden }}
  257. </tr>
  258. <tr>
  259. <td class="is-narrow">
  260. <code>is-hidden-widescreen</code>
  261. </td>
  262. {{ visible }}
  263. {{ visible }}
  264. {{ visible }}
  265. {{ hidden }}
  266. {{ hidden }}
  267. </tr>
  268. <tr>
  269. <td class="is-narrow">
  270. <code>is-hidden-fullhd</code>
  271. </td>
  272. {{ visible }}
  273. {{ visible }}
  274. {{ visible }}
  275. {{ visible }}
  276. {{ hidden }}
  277. </tr>
  278. </tbody>
  279. </table>
  280. </div>
  281. </section>