Debian Codegraph @

node/@patternfly/patternfly/components/Masthead/masthead.scss

raw
1 @use '../../sass-utilities' as *;
2
3 $pf-v6-c-masthead--breakpoint-map: build-breakpoint-map();
4 $pf-v6-c-masthead--inset-map: build-spacer-map("none", "sm", "md", "lg", "xl", "2xl");
5
6 @include pf-root($masthead) {
7 // * Masthead
8 --#{$masthead}--RowGap: var(--pf-t--global--spacer--sm);
9 --#{$masthead}--ColumnGap: var(--pf-t--global--spacer--gutter--default);
10 --#{$masthead}--BorderWidth: var(--pf-t--global--border--width--divider--default);
11 --#{$masthead}--PaddingBlock: var(--pf-t--global--spacer--md);
12 --#{$masthead}--PaddingInline: var(--pf-t--global--spacer--inset--page-chrome);
13 --#{$masthead}--BorderColor: var(--pf-t--global--border--color--default);
14 --#{$masthead}--BackgroundColor: var(--pf-t--global--background--color--secondary--default);
15
16 // * Masthead main container holds the toggle and brand
17 --#{$masthead}__main--ColumnGap: var(--pf-t--global--spacer--md);
18 --#{$masthead}__main--MarginInlineEnd: var(--pf-t--global--spacer--inset--page-chrome);
19 --#{$masthead}--m-docked__main--RowGap: var(--pf-t--global--spacer--gap--group--vertical);
20
21 // * Masthead brand
22 --#{$masthead}__logo--MaxHeight: #{pf-size-prem(38px)};
23 --#{$masthead}__logo--Width: #{pf-size-prem(189px)}; // width of sidebar - toggle - inline padding - gutter = 189
24
25 // * Masthead toggle
26 --#{$masthead}__toggle--Size: var(--pf-t--global--icon--size--xl);
27
28 // * Masthead content
29 --#{$masthead}__content--ColumnGap: var(--pf-t--global--spacer--md);
30
31 // * Masthead stack
32 --#{$masthead}--m-display-stack--ColumnGap: var(--pf-t--global--spacer--gutter--default);
33 --#{$masthead}--m-display-stack--GridTemplateColumns: max-content 1fr;
34 --#{$masthead}--m-display-stack__brand--GridColumn: -1 / 1;
35 --#{$masthead}--m-display-stack__brand--Order: -1;
36 --#{$masthead}--m-display-stack__brand--PaddingBlockEnd: var(--#{$masthead}--RowGap);
37 --#{$masthead}--m-display-stack__brand--BorderBlockEnd: var(--#{$masthead}--BorderWidth) solid var(--#{$masthead}--BorderColor);
38 --#{$masthead}--m-display-stack__content--GridColumn: 1;
39 --#{$masthead}--m-display-stack__content--Order: 1;
40 --#{$masthead}--m-display-stack__main--toggle--content--GridColumn: 2;
41 --#{$masthead}--m-display-stack__main--Display: contents;
42 --#{$masthead}--m-display-stack__main--ColumnGap: unset; // no column gap needed until it's flex display
43
44 // * Masthead inline
45 --#{$masthead}--m-display-inline--ColumnGap: 0;
46 --#{$masthead}--m-display-inline--GridTemplateColumns: min-content 1fr;
47 --#{$masthead}--m-display-inline--breakpoint--xl--GridTemplateColumns: subgrid;
48 --#{$masthead}--m-display-inline__brand--GridColumn: initial;
49 --#{$masthead}--m-display-inline__brand--Order: initial;
50 --#{$masthead}--m-display-inline__brand--PaddingBlockEnd: 0;
51 --#{$masthead}--m-display-inline__brand--BorderBlockEnd: 0;
52 --#{$masthead}--m-display-inline__main--GridColumn: 1;
53 --#{$masthead}--m-display-inline__content--GridColumn: 2;
54 --#{$masthead}--m-display-inline__content--Order: 0;
55 --#{$masthead}--m-display-inline__main--toggle--content--GridColumn: 2;
56 --#{$masthead}--m-display-inline__main--Display: flex;
57 --#{$masthead}--m-display-inline__main--ColumnGap: var(--pf-t--global--spacer--md);
58
59 // Masthead docked
60 --#{$masthead}--m-docked--GridTemplateRows: min-content 1fr;
61 --#{$masthead}--m-docked--RowGap: var(--pf-t--global--spacer--gutter--default);
62 --#{$masthead}--m-docked--PaddingBlockStart: var(--pf-t--global--spacer--lg);
63 --#{$masthead}--m-docked--PaddingBlockEnd: var(--pf-t--global--spacer--lg);
64 --#{$masthead}--m-docked--PaddingInlineStart: var(--pf-t--global--spacer--sm);
65 --#{$masthead}--m-docked--PaddingInlineEnd: var(--pf-t--global--spacer--sm);
66 --#{$masthead}--m-docked--BackgroundColor: var(--pf-t--global--background--color--glass--primary--default, var(--pf-t--global--background--color--primary--default));
67 --#{$masthead}--m-docked--BackdropFilter: var(--pf-t--global--background--filter--glass--blur--primary);
68 --#{$masthead}--m-docked--c-toolbar--Height: 100%;
69
70 // * Masthead toolbar
71 --#{$masthead}__expandable-content--BoxShadow: var(--pf-t--global--box-shadow--md--bottom);
72 --#{$masthead}__expandable-content--BorderBlockStart: var(--#{$masthead}--BorderWidth) solid var(--#{$masthead}--BorderColor);
73
74 // * Masthead toolbar
75 --#{$masthead}--c-toolbar--Width: 100%;
76 --#{$masthead}--c-toolbar--PaddingBlock: 0;
77 }
78
79 // * Masthead display stack
80 @mixin pf-v6-c-masthead--m-display-stack {
81 --#{$masthead}--ColumnGap: var(--#{$masthead}--m-display-stack--ColumnGap);
82 --#{$masthead}--GridTemplateColumns: var(--#{$masthead}--m-display-stack--GridTemplateColumns);
83 --#{$masthead}__brand--GridColumn: var(--#{$masthead}--m-display-stack__brand--GridColumn);
84 --#{$masthead}__brand--Order: var(--#{$masthead}--m-display-stack__brand--Order);
85 --#{$masthead}__brand--PaddingBlockEnd: var(--#{$masthead}--m-display-stack__brand--PaddingBlockEnd);
86 --#{$masthead}__brand--BorderBlockEnd: var(--#{$masthead}--m-display-stack__brand--BorderBlockEnd);
87 --#{$masthead}__main--GridColumn: unset;
88 --#{$masthead}__content--GridColumn: var(--#{$masthead}--m-display-stack__content--GridColumn);
89 --#{$masthead}__content--Order: var(--#{$masthead}--m-display-stack__content--Order);
90 --#{$masthead}__main--toggle--content--GridColumn: var(--#{$masthead}--m-display-stack__main--toggle--content--GridColumn);
91 --#{$masthead}__main--Display: var(--#{$masthead}--m-display-stack__main--Display);
92 --#{$masthead}__main--ColumnGap: var(--#{$masthead}--m-display-stack__main--ColumnGap);
93 }
94
95 // * Masthead display inline
96 @mixin pf-v6-c-masthead--m-display-inline {
97 --#{$masthead}--ColumnGap: var(--#{$masthead}--m-display-inline--ColumnGap);
98 --#{$masthead}--GridTemplateColumns: var(--#{$masthead}--m-display-inline--GridTemplateColumns);
99 --#{$masthead}__brand--GridColumn: var(--#{$masthead}--m-display-inline__brand--GridColumn);
100 --#{$masthead}__brand--Order: var(--#{$masthead}--m-display-inline__brand--Order);
101 --#{$masthead}__brand--PaddingBlockEnd: var(--#{$masthead}--m-display-inline__brand--PaddingBlockEnd);
102 --#{$masthead}__brand--BorderBlockEnd: var(--#{$masthead}--m-display-inline__brand--BorderBlockEnd);
103 --#{$masthead}__main--GridColumn: var(--#{$masthead}--m-display-inline__main--GridColumn);
104 --#{$masthead}__content--GridColumn: var(--#{$masthead}--m-display-inline__content--GridColumn);
105 --#{$masthead}__content--Order: var(--#{$masthead}--m-display-inline__content--Order);
106 --#{$masthead}__main--toggle--content--GridColumn: var(--#{$masthead}--m-display-inline__main--toggle--content--GridColumn);
107 --#{$masthead}__main--Display: var(--#{$masthead}--m-display-inline__main--Display);
108 --#{$masthead}__main--ColumnGap: var(--#{$masthead}--m-display-inline__main--ColumnGap);
109 }
110
111 // - Masthead
112 .#{$masthead} {
113 .#{$toolbar} {
114 --#{$toolbar}--Width: var(--#{$masthead}--c-toolbar--Width);
115 --#{$toolbar}--PaddingBlockEnd: 0;
116 --#{$toolbar}__content--MinWidth: 0;
117 }
118
119 // Set layout to stack by default
120 @include pf-v6-c-masthead--m-display-stack;
121
122 // Set layout to inline at medium breakpoint
123 :where(:not(.pf-m-resize-observer)) & {
124 @media screen and (min-width: $pf-v6-global--breakpoint--md) {
125 @include pf-v6-c-masthead--m-display-inline;
126 }
127 }
128
129 // - Masthead
130 display: grid;
131 grid-template-rows: var(--#{$masthead}--GridTemplateRows);
132 grid-template-columns: var(--#{$masthead}--GridTemplateColumns);
133 row-gap: var(--#{$masthead}--RowGap);
134 column-gap: var(--#{$masthead}--ColumnGap);
135 align-items: start;
136 min-width: 0;
137
138 // set the fallback of any customizable, nested variable to its default value
139 padding-block-start: var(--#{$masthead}--PaddingBlockStart, var(--#{$masthead}--PaddingBlock));
140 padding-block-end: var(--#{$masthead}--PaddingBlockEnd, var(--#{$masthead}--PaddingBlock));
141 padding-inline-start: var(--#{$masthead}--PaddingInlineStart, var(--#{$masthead}--PaddingInline));
142 padding-inline-end: var(--#{$masthead}--PaddingInlineEnd, var(--#{$masthead}--PaddingInline));
143 background-color: var(--#{$masthead}--BackgroundColor);
144
145 &.pf-m-docked {
146 @include pf-v6-c-masthead--m-display-inline;
147
148 --#{$masthead}--BackgroundColor: transparent;
149 --#{$masthead}--GridTemplateRows: var(--#{$masthead}--m-docked--GridTemplateRows);
150 --#{$masthead}--PaddingBlockStart: var(--#{$masthead}--m-docked--PaddingBlockStart);
151 --#{$masthead}--PaddingBlockEnd: var(--#{$masthead}--m-docked--PaddingBlockEnd);
152 --#{$masthead}--PaddingInlineStart: var(--#{$masthead}--m-docked--PaddingInlineStart);
153 --#{$masthead}--PaddingInlineEnd: var(--#{$masthead}--m-docked--PaddingInlineEnd);
154 --#{$masthead}--GridTemplateColumns: auto;
155 --#{$masthead}--RowGap: var(--#{$masthead}--m-docked--RowGap);
156 --#{$masthead}--m-display-inline--breakpoint--xl--GridTemplateColumns: auto;
157 --#{$masthead}__main--GridColumn: auto;
158 --#{$masthead}__content--GridColumn: auto;
159 --#{$masthead}__main--MarginInlineEnd: 0;
160
161 display: flex;
162 flex-direction: column;
163 align-items: stretch;
164 height: 100%;
165 border: 0;
166 box-shadow: none;
167
168 .#{$masthead}__logo {
169 width: revert;
170
171 &.pf-m-compact {
172 display: none;
173 max-width: #{pf-size-prem(37px)};
174 max-height: revert;
175 }
176 }
177
178 .#{$masthead}__main {
179 flex-direction: column;
180 row-gap: var(--#{$masthead}--m-docked__main--RowGap);
181 align-items: flex-start;
182 }
183
184 .#{$masthead}__content {
185 flex-grow: 1;
186 flex-direction: column;
187 align-items: stretch;
188 align-self: revert;
189 }
190
191 .#{$toolbar} {
192 --pf-v6-c-toolbar--m-vertical--Width: auto;
193
194 height: var(--#{$masthead}--m-docked--c-toolbar--Height);
195 }
196
197 @media (min-width: $pf-v6-global--breakpoint--dock--desktop) {
198 .#{$masthead}__main {
199 align-items: center;
200 }
201
202 .#{$masthead}__logo {
203 display: none;
204
205 // stylelint-disable max-nesting-depth
206 &.pf-m-compact {
207 display: revert;
208 }
209 // stylelint-enable
210 }
211 }
212
213 @at-root :is(.#{$page}__dock, .#{$compass}__dock).pf-m-text-expanded & {
214 .#{$masthead}__logo {
215 display: revert;
216
217 // stylelint-disable max-nesting-depth
218 &.pf-m-compact {
219 display: none;
220 }
221 // stylelint-enable
222 }
223
224 .#{$masthead}__main {
225 align-items: flex-start;
226 }
227 }
228 }
229
230 .#{$toolbar}__content-section {
231 flex-wrap: nowrap;
232 min-width: 0;
233 }
234
235 // - Masthead toolbar expandable content
236 .#{$toolbar}__expandable-content {
237 inset-block-start: 100%;
238 border-block-start: var(--#{$masthead}__expandable-content--BorderBlockStart);
239 box-shadow: var(--#{$masthead}__expandable-content--BoxShadow);
240 }
241
242 // - Masthead display stack
243 &.pf-m-display-stack {
244 @include pf-v6-c-masthead--m-display-stack;
245 }
246
247 // - Masthead display inline
248 &.pf-m-display-inline {
249 @include pf-v6-c-masthead--m-display-inline;
250 }
251
252 // - Masthead insets
253 @each $inset, $inset-value in $pf-v6-c-masthead--inset-map {
254 &.pf-m-inset-#{$inset} {
255 padding-inline-start: #{$inset-value};
256 padding-inline-end: #{$inset-value};
257 }
258 }
259
260 // placeholder for banded
261 @at-root :where(.pf-v6-theme-glass) &:not(.pf-m-docked) {
262 background-color: var(--pf-t--global--background--color--glass--primary--default);
263 border-block-end: var(--pf-t--global--border--width--glass--default) solid var(--pf-t--global--border--color--glass--default);
264 box-shadow: var(--pf-t--global--box-shadow--glass--default);
265 backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
266 }
267 }
268
269 .#{$masthead}__main {
270 display: var(--#{$masthead}__main--Display);
271 grid-column: var(--#{$masthead}__main--GridColumn);
272 column-gap: var(--#{$masthead}__main--ColumnGap);
273 align-items: center;
274 margin-inline-end: var(--#{$masthead}__main--MarginInlineEnd);
275
276 &:has(.#{$masthead}__toggle) ~ .#{$masthead}__content {
277 --#{$masthead}__content--GridColumn: var(--#{$masthead}__main--toggle--content--GridColumn);
278 }
279 }
280
281 // - Masthead main masthead content masthead logo
282 .#{$masthead},
283 .#{$masthead}__brand {
284 position: relative;
285 }
286
287 // - Masthead brand
288 .#{$masthead}__brand {
289 display: flex;
290 flex-shrink: 0;
291 grid-column: var(--#{$masthead}__brand--GridColumn, revert);
292 row-gap: var(--#{$masthead}__brand--RowGap, var(--#{$masthead}--RowGap));
293 align-self: stretch;
294 order: var(--#{$masthead}__brand--Order, revert);
295 min-width: #{pf-size-prem(4ch)}; // allow flex containers to shrink to fit possible overflow
296 padding-block-end: var(--#{$masthead}__brand--PaddingBlockEnd);
297 border-block-end: var(--#{$masthead}__brand--BorderBlockEnd);
298 }
299
300 // - Masthead content
301 .#{$masthead}__content {
302 display: flex;
303 flex-wrap: wrap;
304 grid-column: var(--#{$masthead}__content--GridColumn);
305 grid-column-end: -1; // force content to right edge or full available width
306 row-gap: var(--#{$masthead}__content-RowGap, var(--#{$masthead}--RowGap));
307 column-gap: var(--#{$masthead}__content--ColumnGap, var(--#{$masthead}--ColumnGap));
308 align-self: center;
309 order: var(--#{$masthead}__content--Order);
310 min-width: #{pf-size-prem(4ch)}; // allow flex containers to shrink to fit possible overflow
311 }
312
313 // - Masthead logo
314 .#{$masthead}__logo {
315 position: relative;
316 width: var(--#{$masthead}__logo--Width);
317 max-height: var(--#{$masthead}__logo--MaxHeight);
318
319 > * {
320 max-width: 100%;
321 max-height: 100%;
322 vertical-align: middle;
323 }
324 }
325
326 // - Masthead toggle
327 .#{$masthead}__toggle {
328 --#{$button}--FontSize: var(--#{$masthead}__toggle--Size);
329 }
330
331 // - Masthead expandable content
332 .#{$masthead}__expandable-content {
333 row-gap: var(--#{$masthead}__expandable-content-RowGap, var(--#{$masthead}--RowGap));
334 background-color: var(--#{$masthead}--BackgroundColor);
335 }
336
337 // TODO: move this sass to separate file for resize observer updates
338 // TODO: make this an opt in/out
339 // stylelint-disable no-duplicate-selectors
340 .#{$masthead} {
341 @each $breakpoint, $breakpoint-value in $pf-v6-c-masthead--breakpoint-map {
342 $breakpoint-name: "";
343
344 @if $breakpoint != "base" {
345 $breakpoint-name: -on-#{$breakpoint};
346 }
347
348 @include pf-v6-apply-breakpoint($breakpoint) {
349 &.pf-m-display-stack#{$breakpoint-name} {
350 @include pf-v6-c-masthead--m-display-stack;
351 }
352
353 &.pf-m-display-inline#{$breakpoint-name} {
354 @include pf-v6-c-masthead--m-display-inline;
355 }
356 }
357
358 @each $inset, $inset-value in $pf-v6-c-masthead--inset-map {
359 &.pf-m-inset-#{$inset} {
360 padding-inline-start: #{$inset-value};
361 padding-inline-end: #{$inset-value};
362 }
363 }
364 }
365 }