responsive-helpers.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. ---
  2. title: Responsive helpers
  3. layout: documentation
  4. hide_categories: true
  5. doc-tab: modifiers
  6. doc-subtab: responsive-helpers
  7. breadcrumb:
  8. - home
  9. - documentation
  10. - modifiers
  11. - modifiers-responsive-helpers
  12. ---
  13. {% capture thead %}
  14. <thead>
  15. <tr>
  16. <th>
  17. Class
  18. </th>
  19. {% for breakpoint_hash in site.data.breakpoints %}
  20. {% assign breakpoint = breakpoint_hash[1] %}
  21. <th>
  22. {{ breakpoint.name }}<br>
  23. {% if breakpoint.id == 'mobile' %}
  24. Up to <code>{{ breakpoint.to }}px</code>
  25. {% elsif breakpoint.id == 'fullhd' %}
  26. <code>{{ breakpoint.from }}px</code> and above
  27. {% else %}
  28. Between <code>{{ breakpoint.from }}px</code> and <code>{{ breakpoint.to }}px</code>
  29. {% endif %}
  30. </th>
  31. {% endfor %}
  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 elements/anchor.html name="Show" %}
  56. <div class="content">
  57. <p>
  58. You can use one of the following <code>display</code> classes:
  59. </p>
  60. <ul>
  61. <li><code>block</code></li>
  62. <li><code>flex</code></li>
  63. <li><code>inline</code></li>
  64. <li><code>inline-block</code></li>
  65. <li><code>inline-flex</code></li>
  66. </ul>
  67. <p>For example, here's how the <code>is-flex</code> helper works:</p>
  68. </div>
  69. {% include layout/main-close.html show_categories=true %}
  70. <div class="container">
  71. <div class="table-container">
  72. <table class="table is-bordered">
  73. {{ thead }}
  74. <tbody>
  75. <tr>
  76. <td class="is-narrow">
  77. <code>is-flex-mobile</code>
  78. </td>
  79. {{ flex }}
  80. {{ unchanged }}
  81. {{ unchanged }}
  82. {{ unchanged }}
  83. {{ unchanged }}
  84. </tr>
  85. <tr>
  86. <td class="is-narrow">
  87. <code>is-flex-tablet-only</code>
  88. </td>
  89. {{ unchanged }}
  90. {{ flex }}
  91. {{ unchanged }}
  92. {{ unchanged }}
  93. {{ unchanged }}
  94. </tr>
  95. <tr>
  96. <td class="is-narrow">
  97. <code>is-flex-desktop-only</code>
  98. </td>
  99. {{ unchanged }}
  100. {{ unchanged }}
  101. {{ flex }}
  102. {{ unchanged }}
  103. {{ unchanged }}
  104. </tr>
  105. <tr>
  106. <td class="is-narrow">
  107. <code>is-flex-widescreen-only</code>
  108. </td>
  109. {{ unchanged }}
  110. {{ unchanged }}
  111. {{ unchanged }}
  112. {{ flex }}
  113. {{ unchanged }}
  114. </tr>
  115. <tr>
  116. <th colspan="5">
  117. <p>Classes to display <strong>up to</strong> or <strong>from</strong> a specific breakpoint</p>
  118. </th>
  119. </tr>
  120. <tr>
  121. <td class="is-narrow">
  122. <code>is-flex-touch</code>
  123. </td>
  124. {{ flex }}
  125. {{ flex }}
  126. {{ unchanged }}
  127. {{ unchanged }}
  128. {{ unchanged }}
  129. </tr>
  130. <tr>
  131. <td class="is-narrow">
  132. <code>is-flex-tablet</code>
  133. </td>
  134. {{ unchanged }}
  135. {{ flex }}
  136. {{ flex }}
  137. {{ flex }}
  138. {{ flex }}
  139. </tr>
  140. <tr>
  141. <td class="is-narrow">
  142. <code>is-flex-desktop</code>
  143. </td>
  144. {{ unchanged }}
  145. {{ unchanged }}
  146. {{ flex }}
  147. {{ flex }}
  148. {{ flex }}
  149. </tr>
  150. <tr>
  151. <td class="is-narrow">
  152. <code>is-flex-widescreen</code>
  153. </td>
  154. {{ unchanged }}
  155. {{ unchanged }}
  156. {{ unchanged }}
  157. {{ flex }}
  158. {{ flex }}
  159. </tr>
  160. <tr>
  161. <td class="is-narrow">
  162. <code>is-flex-fullhd</code>
  163. </td>
  164. {{ unchanged }}
  165. {{ unchanged }}
  166. {{ unchanged }}
  167. {{ unchanged }}
  168. {{ flex }}
  169. </tr>
  170. </tbody>
  171. </table>
  172. </div>
  173. </div>
  174. {% include layout/main-open.html %}
  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 elements/anchor.html name="Hide" %}
  181. {% include layout/main-close.html %}
  182. <div class="container">
  183. <div class="table-container">
  184. <table class="table is-bordered">
  185. {{ thead }}
  186. <tbody>
  187. <tr>
  188. <td class="is-narrow">
  189. <code>is-hidden-mobile</code>
  190. </td>
  191. {{ hidden }}
  192. {{ visible }}
  193. {{ visible }}
  194. {{ visible }}
  195. {{ visible }}
  196. </tr>
  197. <tr>
  198. <td class="is-narrow">
  199. <code>is-hidden-tablet-only</code>
  200. </td>
  201. {{ visible }}
  202. {{ hidden }}
  203. {{ visible }}
  204. {{ visible }}
  205. {{ visible }}
  206. </tr>
  207. <tr>
  208. <td class="is-narrow">
  209. <code>is-hidden-desktop-only</code>
  210. </td>
  211. {{ visible }}
  212. {{ visible }}
  213. {{ hidden }}
  214. {{ visible }}
  215. {{ visible }}
  216. </tr>
  217. <tr>
  218. <td class="is-narrow">
  219. <code>is-hidden-widescreen-only</code>
  220. </td>
  221. {{ visible }}
  222. {{ visible }}
  223. {{ visible }}
  224. {{ hidden }}
  225. {{ visible }}
  226. </tr>
  227. <tr>
  228. <th colspan="5">
  229. <p>Classes to hide <strong>up to</strong> or <strong>from</strong> a specific breakpoint</p>
  230. </th>
  231. </tr>
  232. <tr>
  233. <td class="is-narrow">
  234. <code>is-hidden-touch</code>
  235. </td>
  236. {{ hidden }}
  237. {{ hidden }}
  238. {{ visible }}
  239. {{ visible }}
  240. {{ visible }}
  241. </tr>
  242. <tr>
  243. <td class="is-narrow">
  244. <code>is-hidden-tablet</code>
  245. </td>
  246. {{ visible }}
  247. {{ hidden }}
  248. {{ hidden }}
  249. {{ hidden }}
  250. {{ hidden }}
  251. </tr>
  252. <tr>
  253. <td class="is-narrow">
  254. <code>is-hidden-desktop</code>
  255. </td>
  256. {{ visible }}
  257. {{ visible }}
  258. {{ hidden }}
  259. {{ hidden }}
  260. {{ hidden }}
  261. </tr>
  262. <tr>
  263. <td class="is-narrow">
  264. <code>is-hidden-widescreen</code>
  265. </td>
  266. {{ visible }}
  267. {{ visible }}
  268. {{ visible }}
  269. {{ hidden }}
  270. {{ hidden }}
  271. </tr>
  272. <tr>
  273. <td class="is-narrow">
  274. <code>is-hidden-fullhd</code>
  275. </td>
  276. {{ visible }}
  277. {{ visible }}
  278. {{ visible }}
  279. {{ visible }}
  280. {{ hidden }}
  281. </tr>
  282. </tbody>
  283. </table>
  284. </div>
  285. </div>
  286. {% include layout/main-open.html %}