responsive-helpers.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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. {% include anchor.html name="Show" %}
  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>
  177. 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. </p>
  179. </div>
  180. {% include anchor.html name="Hide" %}
  181. <table class="table is-bordered">
  182. {{ thead }}
  183. <tbody>
  184. <tr>
  185. <td class="is-narrow">
  186. <code>is-hidden-mobile</code>
  187. </td>
  188. {{ hidden }}
  189. {{ visible }}
  190. {{ visible }}
  191. {{ visible }}
  192. {{ visible }}
  193. </tr>
  194. <tr>
  195. <td class="is-narrow">
  196. <code>is-hidden-tablet-only</code>
  197. </td>
  198. {{ visible }}
  199. {{ hidden }}
  200. {{ visible }}
  201. {{ visible }}
  202. {{ visible }}
  203. </tr>
  204. <tr>
  205. <td class="is-narrow">
  206. <code>is-hidden-desktop-only</code>
  207. </td>
  208. {{ visible }}
  209. {{ visible }}
  210. {{ hidden }}
  211. {{ visible }}
  212. {{ visible }}
  213. </tr>
  214. <tr>
  215. <td class="is-narrow">
  216. <code>is-hidden-widescreen-only</code>
  217. </td>
  218. {{ visible }}
  219. {{ visible }}
  220. {{ visible }}
  221. {{ hidden }}
  222. {{ visible }}
  223. </tr>
  224. <tr>
  225. <th colspan="5">
  226. <p>Classes to hide <strong>up to</strong> or <strong>from</strong> a specific breakpoint</p>
  227. </th>
  228. </tr>
  229. <tr>
  230. <td class="is-narrow">
  231. <code>is-hidden-touch</code>
  232. </td>
  233. {{ hidden }}
  234. {{ hidden }}
  235. {{ visible }}
  236. {{ visible }}
  237. {{ visible }}
  238. </tr>
  239. <tr>
  240. <td class="is-narrow">
  241. <code>is-hidden-tablet</code>
  242. </td>
  243. {{ visible }}
  244. {{ hidden }}
  245. {{ hidden }}
  246. {{ hidden }}
  247. {{ hidden }}
  248. </tr>
  249. <tr>
  250. <td class="is-narrow">
  251. <code>is-hidden-desktop</code>
  252. </td>
  253. {{ visible }}
  254. {{ visible }}
  255. {{ hidden }}
  256. {{ hidden }}
  257. {{ hidden }}
  258. </tr>
  259. <tr>
  260. <td class="is-narrow">
  261. <code>is-hidden-widescreen</code>
  262. </td>
  263. {{ visible }}
  264. {{ visible }}
  265. {{ visible }}
  266. {{ hidden }}
  267. {{ hidden }}
  268. </tr>
  269. <tr>
  270. <td class="is-narrow">
  271. <code>is-hidden-fullhd</code>
  272. </td>
  273. {{ visible }}
  274. {{ visible }}
  275. {{ visible }}
  276. {{ visible }}
  277. {{ hidden }}
  278. </tr>
  279. </tbody>
  280. </table>
  281. </div>
  282. </section>