File: overview.scss

package info (click to toggle)
cockpit 239-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 67,268 kB
  • sloc: javascript: 245,474; ansic: 72,273; python: 23,634; xml: 6,155; sh: 2,919; makefile: 923; sed: 5
file content (398 lines) | stat: -rw-r--r-- 8,907 bytes parent folder | download
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
@import "./system-global.scss";
@import "@patternfly/patternfly/components/Table/table.scss";

/* System Time Modal dialog needs table.css */
@import "../lib/table.css";

.ct-limited-access-alert {
  align-items: center;
  background: var(--pf-global--active-color--200);
  margin-bottom: 0;
  padding: 1rem 1.5rem;

  // Override PF4 spacing to better align to the overview page
  // and rely on ct-limited-access-alert for padding & alignment
  &.pf-c-alert.pf-m-info.pf-m-inline {
    > .pf-c-alert__icon,
    > .pf-c-alert__title,
    > .pf-c-alert__action {
      padding: 0;
    }

    > .pf-c-alert__icon {
      // Make the icon slightly darker, to compensate for the background
      color: var(--pf-global--active-color--400);
      padding-right: 1rem;
    }
  }

  // Remove the left-side stripe
  &:before {
    display: none;
  }

  // Deconstruct nicely on small screen sizes (especially mobile)
  // This will not be needed in a future PF4 update
  //
  // References: 
  // - https://github.com/cockpit-project/cockpit/issues/14106
  // - https://github.com/patternfly/patternfly/issues/3125
  // - https://github.com/patternfly/patternfly/pull/2921
  //
  // When we have the upcoming version of PF4 in Cockpit, we should drop this code
  // (and adjust things for the button to show up on the side of desktop mode instead)
  @media (max-width: $pf-global--breakpoint--lg) {
    grid-template-areas: "icon title" ". content" ". action";
    grid-gap: var(--pf-global--spacer--sm) 0;
  }
  @media (max-width: 320px) {
    // Allow the action button to have a bit more space on iPhone SE sized phones
    grid-template-areas: "icon title" ". content" "action action";
  }
}

.ct-overview-header {
  align-items: center;
  display: flex;
  flex: none;

  &,
  &-hostname {
    flex-wrap: wrap;
  }

  &-actions,
  &-hostname {
    box-sizing: border-box;
    display: flex;
  }

  &-hostname {
    align-items: baseline;
    flex: auto;
    /* Collapse down to 15rem, to help preserve button on the right */
    flex-basis: 15rem;

    > h1 {
      font-size: var(--pf-global--FontSize--2xl);
    }
  }

  &-hostname > h1,
  &-subheading {
    padding-right: 1rem;
  }

  &-actions {
    align-items: center;
  }

  &-subheading {
    font-size: var(--pf-global--FontSize--md);
  }

  .fa.fa-lock, .fa.fa-unlock-alt {
    margin-right: 0.5rem;
  }
}

.ct-system-overview {
  --card-width: 22rem;
  --pf-l-gallery--GridTemplateColumns: repeat(auto-fill, minmax(var(--card-width), 1fr));

  .motd-box {
    grid-column: 1 / -1;
  }

  .pf-c-card {
    &__title {
      font-size: var(--pf-global--FontSize--xl);
      font-weight: var(--pf-global--FontWeight--normal);
    }

    &__body {
      .fa,
      .pficon {
        + a, + span {
          /* Space out icons + links */
          margin-left: 0.5rem;
        }
      }

      a {
        > .fa,
        > .pficon {
          /* Space out icons inside of links */
          margin-right: 0.5rem;
        }
      }

      &:last-child .pf-c-table:last-child tr:last-child {
        /* Remove the border of tables when it's the last item in a card and there isn't a card footer */
        border-bottom: none;
      }

      p {
        + p,
        + button {
            margin-top: calc(var(--pf-global--LineHeight--md) * 1rem);
        }
      }

      td {
        vertical-align: middle;
      }

      th {
        font-size: var(--pf-global--FontSize--sm);
      }
    }

    &__footer {
      &:empty {
        display: none;
      }
    }
  }

  .pf-c-progress {
    &__status {
      display: flex;
      align-items: baseline;

      &-icon {
        display: flex;
        align-self: center;
      }
    }
  }

  .pf-m-compact {
    th, td {
      &:first-child {
        padding-left: 0;
      }

      &:last-child {
        padding-right: 0;
      }
    }
  }
}

@media (orientation: landscape) and (min-width: 684px) and (max-width: 832px) and (max-height: 703px) {
  /* Optimize for VMs  */
  /*
    Full offset:  Sidebar: 240, switcher: 100
    Small offset: Sidebar: 192, switcher: 84

    Max sidebar (with switcher): 240 + 100 = 340
    Min sidebar (without switcher): 192

    Min iframe width (with switcher): 1024 - 340 = 684
    Max iframe width (without switcher): 1024 - 192 = 832

    Height offset: 65px (for the heading)
    Max iframe: 768 - 65 = 703

    NOTE: For cross-browser reasons, the above media breakpoints need to be px
    NOTE 2: This should be updated when the navigation is updated
  */

  .ct-system-overview {
    /* Adjust card width to be approx. 2×2 */
    --card-width: 16rem;
  }
}

@media (max-width: 320px) {
  /* Make the overview fit on very narrow screens like an iPhone SE */

  .pf-c-page__main-section:not(.ct-overview-header) {
    /* Remove left and right padding for cards on narrow viewports */
    --pf-c-page__main-section--PaddingRight: 0;
    --pf-c-page__main-section--PaddingLeft: 0;
    --pf-c-page__main-section--PaddingTop: 0.5rem;
    --pf-c-page__main-section--PaddingBottom: 0.5rem;
  }

  .ct-system-overview {
    /* Reduce spacing between items */
    --pf-l-gallery--m-gutter--GridGap: 0.25rem;
  }
}

@media (max-device-width: 780px) and (orientation: portrait) {
  /* Allow cards to be stretch to edges on mobile devices */
  .ct-system-overview {
    --card-width: 100%;
  }
}

@media (max-width: 779px) {
  /* Reduce gutter & padding on smaller widths, for desktop & mobile */

  .pf-l-gallery {
    --pf-l-gallery--m-gutter--GridGap: calc(var(--pf-global--gutter--md)/2);
  }

  .pf-c-card {
    --pf-c-card--first-child--PaddingTop: var(--pf-global--spacer--md);
    --pf-c-card--child--PaddingRight: var(--pf-global--spacer--md);
    --pf-c-card--child--PaddingBottom: var(--pf-global--spacer--md);
    --pf-c-card--child--PaddingLeft: var(--pf-global--spacer--md);
    --pf-c-card__title--not-last-child--PaddingBottom: var(--pf-global--spacer--sm);
  }
}

@media (min-width: 780px) {
  /* Embiggen subheading & card headings when there's space */

  .ct-system-overview .pf-c-card__title {
    font-size: var(--pf-global--FontSize--2xl);
  }

  .ct-overview-header-subheading {
    font-size: var(--pf-global--FontSize--lg);
  }
}

@media (min-width: 1000px) and (max-width: 1400px) {
  /* optimize for approx 1600×1200 on desktops */
  /* (numbers are fudgy due to our nav & possibility of desktop's panels) */

  .ct-system-overview {
    --card-width: 25rem;
  }
}

#machine_id {
  font-family: var(--pf-global--FontFamily--redhatfont--monospace);
  // Some browsers don't support anywhere yet, so we provide break-word as a fallback
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}

.pf-c-table tr > * {
  vertical-align: top;
}

.ct-inline-list .pf-c-list.pf-m-inline {
  display: inline-flex;
  margin-left: 1rem;
}

.realms-op-diagnostics {
  /* standard PF alerts have a wide margin */
  max-width: 550px;
  text-align: left;
  max-height: 200px;
}

.realms-op-error .realms-op-more-diagnostics {
  font-weight: normal;
}

.realms-op-leave-only-row .pf-c-alert {
  /* standard PF alerts have a wide margin */
  padding-left: 2ex;

  button {
    margin: 1ex 0;
  }
}

#realms-op-leave-toggle {
  font-weight: bold;
  /* leave some space between form and leave toggle */
  line-height: 5rem;
}

.realms-op-wait-message {
  margin-left: 10px;
  float: right;
  margin-top: 3px;
}

#sich-hostname-helper {
    white-space: break-spaces;
}

.small-messages {
  font-size: smaller;
}

.systime-inline {
  .form-control {
    margin: 0 4px;
  }

  .form-group {
    &:first-of-type .form-control {
      margin: 0 4px 0 0;
    }

    .form-control {
      width: 214px;
    }
  }

  .form-inline {
    background: #f4f4f4;
    border: 1px solid #bababa;
    padding: 4px;

    &:not(:first-of-type) {
      border-top-width: 0;
    }
  }

  form {
    .pficon-close,
    .fa-plus {
      float: right;
      margin-left: 5px;
      padding: 4px;
      height: 26px;
      width: 26px;
    }
  }
}

.pf-c-button.no-left-padding {
    padding-left: 0;
}

/* Add a subtle dropshadow to the alerts, to separate them from the background, similar to the cards on the page */
.pf-c-page__main-section:not(.ct-overview-header),
.pf-l-gallery {
  > .pf-c-alert {
    box-shadow: var(--pf-global--BoxShadow--sm);

    // Default PF4 blue and background grey are too close in shade
    // So: Lighten up the blue to provide a touch more contrast
    // (Based on default's light green, but in a blue shade)
    &.pf-m-info {
      --pf-c-alert--BackgroundColor: #f1f8fe;
    }
  }
}

#motd-box > .pf-c-alert {
  /* Spacing between the MOTD is handled by the .pf-l-gallery grid */
  margin-bottom: 0;
}

.pf-c-alert.no-title h4 {
    font-weight: normal;
    color: black;
    font-family: inherit;
}

.pf-c-alert.no-title .pf-c-alert__description {
    padding-bottom: 0px;
}

.pf-c-alert .pf-c-alert__description a {
    padding-left: 15px;
}