UNPKG

5.88 kBSCSSView Raw
1//
2// Copyright IBM Corp. 2016, 2018
3//
4// This source code is licensed under the Apache-2.0 license found in the
5// LICENSE file in the root directory of this source tree.
6//
7
8@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
9@import '../../globals/scss/vars';
10@import '../../globals/scss/layer';
11@import '../../globals/scss/css--typography';
12@import '../../globals/scss/helper-mixins';
13@import '../../globals/scss/functions';
14
15@mixin global-header {
16 @include deprecate(
17 'The `unified-header` component in `carbon-components` has been deprecated. ' +
18 'It will be removed in the next major release.'
19 ) {
20 .#{$prefix}--global-header {
21 @include layer('sticky-nav');
22 @include font-family;
23 width: 100%;
24 position: fixed;
25 top: rem(36px);
26 left: 0;
27 display: flex;
28 justify-content: space-between;
29 height: rem(50px);
30 line-height: 1.5;
31 background-color: $nav-02;
32 z-index: 9000;
33 }
34
35 .#{$prefix}--global-header__title {
36 display: flex;
37 align-items: center;
38 }
39
40 .#{$prefix}--global-header__title--logo {
41 display: flex;
42 align-items: center;
43 padding: 0 rem(8px);
44 text-decoration: none;
45 color: $color__white; // anna
46 position: relative;
47
48 &:hover,
49 &:focus {
50 .#{$prefix}--logo__text {
51 color: $color__blue-20; // anna
52 }
53 }
54 }
55
56 .#{$prefix}--global-header__title--current-page {
57 @include font-smoothing;
58 display: flex;
59 align-items: center;
60 font-weight: 400;
61 font-size: 1.125rem;
62 line-height: inherit;
63 color: $color__blue-30; // anna
64
65 .#{$prefix}--unified-header--apps & {
66 color: $nav-05;
67 }
68
69 .#{$prefix}--unified-header--infrastructure & {
70 color: $nav-07;
71 }
72
73 .#{$prefix}--unified-header--services & {
74 color: $nav-03;
75 }
76 }
77
78 .#{$prefix}--global-header .#{$prefix}--logo__image {
79 cursor: pointer;
80 position: relative;
81 margin-right: 1.125rem;
82 }
83
84 .#{$prefix}--global-header .#{$prefix}--logo__text {
85 @include typescale('delta');
86 @include font-smoothing;
87 font-weight: 400;
88 cursor: pointer;
89 text-decoration: none;
90 color: $color__white; // anna
91
92 &--bold {
93 font-weight: 600;
94 }
95 }
96
97 .#{$prefix}--global-header__left-container {
98 display: flex;
99 align-items: center;
100 }
101
102 .#{$prefix}--global-header__right-container {
103 display: flex;
104 align-items: center;
105 padding-right: 1%;
106 background-color: $nav-02;
107 }
108
109 .#{$prefix}--global-header__menu {
110 @include reset;
111 list-style: none;
112 width: 100%;
113 display: flex;
114 justify-content: flex-end;
115 }
116
117 .#{$prefix}--global-header__menu__item {
118 @include reset;
119 width: 100%;
120 flex: 0 1 100px;
121
122 &:focus {
123 outline: 0;
124 background-color: $color__navy-gray-3; // anna
125 color: $color__blue-30; // anna
126 }
127
128 &:last-child {
129 & .#{$prefix}--dropdown-list {
130 right: 0;
131 }
132 }
133 }
134
135 .#{$prefix}--global-header__menu__item--link {
136 @include reset;
137 @include font-smoothing;
138 @include typescale('zeta');
139 font-weight: 600;
140 display: flex;
141 justify-content: center;
142 align-items: center;
143 height: rem(50px);
144 text-decoration: none;
145 background-color: $nav-02;
146 color: $color__white; // anna
147 padding: 0 1rem;
148
149 &:hover {
150 color: $color__blue-30; // anna
151 }
152
153 &:focus {
154 outline: 0;
155 background-color: $color__navy-gray-3; // anna
156 color: $color__blue-30; // anna
157 }
158 }
159
160 .#{$prefix}--global-header__menu__item .#{$prefix}--dropdown {
161 height: rem(50px);
162 background-color: transparent;
163
164 &:focus {
165 outline: 0;
166 background-color: $color__navy-gray-3; // anna
167
168 .#{$prefix}--dropdown__menu-text {
169 color: $color__blue-30; // anna
170 }
171
172 .#{$prefix}--dropdown__menu-text,
173 .#{$prefix}--dropdown__list {
174 outline: 0;
175 }
176 }
177 }
178
179 .#{$prefix}--global-header__menu .#{$prefix}--dropdown-text {
180 @include font-smoothing;
181 display: flex;
182 justify-content: center;
183 padding-top: 0;
184 padding-right: 1rem;
185 padding-bottom: 0;
186 align-items: center;
187 height: 100%;
188 z-index: 1000;
189 color: $color__white; // anna
190
191 &:hover {
192 color: $color__blue-30; // anna
193 }
194 }
195
196 .#{$prefix}--global-header__menu .#{$prefix}--dropdown-list {
197 transition: $transition--base all $carbon--standard-easing;
198 transform: translateY(-150%);
199 opacity: 0;
200 visibility: hidden;
201 display: flex;
202 flex-direction: column;
203 position: absolute;
204 top: 100%;
205 width: auto;
206 z-index: -1;
207 padding-bottom: 0.5rem;
208 }
209
210 .#{$prefix}--global-header__menu .#{$prefix}--dropdown-item {
211 min-width: 200px;
212 width: 100%;
213 }
214
215 .#{$prefix}--global-header__menu .#{$prefix}--dropdown-link {
216 padding: 0.5rem 0.75rem;
217 color: $color__white; // anna
218
219 &:hover {
220 color: $color__blue-90; // anna
221 background-color: $color__blue-30; // anna
222 }
223 }
224
225 .#{$prefix}--global-header__menu .#{$prefix}--dropdown--open {
226 .#{$prefix}--dropdown-text {
227 background-color: $color__navy-gray-3; // anna
228 color: $color__blue-30; // anna
229 }
230
231 .#{$prefix}--dropdown-list {
232 transform: translateY(0);
233 opacity: 1;
234 visibility: visible;
235 background-color: $color__navy-gray-3; // anna
236 }
237 }
238 }
239}
240
241@include exports('global-header') {
242 @if not(feature-flag-enabled('breaking-changes-x')) {
243 @include global-header;
244 }
245}