Debian Codegraph @

pkg/lib/page.scss

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 @use "./global-variables";
3 @use "@patternfly/patternfly/base";
4 @use "./patternfly/patternfly-6-overrides.scss";
5
6 /* Globally resize headings */
7 h1 {
8 --ct-heading-font-size: var(--pf-t--global--font--size--4xl);
9 }
10
11 h2 {
12 --ct-heading-font-size: var(--pf-t--global--font--size--3xl);
13 }
14
15 h3 {
16 --ct-heading-font-size: var(--pf-t--global--font--size--2xl);
17 }
18
19 h4 {
20 --ct-heading-font-size: var(--pf-t--global--font--size--lg);
21 }
22
23 // Only apply a custom font size when a heading does NOT have a PF4 class
24 h1,
25 h2,
26 h3,
27 h4 {
28 &:not([class*="pf-"]):not([data-pf-content="true"]) {
29 font-size: var(--ct-heading-font-size);
30 }
31 }
32
33 /* End of headings resize */
34
35 a {
36 cursor: pointer;
37 }
38
39 .disabled {
40 pointer-events: auto;
41 }
42
43 .btn {
44 min-block-size: 26px;
45 min-inline-size: 26px;
46 }
47
48 .btn.disabled,
49 .pf-v6-c-button.disabled {
50 pointer-events: auto;
51 }
52
53 .btn.disabled:hover,
54 .pf-v6-c-button.disabled:hover {
55 z-index: auto;
56 }
57
58 .btn-group {
59 /* Fix button groups from wrapping in narrow widths */
60 display: inline-flex;
61 }
62
63 a.disabled {
64 cursor: not-allowed !important;
65 text-decoration: none;
66 pointer-events: none;
67 color: #8b8d8f;
68 }
69
70 a.disabled:hover {
71 text-decoration: none;
72 }
73
74 .highlight-ct {
75 background-color: var(--ct-color-link-hover-bg);
76 }
77
78 .curtains-ct {
79 inline-size: 100%;
80 }
81
82 /* Animation of new items */
83 .ct-new-item {
84 animation: ctNewRow 4s ease-in;
85 }
86
87 :root {
88 --ct-animation-new-background: #fdf4dd;
89 }
90
91 .pf-v6-theme-dark {
92 --ct-animation-new-background: #353428;
93 }
94
95 /* Animation background is instantly yellow and fades out halfway through */
96 @keyframes ctNewRow {
97 0% {
98 background-color: var(--ct-animation-new-background);
99 }
100
101 50% {
102 background-color: var(--ct-animation-new-background);
103 }
104 }
105
106 /* Dialog patterns */
107
108 .dialog-wait-ct {
109 /* Right align footer idle messages after the buttons */
110 margin-inline-start: auto;
111 display: flex;
112 column-gap: var(--pf-t--global--spacer--sm);
113 align-items: center;
114 }
115
116 :root {
117 /* Cockpit custom colors */
118 --ct-color-light-red: #f8cccc;
119 --ct-color-red-hat-red: #e00;
120
121 // Blend between --pf-v6-global--palette--black-200 and 300
122 --ct-global--palette--black-250: #e6e6e6;
123
124 /* Semantic colors */
125 --ct-color-bg: var(--pf-t--global--background--color--primary--default);
126 --ct-color-text: var(--pf-t--global--text--color--regular);
127
128 --ct-color-link: var(--pf-t--global--text--color--link--default);
129 --ct-color-link-visited: var(--pf-t--global--text--color--link--visited);
130
131 --ct-color-subtle-copy: var(--pf-t--global--text--color--subtle);
132
133 // General border color (semantic shortcut, instead of specifying the color directly)
134 --ct-color-border: var(--pf-t--global--color--brand--default);
135
136 // Used for highlighting link blocks (with a light background blue)
137 --ct-color-link-hover-bg: var(--pf-v6-global--palette--light-blue-100);
138
139 /* Colors used for custom lists */
140 // as seen in Journal, Listing, Table widgets and pages like Machines, Updates, Services
141 --ct-color-list-text: var(--ct-color-text);
142 --ct-color-list-link: var(--ct-color-link);
143 --ct-color-list-bg: var(--ct-color-bg);
144 --ct-color-list-border: var(--ct-color-border);
145 --ct-color-list-hover-text: var(--ct-color-link);
146 --ct-color-list-hover-bg: var(--pf-t--global--background--color--primary--hover);
147 --ct-color-list-hover-border: var(--pf-v6-global--BackgroundColor--150);
148 --ct-color-list-hover-icon: var(--pf-v6-global--palette--light-blue-400);
149 --ct-color-list-selected-text: var(--ct-color-link);
150 --ct-color-list-selected-bg: var(--pf-v6-global--BackgroundColor--150);
151 --ct-color-list-selected-border: var(--pf-v6-global--BackgroundColor--150);
152 --ct-color-list-active-text: var(--pf-v6-global--palette--blue-500);
153 --ct-color-list-active-bg: var(--ct-color-bg);
154 --ct-color-list-active-border: var(--ct-color-list-border);
155 --ct-color-list-critical-bg: color-mix(in oklch, var(--pf-t--global--border--color--status--danger--default) 10%, transparent);
156 --ct-color-list-critical-border: color-mix(in oklch, var(--pf-t--global--border--color--status--danger--default) 25%, transparent);
157 --ct-color-list-critical-alert-text: var(--pf-v6-global--palette--red-200);
158 }
159
160 .pf-v6-theme-dark {
161 --ct-color-list-critical-alert-text: var(--pf-v6-global--palette--red-8888);
162 }
163
164 // Let PF4 handle the scrolling through page component otherwise we might get double scrollbar
165 html:not(.index-page) body {
166 overflow-block: hidden;
167
168 // Ensure UI fills the entire page (and does not run over)
169 .ct-page-fill {
170 block-size: 100% !important;
171
172 .pf-v6-c-page__main-container {
173 block-size: 100%;
174 }
175 }
176 }
177
178 /* Makes loading new pages not flicker white but keep the natural background */
179 body {
180 background: var(--pf-t--global--background--color--secondary--default);
181 }
182
183 .ct-icon-info-circle {
184 color: var(--pf-t--global--icon--color--status--info--default);
185 }
186
187 .ct-icon-exclamation-triangle {
188 color: var(--pf-t--global--icon--color--status--warning--default);
189 }
190
191 .ct-icon-times-circle {
192 color: var(--pf-t--global--icon--color--status--danger--default);
193 }
194
195 // When we have elements within a select you can use this helper class to align on a baseline.
196 // You might have used radio or checkbox wrong if you need to use this.
197 // - Don't have inputs or selectable items within a radio/checkbox label.
198 // - Instead of aligning on a baseline, put the text in the label and everything else in a description.
199 .pf-v6-c-radio,
200 .pf-v6-c-check {
201 &__input {
202 .ct-align-center & {
203 margin-block: auto;
204 align-self: unset;
205 transform: unset;
206 }
207 }
208 }
209
210 // To be used only from testlib.py for pixel-tests
211 .pixel-test {
212 main {
213 overflow-y: clip;
214 }
215
216 // Due to rounded corners in PF6 the pixel tests on modals pick up changes
217 // behind it. To fix this we can make the backdrop (a dimmed layer behind the modal)
218 // completely opaque to prevent these issues.
219 .pf-v6-c-backdrop {
220 --pf-t--global--background--color--backdrop--default: var(--pf-t--global--background--color--secondary--default) !important;
221 }
222 }
223
224 // Set patternfly-6 native font-weight for bold elements
225 b,
226 strong {
227 font-weight: var(--pf-t--global--font--weight--body--bold);
228 }
229
230 b.ct-heading-font-weight,
231 strong.ct-heading-font-weight {
232 font-weight: var(--pf-t--global--font--weight--heading--bold);
233 }