forked from cockpit-project/cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
overview.scss
278 lines (229 loc) · 7.07 KB
/
overview.scss
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
@use "./system-global.scss";
/* System Time Modal dialog needs table.css */
@use "../lib/table.css";
@import "global-variables";
@import "@patternfly/patternfly/components/Table/table.scss";
.ct-limited-access-alert {
--pf-v5-c-alert--GridTemplateColumns: auto auto 1fr;
// Fix vertical alignment
// Unset the H4 line-height (as PF3/Bootstrap/etc. sets it; PF4 doesn't)
> .pf-v5-c-alert__title {
line-height: unset;
}
// 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-v5-global--breakpoint--lg) {
grid-template-areas: "icon title" ". content" ". action";
grid-gap: var(--pf-v5-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";
}
// Set the right padding so that the button aligns with the other alerts in the page on the side
padding-inline-end: var(--pf-v5-c-page__main-section--PaddingRight);
> .pf-v5-c-alert__action {
margin-inline: var(--pf-v5-global--spacer--md) 0;
}
// Align left content with the rest of the page
@media (min-width: $pf-v5-global--breakpoint--xl) {
padding-inline-start: var(--pf-v5-global--spacer--lg);
}
}
.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-v5-global--FontSize--2xl) !important;
}
}
&-hostname > h1,
&-subheading {
padding-inline-end: 1rem;
}
&-actions {
align-items: center;
}
&-subheading {
font-size: var(--pf-v5-global--FontSize--md);
}
}
.pf-v5-l-gallery.ct-system-overview {
--cards: 2;
--pf-v5-l-gallery--GridTemplateColumns: repeat(var(--cards), 1fr);
// Small mobile: Reduce spacing
@media (max-width: 320px) {
// --pf-v5-l-gallery--m-gutter--GridGap: 0.25rem;
}
// Mobile: reduce to 1 card wide and minimize spacing
@media (max-width: 680px) {
--pf-v5-l-gallery--m-gutter--GridGap: var(--pf-v5-global--spacer--sm);
--cards: 1;
}
// Large desktop: Jump up to 4 cards wide
@media (min-width: 1400px) {
--cards: 4;
}
// Extra large desktop: Let cards align to the left at an optimal size
@media (min-width: 110rem) {
--pf-v5-l-gallery--GridTemplateColumns: repeat(auto-fill, minmax(min-content, 26rem));
}
// VMs @ 1024x768; add a little leeway For titlebars, start bar, etc.
@media (orientation: landscape) and (min-width: 684px) and (max-width: 832px) and (max-height: 703px) {
--pf-v5-l-gallery--m-gutter--GridGap: var(--pf-v5-global--spacer--sm);
// Also skim off some vertical space for the cards
.pf-v5-c-card {
--pf-v5-c-card--first-child--PaddingTop: var(--pf-v5-global--spacer--md);
--pf-v5-c-card--child--PaddingRight: var(--pf-v5-global--spacer--md);
}
}
.motd-box {
grid-column: 1 / -1;
}
.pf-v5-c-card {
&__title-text {
font-size: var(--pf-v5-global--FontSize--xl);
font-weight: var(--pf-v5-global--FontWeight--normal);
}
&__body {
&:last-child .pf-v5-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-block-end: none;
}
p {
+ p,
+ button {
margin-block-start: calc(var(--pf-v5-global--LineHeight--md) * 1rem);
}
}
td {
vertical-align: middle;
}
th {
font-size: var(--pf-v5-global--FontSize--sm);
}
}
}
.pf-v5-c-progress {
&__status {
display: flex;
align-items: baseline;
&-icon {
display: flex;
align-self: center;
}
}
}
.pf-m-compact {
th, td {
&:first-child {
:not([dir="rtl"]) & {
padding-inline-start: 0;
}
[dir="rtl"] & {
padding-inline-end: 0;
}
}
&:last-child {
:not([dir="rtl"]) & {
padding-inline-end: 0;
}
[dir="rtl"] & {
padding-inline-start: 0;
}
}
}
}
}
@media (max-width: 779px) {
/* Reduce gutter & padding on smaller widths, for desktop & mobile */
.pf-v5-l-gallery.ct-system-overview {
--pf-v5-l-gallery--m-gutter--GridGap: calc(var(--pf-v5-global--gutter--md)/2);
}
.pf-v5-c-card {
--pf-v5-c-card--first-child--PaddingTop: var(--pf-v5-global--spacer--md);
--pf-v5-c-card--child--PaddingRight: var(--pf-v5-global--spacer--md);
--pf-v5-c-card--child--PaddingBottom: var(--pf-v5-global--spacer--md);
--pf-v5-c-card--child--PaddingLeft: var(--pf-v5-global--spacer--md);
--pf-v5-c-card__title--not-last-child--PaddingBottom: var(--pf-v5-global--spacer--sm);
}
}
@media (min-width: 780px) {
/* Embiggen subheading & card headings when there's space */
.pf-v5-l-gallery.ct-system-overview .pf-v5-c-card__title-text {
font-size: var(--pf-v5-global--FontSize--2xl);
}
.ct-overview-header-subheading {
font-size: var(--pf-v5-global--FontSize--lg);
}
}
.pf-v5-c-table tr > * {
vertical-align: top;
}
.ct-inline-list .pf-v5-c-list.pf-m-inline {
display: inline-flex;
margin-inline-start: 1rem;
}
/* Add a subtle dropshadow to the alerts, to separate them from the background, similar to the cards on the page */
.pf-v5-c-page__main-section:not(.ct-overview-header),
.pf-v5-l-gallery {
> .pf-v5-c-alert {
box-shadow: var(--pf-v5-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-v5-c-alert--BackgroundColor: #f1f8fe;
}
}
}
#motd-box > .pf-v5-c-alert {
/* Spacing between the MOTD is handled by the .pf-v5-l-gallery grid */
margin-block-end: 0;
}
.pf-v5-c-alert .pf-v5-c-alert__description a {
padding-inline-start: 15px;
}
// Stretch modal content to fill body
// This redirects scrolling from the modal body to the select widget
.ct-m-stretch-body {
// Use flex to let children fully expand to the content
.pf-v5-c-modal-box__body {
&, > :only-child {
// Let children fully stretch to content
display: flex;
}
> :only-child,
.pf-v5-c-menu__content {
// Get squishy with children and the menu content
flex: auto;
}
.pf-v5-c-menu__content {
// Relax the height constraint
--pf-v5-c-menu__content--MaxHeight: 100%;
}
}
}