File: Sizing.md

package info (click to toggle)
cockpit 354-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 308,956 kB
  • sloc: javascript: 775,606; python: 40,351; ansic: 35,655; cpp: 11,117; sh: 3,511; makefile: 580; xml: 261
file content (250 lines) | stat: -rw-r--r-- 9,097 bytes parent folder | download | duplicates (4)
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
---
id: Sizing
section: utility-classes
---import './Sizing.css'

## Examples

### Width base and percentage units

```html
<div class="ws-example-u-sizing-item pf-v6-u-w-0">.pf-v6-u-w-0</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-25">.pf-v6-u-w-25</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-50">.pf-v6-u-w-50</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-75">.pf-v6-u-w-75</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-100">.pf-v6-u-w-100</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-w-initial"
>.pf-v6-u-w-initial (auto)</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-inherit">.pf-v6-u-w-inherit</div>

```

### Usage

[Breakpoints](/tokens/all-patternfly-tokens) are optional. Breakpoint options include: base (no breakpoint value), `-on-sm`, `-on-md`, `-on-lg`, and `-on-xl`. Example: `.pf-v6-u-w-initial-on-lg`

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-u-w-initial{-on-[breakpoint]}` | `*` | Sets width: initial (auto) |
| `.pf-v6-u-w-inherit{-on-[breakpoint]}` | `*` | Sets width: inherit |
| `.pf-v6-u-w-0{-on-[breakpoint]}`  | `*` | Sets width: 0% |
| `.pf-v6-u-w-25{-on-[breakpoint]}` | `*` | Sets width: 25% |
| `.pf-v6-u-w-33{-on-[breakpoint]}` | `*` | Sets width: calc(100% / 3) |
| `.pf-v6-u-w-50{-on-[breakpoint]}` | `*` | Sets width: 50% |
| `.pf-v6-u-w-66{-on-[breakpoint]}` | `*` | Sets width: calc(100% / 3 \* 2) |
| `.pf-v6-u-w-75{-on-[breakpoint]}` | `*` | Sets width: 75% |
| `.pf-v6-u-w-100{-on-[breakpoint]}` | `*` | Sets width: 100% |

### Width viewport units

```html isFullscreen
<div class="ws-example-u-sizing-item pf-v6-u-w-25vw">.pf-v6-u-w-25vw</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-33vw">.pf-v6-u-w-33vw</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-50vw">.pf-v6-u-w-50vw</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-66vw">.pf-v6-u-w-66vw</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-75vw">.pf-v6-u-w-75vw</div>
<div class="ws-example-u-sizing-item pf-v6-u-w-100vw">.pf-v6-u-w-100vw</div>

```

### Usage

[Breakpoints](/tokens/all-patternfly-tokens) are optional. Breakpoint options include: base (no breakpoint value), `-on-sm`, `-on-md`, `-on-lg`, and `-on-xl`. Example: `.pf-v6-u-w-25vw-on-lg`

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-u-w-25vw{-on-[breakpoint]}` | `*` | Sets width: 25vw |
| `.pf-v6-u-w-33vw{-on-[breakpoint]}` | `*` | Sets width: calc(100vw / 3) |
| `.pf-v6-u-w-50vw{-on-[breakpoint]}` | `*` | Sets width: 50vw |
| `.pf-v6-u-w-66vw{-on-[breakpoint]}` | `*` | Sets width: calc(100vw / 3 \* 2) |
| `.pf-v6-u-w-75vw{-on-[breakpoint]}` | `*` | Sets width: 75vw |
| `.pf-v6-u-w-100vw{-on-[breakpoint]}` | `*` | Sets width: 100vw |

### Height base and percentage units

```html
<div
  class="ws-example-u-sizing-item pf-v6-u-h-0 pf-v6-u-display-inline-block"
>.pf-v6-u-h-0</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-25 pf-v6-u-display-inline-block"
>.pf-v6-u-h-25</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-50 pf-v6-u-display-inline-block"
>.pf-v6-u-h-50</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-75 pf-v6-u-display-inline-block"
>.pf-v6-u-h-75</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-100 pf-v6-u-display-inline-block"
>.pf-v6-u-h-100</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-initial pf-v6-u-display-inline-block"
>.pf-v6-u-h-initial</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-inherit pf-v6-u-display-inline-block"
>.pf-v6-u-h-inherit</div>

```

### Usage

[Breakpoints](/tokens/all-patternfly-tokens) are optional. Breakpoint options include: base (no breakpoint value), `-on-sm`, `-on-md`, `-on-lg`, and `-on-xl`. Example: `.pf-v6-u-h-initial-on-lg`

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-u-h-initial{-on-[breakpoint]}` | `*` | Sets height: initial (auto) |
| `.pf-v6-u-h-inherit{-on-[breakpoint]}` | `*` | Sets height: inherit |
| `.pf-v6-u-h-0{-on-[breakpoint]}` | `*` | Sets height: 0% |
| `.pf-v6-u-h-25{-on-[breakpoint]}`| `*` | Sets height: 25% |
| `.pf-v6-u-h-33{-on-[breakpoint]}`| `*` | Sets height: calc(100% / 3) |
| `.pf-v6-u-h-50{-on-[breakpoint]}`| `*` | Sets height: 50% |
| `.pf-v6-u-h-66{-on-[breakpoint]}`| `*` | Sets height: calc(100% / 3 \* 2) |
| `.pf-v6-u-h-75{-on-[breakpoint]}`| `*` | Sets height: 75% |
| `.pf-v6-u-h-100{-on-[breakpoint]}` | `*` | Sets height: 100% |

### Height viewport units

```html isFullscreen
<div
  class="ws-example-u-sizing-item pf-v6-u-h-25vh pf-v6-u-display-inline-block"
>.pf-v6-u-h-25vh</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-33vh pf-v6-u-display-inline-block"
>.pf-v6-u-h-33vh</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-50vh pf-v6-u-display-inline-block"
>.pf-v6-u-h-50vh</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-66vh pf-v6-u-display-inline-block"
>.pf-v6-u-h-66vh</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-75vh pf-v6-u-display-inline-block"
>.pf-v6-u-h-75vh</div>
<div
  class="ws-example-u-sizing-item pf-v6-u-h-100vh pf-v6-u-display-inline-block"
>.pf-v6-u-h-100vh</div>

```

### Usage

[Breakpoints](/tokens/all-patternfly-tokens) are optional. Breakpoint options include: base (no breakpoint value), `-on-sm`, `-on-md`, `-on-lg`, and `-on-xl`. Example: `.pf-v6-u-h-25vh-on-lg`

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-u-h-25vh{-on-[breakpoint]}` | `*` | Sets height: 25vh |
| `.pf-v6-u-h-33vh{-on-[breakpoint]}` | `*` | Sets height: calc(100vh / 3) |
| `.pf-v6-u-h-50vh{-on-[breakpoint]}` | `*` | Sets height: 50vh |
| `.pf-v6-u-h-66vh{-on-[breakpoint]}` | `*` | Sets height: calc(100vh / 3 \* 2) |
| `.pf-v6-u-h-75vh{-on-[breakpoint]}` | `*` | Sets height: 75vh |
| `.pf-v6-u-h-100vh{-on-[breakpoint]}` | `*` | Sets height: 100vh |

### Min width

```html
<div
  class="pf-v6-u-min-width"
  style="--pf-v6-u-min-width--MinWidth: 50ch;"
>Min-width 50ch example</div>

```

### Max width

```html
<div
  class="pf-v6-u-max-width"
  style="--pf-v6-u-max-width--MaxWidth: 50ch;"
>Max-width 50ch example</div>

```

### Min and max width

```html
<div
  class="pf-v6-u-min-width pf-v6-u-max-width"
  style="--pf-v6-u-min-width--MinWidth: 30ch; --pf-v6-u-max-width--MaxWidth: 50ch;"
>Min-width 30ch, max-width 50ch example</div>

```

### Responsive width control

```html
<div
  class="pf-v6-u-min-width pf-v6-u-max-width"
  style="--pf-v6-u-min-width--MinWidth: 20ch; --pf-v6-u-max-width--MaxWidth: 30ch; --pf-v6-u-max-width--MaxWidth-on-md: 50ch; --pf-v6-u-max-width--MaxWidth-on-xl: 70ch;"
>Min-width 20ch, max-width 30ch, max-width-on-md 50ch, max-width-on-xl 70ch example</div>

```

### Usage

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-u-min-width` | `*` | Sets min-width: `var(--pf-v6-u-min-width--MinWidth{-on-[breakpoint]})`. |
| `.pf-v6-u-max-width` | `*` | Sets min-width: `var(--pf-v6-u-max-width--MaxWidth{-on-[breakpoint]})`. |

[Breakpoints](/tokens/all-patternfly-tokens) are optional. Breakpoint options include: base (no breakpoint value), `-on-sm`, `-on-md`, `-on-lg`, and `-on-xl`. Example: `.--pf-v6-u-min-width--MinWidth-on-lg`

| Custom property | Applied to | Outcome |
| -- | -- | -- |
| `--pf-v6-u-min-width--MinWidth{-on-[breakpoint]}: {width}` | `.pf-v6-u-min-width` | Modifies the min width custom property. |
| `--pf-v6-u-max-width--MaxWidth{-on-[breakpoint]}: {width}` | `.pf-v6-u-max-width` | Modifies the max width custom property. |

### Min height

```html
<div
  class="pf-v6-u-min-height"
  style="--pf-v6-u-min-height--MinHeight: 50ch;"
>Min-height 50ch example</div>

```

### Max height

```html
<div
  class="pf-v6-u-max-height"
  style="--pf-v6-u-max-height--MaxHeight: 50ch;"
>Max-height 50ch example</div>

```

### Min and max height

```html
<div
  class="pf-v6-u-min-height pf-v6-u-max-height"
  style="--pf-v6-u-min-height--MinHeight: 30ch; --pf-v6-u-max-height--MaxHeight: 50ch;"
>Min-height 30ch, max-height 50ch example</div>

```

### Responsive height control

```html
<div
  class="pf-v6-u-min-height pf-v6-u-max-height"
  style="--pf-v6-u-min-height--MinHeight: 20ch; --pf-v6-u-max-height--MaxHeight: 30ch; --pf-v6-u-max-height--MaxHeight-on-md: 50ch; --pf-v6-u-max-height--MaxHeight-on-xl: 70ch;"
>Min-height 20ch, max-height 30ch, max-height-on-md 50ch, max-height-on-xl 70ch example</div>

```

### Usage

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-u-min-height` | `*` | Sets min-height: `var(--pf-v6-u-min-height--MinHeight{-on-[breakpoint]})`. |
| `.pf-v6-u-max-height` | `*` | Sets max-height: `var(--pf-v6-u-max-height--MaxHeight{-on-[breakpoint]})`. |

[Breakpoints](/tokens/all-patternfly-tokens) are optional. Breakpoint options include: base (no breakpoint value), `-on-sm`, `-on-md`, `-on-lg`, and `-on-xl`. Example: `.--pf-v6-u-min-height--MinHeight-on-lg`

| Custom property | Applied to | Outcome |
| -- | -- | -- |
| `--pf-v6-u-min-height--MinHeight{-on-[breakpoint]}: {height}` | `.pf-v6-u-min-height` | Modifies the min height custom property. |
| `--pf-v6-u-max-height--MaxHeight{-on-[breakpoint]}: {height}` | `.pf-v6-u-max-height` | Modifies the max height custom property. |