Skip to content

Commit e487b21

Browse files
nmergetmfranzke
authored andcommitted
refactor: header styles to align with current design (#899)
1 parent 06f4bff commit e487b21

File tree

16 files changed

+347
-172
lines changed

16 files changed

+347
-172
lines changed

source/_data/enterprise/mainnavigation.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,36 @@
2525
"href": "#",
2626
"value": "Sub 01 Sub 03",
2727
"rel": "news"
28+
},
29+
{
30+
"href": "#",
31+
"value": "Sub 01 Sub 04",
32+
"rel": "index"
33+
},
34+
{
35+
"href": "#",
36+
"value": "Sub 01 Sub 05",
37+
"rel": "offers"
38+
},
39+
{
40+
"href": "#",
41+
"value": "Sub 01 Sub 06",
42+
"rel": "news"
43+
},
44+
{
45+
"href": "#",
46+
"value": "Sub 01 Sub 07",
47+
"rel": "index"
48+
},
49+
{
50+
"href": "#",
51+
"value": "Sub 01 Sub 08",
52+
"rel": "offers"
53+
},
54+
{
55+
"href": "#",
56+
"value": "Sub 01 Sub 09",
57+
"rel": "news"
2858
}
2959
]
3060
},
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
@import "image.variables";
22

33
.elm-image {
4-
&.is-logo {
5-
height: auto;
6-
margin: 0.2rem #{to-rem($pxValue: 16)} 0.2rem 0;
7-
max-width: $image-logo--maxwidth;
8-
9-
.cmp-brand & {
10-
width: $brand-image--width; // * TODO: possibly rework variable naming
11-
}
12-
}
4+
// We removed logo styles here
135
}
Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
@import "brand.variables";
22

33
.cmp-brand {
4-
.elm-image {
5-
&.is-logo {
6-
float: left;
7-
margin-top: -#{to-rem($pxValue: 2)};
8-
}
4+
font-weight: bold;
5+
display: flex;
6+
align-items: center;
7+
gap: 1rem;
8+
9+
a,
10+
img {
11+
height: 1.5rem;
12+
}
13+
14+
img {
15+
width: auto;
916
}
1017

1118
a {
1219
color: inherit;
1320
// Deactivate underline on site name being made clickable by added to the link as well
1421
text-decoration: none;
1522
}
16-
17-
.rea-header & {
18-
padding-top: to-rem($pxValue: 18);
19-
@media screen and (width > $db-break-the-header-max-width) {
20-
padding-top: $rea-header-cmp-brand-padding-top; // * TODO: possibly rework variable naming
21-
22-
.is-site-name {
23-
&::before {
24-
// * TODO: introduce is-icon as a mixin and change the following declarations afterwards
25-
content: none !important;
26-
}
27-
}
28-
}
29-
}
30-
@media screen and (max-width: $db-break-the-header-max-width) {
31-
.cmp-mainnavigation ~ & {
32-
.rea-header & {
33-
.is-site-name {
34-
display: none;
35-
}
36-
}
37-
}
38-
}
3923
}

source/_patterns/02-components/dropdown/dropdown.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
summary {
1111
@include icon(glyph(account), 24, "outline", $partial: $partial);
1212

13-
&:hover {
14-
&::before {
15-
color: $db-color-red-500;
16-
}
17-
}
18-
1913
@media screen and (max-width: $metanavigation-iconOnly--maxWidth) {
2014
// * TODO: possibly rework variable naming
2115
@include is-icon-text-replace();
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
@import "../../../css/helpers/functions";
22
@import "../../00-base/icons/icons.helpers";
33
@import "../../00-base/icons/icons.variables";
4+
5+
$db-language-switcher---direction: var(--db-language-switcher---direction, 1);

source/_patterns/02-components/language-switcher/language-switcher.scss

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
@import "../../../css/partials.meta";
22
@import "language-switcher.variables";
33

4+
@mixin set-top($step: 1) {
5+
top: calc(
6+
#{$db-language-switcher---direction} * (100% * #{$step} + 1rem - 2px)
7+
);
8+
}
9+
410
.cmp-language-switcher {
511
list-style: none;
612

@@ -29,41 +35,41 @@
2935
top: to-rem($pxValue: 26);
3036

3137
.rea-header & {
32-
top: to-rem($pxValue: 55);
38+
@include set-top(1);
3339

3440
z-index: $z-index-rea-header-cmp-language-switcher-li; // * TODO: possibly rework variable naming
3541

3642
// TODO: This is an enhancement for more languages, but obviously doesn't scale that nicely and would need some rework
3743
&:not([aria-current="page"], [aria-selected="true"])
3844
~ li:not([aria-current="page"], [aria-selected="true"]) {
39-
top: to-rem($pxValue: 54 * 2);
45+
@include set-top(2);
4046

4147
& ~ li:not([aria-current="page"], [aria-selected="true"]) {
42-
top: to-rem($pxValue: 54 * 3);
48+
@include set-top(3);
4349

4450
& ~ li:not([aria-current="page"], [aria-selected="true"]) {
45-
top: to-rem($pxValue: 54 * 4);
51+
@include set-top(4);
4652

4753
&
4854
~ li:not(
4955
[aria-current="page"],
5056
[aria-selected="true"]
5157
) {
52-
top: to-rem($pxValue: 54 * 5);
58+
@include set-top(5);
5359

5460
&
5561
~ li:not(
5662
[aria-current="page"],
5763
[aria-selected="true"]
5864
) {
59-
top: to-rem($pxValue: 54 * 6);
65+
@include set-top(6);
6066
}
6167
}
6268
}
6369
}
6470
}
6571
@media screen and (width > $db-break-the-header-max-width) {
66-
top: to-rem($pxValue: 56);
72+
top: 100%;
6773
}
6874
}
6975

@@ -78,9 +84,8 @@
7884

7985
.elm-link,
8086
.elm-button {
81-
padding-bottom: to-rem($pxValue: 15);
87+
padding-block: 1rem;
8288
padding-right: to-rem($pxValue: 34);
83-
padding-top: to-rem($pxValue: 15);
8489

8590
&:hover,
8691
&:focus {
@@ -95,8 +100,6 @@
95100

96101
.elm-link,
97102
.elm-button {
98-
padding-bottom: to-rem($pxValue: 22);
99-
100103
& {
101104
@include icon(
102105
glyph(expand-more),

0 commit comments

Comments
 (0)