Skip to content

Commit 7b01f6a

Browse files
committed
refactor: differentiate by theme
1 parent f4ce550 commit 7b01f6a

File tree

13 files changed

+185
-96
lines changed

13 files changed

+185
-96
lines changed

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@
2626
}
2727
}
2828
}
29-
@media screen and (width > $db-break-the-header-max-width) {
30-
@include db-cmp-brand-rea-header;
31-
}
32-
@container not style(--db-narrower-screen: true) {
33-
@include db-cmp-brand-rea-header;
29+
@if variable-exists(enterprise) {
30+
// Based on the browser strategy, we could ignore Firefox for the moment
31+
@container not style(--db-narrower-screen: true) {
32+
@include db-cmp-brand-rea-header;
33+
}
34+
} @else {
35+
@media screen and (width > $db-break-the-header-max-width) {
36+
@include db-cmp-brand-rea-header;
37+
}
3438
}
3539
}
3640
@mixin db-cmp-brand-site-name {
@@ -42,10 +46,14 @@
4246
}
4347
}
4448
}
45-
@media screen and (max-width: $db-break-the-header-max-width) {
46-
@include db-cmp-brand-site-name;
47-
}
48-
@container style(--db-narrower-screen: true) {
49-
@include db-cmp-brand-site-name;
49+
@if variable-exists(enterprise) {
50+
// Based on the browser strategy, we could ignore Firefox for the moment
51+
@container style(--db-narrower-screen: true) {
52+
@include db-cmp-brand-site-name;
53+
}
54+
} @else {
55+
@media screen and (max-width: $db-break-the-header-max-width) {
56+
@include db-cmp-brand-site-name;
57+
}
5058
}
5159
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
$enterprise: true;
2+
13
@import "brand.variables";
24
@import "../brand";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
$enterprise: true;
2+
13
@import "language-switcher.variables";
24
@import "../language-switcher";

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@
6666
top: to-rem($pxValue: 56);
6767
}
6868

69-
@media screen and (width > $db-break-the-header-max-width) {
70-
@include db-cmp-language-switcher-li-rea-header;
71-
}
72-
@container not style(--db-narrower-screen: true) {
73-
@include db-cmp-language-switcher-li-rea-header;
69+
@if variable-exists(enterprise) {
70+
// Based on the browser strategy, we could ignore Firefox for the moment
71+
@container not style(--db-narrower-screen: true) {
72+
@include db-cmp-language-switcher-li-rea-header;
73+
}
74+
} @else {
75+
@media screen and (width > $db-break-the-header-max-width) {
76+
@include db-cmp-language-switcher-li-rea-header;
77+
}
7478
}
7579
}
7680

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
$enterprise: true;
2+
13
@import "mainnavigation.variables";
24
@import "../mainnavigation";

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

Lines changed: 109 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@
3535
display: none;
3636
}
3737
}
38-
@media screen and (width > $db-break-the-header-max-width) {
39-
@include cmp-mainnavigation-checkbox;
40-
}
41-
@container not style(--db-narrower-screen: true) {
42-
@include cmp-mainnavigation-checkbox;
38+
@if variable-exists(enterprise) {
39+
// Based on the browser strategy, we could ignore Firefox for the moment
40+
@container not style(--db-narrower-screen: true) {
41+
@include cmp-mainnavigation-checkbox;
42+
}
43+
} @else {
44+
@media screen and (width > $db-break-the-header-max-width) {
45+
@include cmp-mainnavigation-checkbox;
46+
}
4347
}
4448
}
4549

@@ -88,11 +92,16 @@
8892
}
8993
}
9094
}
91-
@media screen and (max-width: $db-break-the-header-max-width) {
92-
@include db-cmp-mainnavigation;
93-
}
94-
@container style(--db-narrower-screen: true) {
95-
@include db-cmp-mainnavigation;
95+
96+
@if variable-exists(enterprise) {
97+
// Based on the browser strategy, we could ignore Firefox for the moment
98+
@container style(--db-narrower-screen: true) {
99+
@include db-cmp-mainnavigation;
100+
}
101+
} @else {
102+
@media screen and (max-width: $db-break-the-header-max-width) {
103+
@include db-cmp-mainnavigation;
104+
}
96105
}
97106

98107
ul {
@@ -108,21 +117,29 @@
108117

109118
z-index: $z-index-rea-header-cmp-mainnavigation-submenu;
110119
}
111-
@media screen and (width > $db-break-the-header-max-width) {
112-
@include db-cmp-mainnavigation-ul-ul-above;
113-
}
114-
@container not style(--db-narrower-screen: true) {
115-
@include db-cmp-mainnavigation-ul-ul-above;
120+
@if variable-exists(enterprise) {
121+
// Based on the browser strategy, we could ignore Firefox for the moment
122+
@container not style(--db-narrower-screen: true) {
123+
@include db-cmp-mainnavigation-ul-ul-above;
124+
}
125+
} @else {
126+
@media screen and (width > $db-break-the-header-max-width) {
127+
@include db-cmp-mainnavigation-ul-ul-above;
128+
}
116129
}
117130

118131
@mixin db-cmp-mainnavigation-ul-ul {
119132
display: none;
120133
}
121-
@media screen and (max-width: $db-break-the-header-max-width) {
122-
@include db-cmp-mainnavigation-ul-ul;
123-
}
124-
@container style(--db-narrower-screen: true) {
125-
@include db-cmp-mainnavigation-ul-ul;
134+
@if variable-exists(enterprise) {
135+
// Based on the browser strategy, we could ignore Firefox for the moment
136+
@container style(--db-narrower-screen: true) {
137+
@include db-cmp-mainnavigation-ul-ul;
138+
}
139+
} @else {
140+
@media screen and (max-width: $db-break-the-header-max-width) {
141+
@include db-cmp-mainnavigation-ul-ul;
142+
}
126143
}
127144
}
128145

@@ -131,11 +148,15 @@
131148
@mixin db-cmp-mainnavigation-ul-above {
132149
display: flex;
133150
}
134-
@media screen and (width > $db-break-the-header-max-width) {
135-
@include db-cmp-mainnavigation-ul-above;
136-
}
137-
@container not style(--db-narrower-screen: true) {
138-
@include db-cmp-mainnavigation-ul-above;
151+
@if variable-exists(enterprise) {
152+
// Based on the browser strategy, we could ignore Firefox for the moment
153+
@container not style(--db-narrower-screen: true) {
154+
@include db-cmp-mainnavigation-ul-above;
155+
}
156+
} @else {
157+
@media screen and (width > $db-break-the-header-max-width) {
158+
@include db-cmp-mainnavigation-ul-above;
159+
}
139160
}
140161

141162
& > li,
@@ -158,11 +179,15 @@
158179
border-#{$mainnavigation-link--borderPosition}-color: $db-color-red-500;
159180
}
160181
}
161-
@media screen and (width > $db-break-the-header-max-width) {
162-
@include db-cmp-mainnavigation-ul-li-elm-link-above;
163-
}
164-
@container not style(--db-narrower-screen: true) {
165-
@include db-cmp-mainnavigation-ul-li-elm-link-above;
182+
@if variable-exists(enterprise) {
183+
// Based on the browser strategy, we could ignore Firefox for the moment
184+
@container not style(--db-narrower-screen: true) {
185+
@include db-cmp-mainnavigation-ul-li-elm-link-above;
186+
}
187+
} @else {
188+
@media screen and (width > $db-break-the-header-max-width) {
189+
@include db-cmp-mainnavigation-ul-li-elm-link-above;
190+
}
166191
}
167192
}
168193

@@ -189,11 +214,15 @@
189214
padding-right: to-rem($pxValue: 18);
190215
}
191216
}
192-
@media screen and (width > $db-break-the-header-max-width) {
193-
@include db-cmp-mainnavigation-ul-li-ul-above;
194-
}
195-
@container not style(--db-narrower-screen: true) {
196-
@include db-cmp-mainnavigation-ul-li-ul-above;
217+
@if variable-exists(enterprise) {
218+
// Based on the browser strategy, we could ignore Firefox for the moment
219+
@container not style(--db-narrower-screen: true) {
220+
@include db-cmp-mainnavigation-ul-li-ul-above;
221+
}
222+
} @else {
223+
@media screen and (width > $db-break-the-header-max-width) {
224+
@include db-cmp-mainnavigation-ul-li-ul-above;
225+
}
197226
}
198227

199228
& > li,
@@ -203,11 +232,15 @@
203232
@mixin db-cmp-mainnavigation-ul-ul-li {
204233
padding-left: to-rem($pxValue: 34);
205234
}
206-
@media screen and (max-width: $db-break-the-header-max-width) {
207-
@include db-cmp-mainnavigation-ul-ul-li;
208-
}
209-
@container style(--db-narrower-screen: true) {
210-
@include db-cmp-mainnavigation-ul-ul-li;
235+
@if variable-exists(enterprise) {
236+
// Based on the browser strategy, we could ignore Firefox for the moment
237+
@container style(--db-narrower-screen: true) {
238+
@include db-cmp-mainnavigation-ul-ul-li;
239+
}
240+
} @else {
241+
@media screen and (max-width: $db-break-the-header-max-width) {
242+
@include db-cmp-mainnavigation-ul-ul-li;
243+
}
211244
}
212245
}
213246

@@ -220,11 +253,15 @@
220253
@mixin db-cmp-mainnavigation-ul-ul-ul-li {
221254
padding-left: to-rem($pxValue: 60);
222255
}
223-
@media screen and (max-width: $db-break-the-header-max-width) {
224-
@include db-cmp-mainnavigation-ul-ul-ul-li;
225-
}
226-
@container style(--db-narrower-screen: true) {
227-
@include db-cmp-mainnavigation-ul-ul-ul-li;
256+
@if variable-exists(enterprise) {
257+
// Based on the browser strategy, we could ignore Firefox for the moment
258+
@container style(--db-narrower-screen: true) {
259+
@include db-cmp-mainnavigation-ul-ul-ul-li;
260+
}
261+
} @else {
262+
@media screen and (max-width: $db-break-the-header-max-width) {
263+
@include db-cmp-mainnavigation-ul-ul-ul-li;
264+
}
228265
}
229266
}
230267
}
@@ -265,11 +302,15 @@
265302
@mixin db-cmp-mainnavigation-li-hover {
266303
display: initial;
267304
}
268-
@media screen and (max-width: $db-break-the-header-max-width) {
269-
@include db-cmp-mainnavigation-li-hover;
270-
}
271-
@container style(--db-narrower-screen: true) {
272-
@include db-cmp-mainnavigation-li-hover;
305+
@if variable-exists(enterprise) {
306+
// Based on the browser strategy, we could ignore Firefox for the moment
307+
@container style(--db-narrower-screen: true) {
308+
@include db-cmp-mainnavigation-li-hover;
309+
}
310+
} @else {
311+
@media screen and (max-width: $db-break-the-header-max-width) {
312+
@include db-cmp-mainnavigation-li-hover;
313+
}
273314
}
274315
}
275316
}
@@ -299,11 +340,15 @@
299340
position: relative;
300341
}
301342
}
302-
@media screen and (max-width: $db-break-the-header-max-width) {
303-
@include db-cmp-mainnavigation-li;
304-
}
305-
@container style(--db-narrower-screen: true) {
306-
@include db-cmp-mainnavigation-li;
343+
@if variable-exists(enterprise) {
344+
// Based on the browser strategy, we could ignore Firefox for the moment
345+
@container style(--db-narrower-screen: true) {
346+
@include db-cmp-mainnavigation-li;
347+
}
348+
} @else {
349+
@media screen and (max-width: $db-break-the-header-max-width) {
350+
@include db-cmp-mainnavigation-li;
351+
}
307352
}
308353

309354
@mixin db-cmp-mainnavigation-li-above {
@@ -326,11 +371,15 @@
326371
}
327372
}
328373
}
329-
@media screen and (width > $db-break-the-header-max-width) {
330-
@include db-cmp-mainnavigation-li-above;
331-
}
332-
@container not style(--db-narrower-screen: true) {
333-
@include db-cmp-mainnavigation-li-above;
374+
@if variable-exists(enterprise) {
375+
// Based on the browser strategy, we could ignore Firefox for the moment
376+
@container not style(--db-narrower-screen: true) {
377+
@include db-cmp-mainnavigation-li-above;
378+
}
379+
} @else {
380+
@media screen and (width > $db-break-the-header-max-width) {
381+
@include db-cmp-mainnavigation-li-above;
382+
}
334383
}
335384
}
336385
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
$enterprise: true;
2+
13
@import "header.variables";
24
@import "../header";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
$enterprise: true;
2+
13
@import "meta.variables";
24
@import "../meta";

source/_patterns/03-areas/00-header/header.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you're using CSS only without SCSS, you could set the CSS Custom Property / C
1717
}
1818
```
1919

20-
Please keep in mind that the CSS Variable solution doesn't work in Mozilla Firefox at the time of writing, please have a look at <https://bugzilla.mozilla.org/show_bug.cgi?id=1795622> for upcoming support.
20+
Please keep in mind that the CSS Variable solution doesn't work in Mozilla Firefox at the time of writing (please have a look at <https://bugzilla.mozilla.org/show_bug.cgi?id=1795622> for upcoming support), and that for we've only enabled it within the `enterprise` themed stylings.
2121

2222
## Fixed positioned header
2323

source/_patterns/03-areas/00-header/header.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@
3131
border-bottom: $header---borderBottom;
3232
min-height: to-rem($pxValue: 64);
3333
}
34-
@media screen and (max-width: $db-break-the-header-max-width) {
35-
@include db-cmp-header;
36-
}
37-
@container style(--db-narrower-screen: true) {
38-
@include db-cmp-header;
34+
@if variable-exists(enterprise) {
35+
// Based on the browser strategy, we could ignore Firefox for the moment
36+
@container style(--db-narrower-screen: true) {
37+
@include db-cmp-header;
38+
}
39+
} @else {
40+
@media screen and (max-width: $db-break-the-header-max-width) {
41+
@include db-cmp-header;
42+
}
3943
}
4044
}

0 commit comments

Comments
 (0)