UNPKG

5.73 kBtext/lessView Raw
1@import (reference) './imports/global';
2@import (reference) './imports/aui-theme/core/layers';
3
4aui-header,
5.aui-header,
6.aui-header-inner,
7.aui-header-before,
8.aui-header-primary,
9.aui-header-secondary {
10 align-items: center;
11 display: flex;
12 justify-content: flex-start;
13}
14
15.aui-header-secondary {
16 justify-content: flex-end;
17}
18
19.aui-nav-images() {
20 img, svg {
21 max-height: calc(var(--aui-appheader-logo-height, var(--aui-appheader-item-height, 100%)) - 10px);
22 display: inline-block;
23 vertical-align: text-bottom;
24 }
25}
26
27// Structural styles
28.aui-header {
29 --aui-badge-text-color: var(--aui-appheader-text-color);
30 --aui-badge-bg-color: var(--aui-appheader-item-focus-bg-color);
31 --aui-appheader-height: auto;
32 --aui-appheader-item-height: 40px;
33 --aui-appheader-item-border-radius: 0px;
34 @section-gap: 20px;
35
36 box-sizing: border-box;
37 padding: 0 @aui-grid;
38 position: relative;
39
40 .aui-header-before {
41 flex-grow: 0;
42 margin-right: @section-gap;
43 }
44
45 // Container for the product's name
46 .aui-header-logo, .aui-header-logo a {
47 display: flex;
48 align-items: center;
49 justify-items: flex-start;
50 }
51
52 .aui-header-logo {
53 margin: 0 @section-gap 0 0;
54 padding: 0;
55 height: var(--aui-appheader-logo-height, var(--aui-appheader-item-height));
56 line-height: 1;
57 text-wrap: none;
58 vertical-align: text-bottom;
59 white-space: nowrap;
60
61 // Set styles for img/svg inside the header logo
62 .aui-nav-images();
63
64 // Variant where logo is a CSS background-image
65 .aui-header-logo-device {
66 background-repeat: no-repeat;
67 background-position: 0 50%;
68 background-size: contain;
69 box-sizing: content-box;
70 display: inline-block;
71 text-indent: -9999px;
72 text-align: left;
73
74 + .aui-header-logo-text {
75 margin-left: .5em;
76 }
77 }
78 &.aui-header-logo-textonly .aui-header-logo-device {
79 text-indent: 0;
80 }
81 }
82
83 // Navigational items
84 .aui-header-primary,
85 .aui-header-secondary {
86 > .aui-nav {
87 align-items: center;
88 display: flex;
89 justify-content: space-around;
90 }
91
92 > .aui-nav > li {
93 > a,
94 > button {
95 white-space: nowrap;
96 display: inline-block;
97
98 // Set styles for avatar images inside nav items
99 > .aui-avatar {
100 .aui-nav-images();
101 }
102 }
103 }
104 }
105
106 // Aesthetic styles.
107 & {
108 // IMPORTANT! Don't set text color here, otherwise it will bleed in to layered elements
109 // like modals and dropdowns, which would cause them to render funnily.
110 background: var(--aui-appheader-bg-color);
111 height: var(--aui-appheader-height, initial);
112
113 // Set color in locations where it will not bleed in to nested layered components.
114 .aui-header-before > :not(.aui-layer),
115 .aui-header-logo {
116 color: var(--aui-appheader-text-color, var(--aui-body-text));
117 }
118
119 // Target the links in the app header.
120 // We need to use the direct child combinator to avoid applying styles to
121 // dropdowns or other layers nested in the header.
122 // We also avoid styling buttons, which might be placed inside nav lists for some reason.
123 .aui-header-primary > .aui-nav > li > a:not(.aui-button),
124 .aui-header-secondary > .aui-nav > li > a:not(.aui-button),
125 .aui-header-logo > a {
126
127 & {
128 display: flex;
129 align-items: center;
130 border-radius: var(--aui-appheader-item-border-radius);
131 box-sizing: border-box;
132 height: var(--aui-appheader-item-height, auto);
133 padding: var(--aui-appheader-item-padding-y, 5px) var(--aui-appheader-item-padding-x, 10px);
134 background-color: var(--aui-appheader-item-bg-color, transparent);
135 color: var(--aui-appheader-text-color, var(--aui-body-text));
136 text-decoration: none;
137 }
138
139 &:hover,
140 &:focus {
141 background-color: var(--aui-appheader-item-focus-bg-color);
142 color: var(--aui-appheader-item-focus-text-color, inherit);
143 }
144
145 #aui.focus(#aui.with-focus-ring(@inset: true));
146
147 &:active,
148 &.active {
149 background-color: var(--aui-appheader-item-active-bg-color);
150 color: var(--aui-appheader-item-active-text-color);
151 }
152 }
153
154 // Special-case padding to separate non-nav items from nav items.
155 .aui-header-primary > .aui-nav > li > .aui-button,
156 .aui-header-primary > .aui-nav > li > .aui-buttons {
157 margin-left: @section-gap / 2;
158 }
159
160 .aui-header-secondary > .aui-nav > li > .aui-quicksearch {
161 margin-right: @section-gap / 2;
162 }
163
164 // Override the icon styles so that every icon in the header is a uniform size...
165 // ...but only in the right-hand side of the header.
166 .aui-header-secondary > .aui-nav > li > a > .aui-icon {
167 --aui-icon-size: 24px;
168 }
169
170 // Bump up the font size when text is used in place of a logo
171 .aui-header-logo {
172 font-size: @aui-font-size-xxlarge;
173 }
174
175 // Reduce the font size when a logo has supporting text
176 .aui-header-logo .aui-header-logo-text {
177 font-size: @aui-font-size-medium;
178 }
179 }
180}