File: shell.scss

package info (click to toggle)
cockpit 358-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 317,272 kB
  • sloc: javascript: 775,788; python: 41,626; ansic: 33,970; cpp: 11,141; sh: 3,566; makefile: 581; xml: 262
file content (243 lines) | stat: -rw-r--r-- 5,689 bytes parent folder | download | duplicates (3)
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
/*
 * Copyright (C) 2013 Red Hat, Inc.
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

/* ---------------------------------------------------------------------------------------------------- */

@use "page";
@use "table";
@use "nav";
@use "@patternfly/patternfly/components/Menu/menu.css";
@use "@patternfly/patternfly/utilities/Text/text.css";
@use "@patternfly/patternfly/components/Icon/icon.css";

:root {
  --ct-color-host-accent: var(--pf-t--global--color--brand--default);
  --ct-topnav-background: var(--pf-t--global--background--color--secondary--default);
}

#shell {
    block-size: 100%;
}

/* Hacks on top for now */

html.index-page body {
  overflow: hidden;
}

#machine-change-auth > p {
  margin-block-end: 5px;
}

// Fix fingerprint layout
.add-host-fingerprint {
  margin-block-start: var(--pf-t--global--spacer--md);

  td {
    padding: 0;
    line-height: inherit;
    block-size: auto;
    vertical-align: middle !important;

    &:first-child {
      padding-inline-end: var(--pf-t--global--spacer--md);
    }
  }
}

.machine-key {
  margin: 0;
  white-space: pre-line;
  padding-block: var(--pf-t--global--spacer--xs);
  padding-inline: var(--pf-t--global--spacer--sm);
}

.login-setup-checkbox-wrapper {
  // Use a flex layout to better vertically align the contents to the grid
  display: flex;
}

#edit-machine-port {
  inline-size: 100px;
}

#connecting {
  block-size: 100%;
  background-color: var(--ct-global--palette--black-250);
  text-align: center;
  padding-block-start: 120px;
}

/* System information */

#systime-date-input,
#systime-time-hours,
#systime-time-minutes {
  display: inline;
}

/* index page */

.display-language-modal {
  /* Do not let the language menu expand to the end of the page */
  .pf-v6-c-menu__content {
    max-block-size: 20rem;
    overflow: auto;
  }
}

iframe.container-frame {
  border: none;
  inline-size: 100%;
}

// Page layout

$phone: 767px;
$desktop: $phone + 1px;

.page {
  --nav-width: 15rem;
  display: grid;
  inline-size: 100%;
  block-size: 100%;

  // Set masthead and toolbar to transparent, so the background shows through
  // (including the accent line)

  .pf-v6-c-masthead {
    --pf-v6-c-masthead--BackgroundColor: transparent;
  }

  .pf-v6-c-toolbar {
    --pf-v6-c-toolbar--BackgroundColor: transparent;
  }

  @media (max-width: $phone) {
    grid-template-areas: "main main main" "sidebar switcher header";
    grid-template-rows: 1fr 4rem;
    grid-template-columns: 1fr auto auto;
    overflow: hidden;

    .area-ct-subnav {
      grid-area: main;
    }

    .sidebar-toggle {
      grid-area: sidebar;
      display: flex;
    }

    > .header,
    > .navbar,
    > .sidebar-toggle {
      // Line on bottom, Base color (with subtle glow)
      background: linear-gradient(
        to top,
        var(--ct-color-host-accent),
        var(--ct-color-host-accent) 3px,
        transparent 3px
      );
      /* Toolbar needs visual separation between it and the content */
      border-block-start: var(--pf-t--global--border--width--regular) solid var(--pf-t--global--border--color--default);
    }

    // Remove excess padding from masthead in mobile
    .pf-v6-c-masthead {
      --pf-v6-c-masthead--inset: 0;
      --pf-v6-c-masthead--PaddingBlock: 0;
      --pf-v6-c-masthead--PaddingInline: 0;
      block-size: 100%;
    }
  }

  @media (min-width: $desktop) {
    // Shadow to the left, Line on top, Base color (with subtle glow)
    background: linear-gradient(
      to bottom,
      var(--ct-color-host-accent),
      var(--ct-color-host-accent) 3px,
      transparent 3px
    );

    grid-template-areas: "switcher switcher header" "sidebar main main";
    grid-template-rows: max-content 1fr;
    grid-template-columns: minmax(min-content, var(--nav-width)) auto 1fr;

    > .navbar {
      grid-area: switcher;
      margin-inline-end: calc(-1 * var(--pf-t--global--spacer--sm));
    }

    .sidebar {
      grid-area: sidebar;
    }

    .sidebar-toggle {
      grid-area: none;
      display: none;
    }

    .view-hosts .sidebar-hosts,
    .nav-system-menu {
      /* Top of the navbar should start when the curve of the content area ends. This means the search entry should be bumped down a bit. */
      padding-block-start: var(--pf-t--global--spacer--md);
    }
  }

  // Shrink nav for VMs @ 1024×768 (and below)
  @media (max-width: 1024px) and (max-height: 768px) and (orientation: landscape) {
    --nav-width: 14rem;
  }

  .area-ct-content {
    grid-area: main;
  }

  .header {
    grid-area: header;
  }
}

.hostkey-type {
  font-size: small;
}

.hostkey-verify-help {
  margin-block-end: 1.5em;
}

/* Alert fixups */
.modal-content .pf-v6-c-alert {
  text-align: start;
  margin-block-end: 24px;
}

.early-failure {
  block-size: 100%;
}

// Customize the about screen with the Cockpit logo
.pf-v6-c-about-modal-box {
  // Gray is best as it works in both light and dark mode
  // Ideally About modal should allow setting this through DOM instead of CSS
  // so we can color it easier.
  //
  // Or we can see about modifying it inline in scss and changing color there somehow
  --pf-v6-c-about-modal-box--BackgroundImage: url(../shell/images/cockpit-icon-gray.svg);
  --pf-v6-c-about-modal-box--BackgroundPosition: max(25rem, 143%) 10rem;
  --pf-v6-c-about-modal-box--BackgroundSize--min-width: 786px;

  .pf-v6-c-content {
    /* Don't wrap package names */
    --pf-v6-c-content--dl--GridTemplateColumns--dt: auto;
    /* Tidy up the vertical space usage between packages */
    --pf-v6-c-content--dl--RowGap: var(--pf-t--global--spacer--sm);
  }

  [dir="rtl"] {
    --pf-v6-c-about-modal-box--BackgroundPosition: calc(100% - 30rem) 10rem;
  }
}