responsive-helpers.html 6.7 KB

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