summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/CSS/bootstrap/docs/_includes/css/responsive-utilities.html
blob: ac73bf645ffa98bc7ef6af814bc2cda078de90dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<div class="bs-docs-section">
  <h1 id="responsive-utilities" class="page-header">Responsive utilities</h1>

  <p class="lead">For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query. Also included are utility classes for toggling content when printed.</p>
  <p>Try to use these on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.</p>


  <h2 id="responsive-utilities-classes">Available classes</h2>
  <p>Use a single or combination of the available classes for toggling content across viewport breakpoints.</p>
  <div class="table-responsive">
    <table class="table table-bordered table-striped responsive-utilities">
      <thead>
        <tr>
          <th></th>
          <th>
            Extra small devices
            <small>Phones (&lt;768px)</small>
          </th>
          <th>
            Small devices
            <small>Tablets (&ge;768px)</small>
          </th>
          <th>
            Medium devices
            <small>Desktops (&ge;992px)</small>
          </th>
          <th>
            Large devices
            <small>Desktops (&ge;1200px)</small>
          </th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row"><code>.visible-xs-*</code></th>
          <td class="is-visible">Visible</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-hidden">Hidden</td>
        </tr>
        <tr>
          <th scope="row"><code>.visible-sm-*</code></th>
          <td class="is-hidden">Hidden</td>
          <td class="is-visible">Visible</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-hidden">Hidden</td>
        </tr>
        <tr>
          <th scope="row"><code>.visible-md-*</code></th>
          <td class="is-hidden">Hidden</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-visible">Visible</td>
          <td class="is-hidden">Hidden</td>
        </tr>
        <tr>
          <th scope="row"><code>.visible-lg-*</code></th>
          <td class="is-hidden">Hidden</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-visible">Visible</td>
        </tr>
      </tbody>
      <tbody>
        <tr>
          <th scope="row"><code>.hidden-xs</code></th>
          <td class="is-hidden">Hidden</td>
          <td class="is-visible">Visible</td>
          <td class="is-visible">Visible</td>
          <td class="is-visible">Visible</td>
        </tr>
        <tr>
          <th scope="row"><code>.hidden-sm</code></th>
          <td class="is-visible">Visible</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-visible">Visible</td>
          <td class="is-visible">Visible</td>
        </tr>
        <tr>
          <th scope="row"><code>.hidden-md</code></th>
          <td class="is-visible">Visible</td>
          <td class="is-visible">Visible</td>
          <td class="is-hidden">Hidden</td>
          <td class="is-visible">Visible</td>
        </tr>
        <tr>
          <th scope="row"><code>.hidden-lg</code></th>
          <td class="is-visible">Visible</td>
          <td class="is-visible">Visible</td>
          <td class="is-visible">Visible</td>
          <td class="is-hidden">Hidden</td>
        </tr>
      </tbody>
    </table>
  </div>

  <p>As of v3.2.0, the <code>.visible-*-*</code> classes for each breakpoint come in three variations, one for each CSS <code>display</code> property value listed below.</p>
  <div class="table-responsive">
    <table class="table table-bordered table-striped">
      <thead>
        <tr>
          <th>Group of classes</th>
          <th>CSS <code>display</code></th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row"><code>.visible-*-block</code></th>
          <td><code>display: block;</code></td>
        </tr>
        <tr>
          <th scope="row"><code>.visible-*-inline</code></th>
          <td><code>display: inline;</code></td>
        </tr>
        <tr>
          <th scope="row"><code>.visible-*-inline-block</code></th>
          <td><code>display: inline-block;</code></td>
        </tr>
      </tbody>
    </table>
  </div>
  <p>So, for extra small (<code>xs</code>) screens for example, the available <code>.visible-*-*</code> classes are: <code>.visible-xs-block</code>, <code>.visible-xs-inline</code>, and <code>.visible-xs-inline-block</code>.</p>
  <p>The classes <code>.visible-xs</code>, <code>.visible-sm</code>, <code>.visible-md</code>, and <code>.visible-lg</code> also exist, but are <strong>deprecated as of v3.2.0</strong>. They are approximately equivalent to <code>.visible-*-block</code>, except with additional special cases for toggling <code>&lt;table&gt;</code>-related elements.</p>

  <h2 id="responsive-utilities-print">Print classes</h2>
  <p>Similar to the regular responsive classes, use these for toggling content for print.</p>
  <div class="table-responsive">
    <table class="table table-bordered table-striped responsive-utilities">
      <thead>
        <tr>
          <th>Classes</th>
          <th>Browser</th>
          <th>Print</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">
            <code>.visible-print-block</code><br>
            <code>.visible-print-inline</code><br>
            <code>.visible-print-inline-block</code>
          </th>
          <td class="is-hidden">Hidden</td>
          <td class="is-visible">Visible</td>
        </tr>
        <tr>
          <th scope="row"><code>.hidden-print</code></th>
          <td class="is-visible">Visible</td>
          <td class="is-hidden">Hidden</td>
        </tr>
      </tbody>
    </table>
  </div>
  <p>The class <code>.visible-print</code> also exists but is <strong>deprecated</strong> as of v3.2.0. It is approximately equivalent to <code>.visible-print-block</code>, except with additional special cases for <code>&lt;table&gt;</code>-related elements.</p>


  <h2 id="responsive-utilities-tests">Test cases</h2>
  <p>Resize your browser or load on different devices to test the responsive utility classes.</p>

  <h3>Visible on...</h3>
  <p>Green checkmarks indicate the element <strong>is visible</strong> in your current viewport.</p>
  <div class="row responsive-utilities-test visible-on">
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-xs">Extra small</span>
      <span class="visible-xs-block">&#10004; Visible on x-small</span>
    </div>
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-sm">Small</span>
      <span class="visible-sm-block">&#10004; Visible on small</span>
    </div>
    <div class="clearfix visible-xs-block"></div>
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-md">Medium</span>
      <span class="visible-md-block">&#10004; Visible on medium</span>
    </div>
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-lg">Large</span>
      <span class="visible-lg-block">&#10004; Visible on large</span>
    </div>
  </div>
  <div class="row responsive-utilities-test visible-on">
    <div class="col-xs-6">
      <span class="hidden-xs hidden-sm">Extra small and small</span>
      <span class="visible-xs-block visible-sm-block">&#10004; Visible on x-small and small</span>
    </div>
    <div class="col-xs-6">
      <span class="hidden-md hidden-lg">Medium and large</span>
      <span class="visible-md-block visible-lg-block">&#10004; Visible on medium and large</span>
    </div>
    <div class="clearfix visible-xs-block"></div>
    <div class="col-xs-6">
      <span class="hidden-xs hidden-md">Extra small and medium</span>
      <span class="visible-xs-block visible-md-block">&#10004; Visible on x-small and medium</span>
    </div>
    <div class="col-xs-6">
      <span class="hidden-sm hidden-lg">Small and large</span>
      <span class="visible-sm-block visible-lg-block">&#10004; Visible on small and large</span>
    </div>
    <div class="clearfix visible-xs-block"></div>
    <div class="col-xs-6">
      <span class="hidden-xs hidden-lg">Extra small and large</span>
      <span class="visible-xs-block visible-lg-block">&#10004; Visible on x-small and large</span>
    </div>
    <div class="col-xs-6">
      <span class="hidden-sm hidden-md">Small and medium</span>
      <span class="visible-sm-block visible-md-block">&#10004; Visible on small and medium</span>
    </div>
  </div>

  <h3>Hidden on...</h3>
  <p>Here, green checkmarks also indicate the element <strong>is hidden</strong> in your current viewport.</p>
  <div class="row responsive-utilities-test hidden-on">
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-xs">Extra small</span>
      <span class="visible-xs-block">&#10004; Hidden on x-small</span>
    </div>
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-sm">Small</span>
      <span class="visible-sm-block">&#10004; Hidden on small</span>
    </div>
    <div class="clearfix visible-xs-block"></div>
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-md">Medium</span>
      <span class="visible-md-block">&#10004; Hidden on medium</span>
    </div>
    <div class="col-xs-6 col-sm-3">
      <span class="hidden-lg">Large</span>
      <span class="visible-lg-block">&#10004; Hidden on large</span>
    </div>
  </div>
  <div class="row responsive-utilities-test hidden-on">
    <div class="col-xs-6">
      <span class="hidden-xs hidden-sm">Extra small and small</span>
      <span class="visible-xs-block visible-sm-block">&#10004; Hidden on x-small and small</span>
    </div>
    <div class="col-xs-6">
      <span class="hidden-md hidden-lg">Medium and large</span>
      <span class="visible-md-block visible-lg-block">&#10004; Hidden on medium and large</span>
    </div>
    <div class="clearfix visible-xs-block"></div>
    <div class="col-xs-6">
      <span class="hidden-xs hidden-md">Extra small and medium</span>
      <span class="visible-xs-block visible-md-block">&#10004; Hidden on x-small and medium</span>
    </div>
    <div class="col-xs-6">
      <span class="hidden-sm hidden-lg">Small and large</span>
      <span class="visible-sm-block visible-lg-block">&#10004; Hidden on small and large</span>
    </div>
    <div class="clearfix visible-xs-block"></div>
    <div class="col-xs-6">
      <span class="hidden-xs hidden-lg">Extra small and large</span>
      <span class="visible-xs-block visible-lg-block">&#10004; Hidden on x-small and large</span>
    </div>
    <div class="col-xs-6">
      <span class="hidden-sm hidden-md">Small and medium</span>
      <span class="visible-sm-block visible-md-block">&#10004; Hidden on small and medium</span>
    </div>
  </div>
</div>