@openeuropa/bcl-theme-default 1.10.4 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/oe-bcl-ckeditor5.min.css +1 -1
- package/css/oe-bcl-ckeditor5.min.css.map +1 -1
- package/css/oe-bcl-default.css +581 -91
- package/css/oe-bcl-default.css.map +1 -1
- package/css/oe-bcl-default.min.css +1 -1
- package/css/oe-bcl-default.min.css.map +1 -1
- package/js/oe-bcl-default.bundle.js +187 -0
- package/js/oe-bcl-default.bundle.js.map +1 -1
- package/js/oe-bcl-default.bundle.min.js +1 -1
- package/js/oe-bcl-default.bundle.min.js.map +1 -1
- package/js/oe-bcl-default.esm.js +186 -1
- package/js/oe-bcl-default.esm.js.map +1 -1
- package/js/oe-bcl-default.esm.min.js +1 -1
- package/js/oe-bcl-default.esm.min.js.map +1 -1
- package/js/oe-bcl-default.umd.js +187 -0
- package/js/oe-bcl-default.umd.js.map +1 -1
- package/js/oe-bcl-default.umd.min.js +1 -1
- package/js/oe-bcl-default.umd.min.js.map +1 -1
- package/package.json +5 -5
- package/src/js/index.esm.js +4 -0
- package/src/js/index.umd.js +4 -0
- package/src/js/main-navigation/main-navigation.js +42 -0
- package/src/js/mega-menu/mega-menu.js +177 -0
- package/src/scss/_header.scss +212 -111
- package/src/scss/_mega-menu.scss +432 -0
- package/src/scss/base/_colors.scss +3 -0
- package/src/scss/oe-bcl-default.scss +1 -0
- package/templates/bcl-button/button.html.twig +3 -2
- package/templates/bcl-header/header.html.twig +37 -6
- package/templates/bcl-mega-menu/mega-menu-items.html.twig +35 -0
- package/templates/bcl-mega-menu/mega-menu-submenu.html.twig +65 -0
- package/templates/bcl-mega-menu/mega-menu.html.twig +115 -0
- package/templates/bcl-navigation/navigation.html.twig +3 -1
- package/templates/bcl-offcanvas/offcanvas.html.twig +9 -6
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-theme-default",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "1.10.
|
|
5
|
+
"version": "1.10.6",
|
|
6
6
|
"description": "OE - BCL theme default",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"align-templates": "lerna --scope \"@openeuropa/bcl-twig-templates\" run prepublish",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"@ecl/resources-ec-logo": "3.7.1",
|
|
23
23
|
"@ecl/resources-eu-logo": "3.7.1",
|
|
24
24
|
"@ecl/resources-flag-icons": "3.7.1",
|
|
25
|
-
"@openeuropa/bcl-bootstrap": "^1.10.
|
|
26
|
-
"@openeuropa/bcl-builder": "^1.10.
|
|
27
|
-
"@openeuropa/bcl-twig-templates": "^1.10.
|
|
25
|
+
"@openeuropa/bcl-bootstrap": "^1.10.6",
|
|
26
|
+
"@openeuropa/bcl-builder": "^1.10.6",
|
|
27
|
+
"@openeuropa/bcl-twig-templates": "^1.10.6",
|
|
28
28
|
"@rollup/plugin-replace": "6.0.2",
|
|
29
29
|
"copyfiles": "2.4.1",
|
|
30
30
|
"cross-env": "7.0.3",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"design-system",
|
|
52
52
|
"twig"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "f2c1911b328b12531079c209ecada73a505713c2"
|
|
55
55
|
}
|
package/src/js/index.esm.js
CHANGED
|
@@ -11,6 +11,8 @@ import Carousel from "@openeuropa/bcl-bootstrap/js/src/carousel";
|
|
|
11
11
|
import Collapse from "@openeuropa/bcl-bootstrap/js/src/collapse";
|
|
12
12
|
import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
|
|
13
13
|
import Modal from "@openeuropa/bcl-bootstrap/js/src/modal";
|
|
14
|
+
import MainNavigation from "@openeuropa/bcl-theme-default/src/js/main-navigation/main-navigation";
|
|
15
|
+
import MegaMenu from "@openeuropa/bcl-theme-default/src/js/mega-menu/mega-menu";
|
|
14
16
|
import Offcanvas from "@openeuropa/bcl-bootstrap/js/src/offcanvas";
|
|
15
17
|
import Popover from "@openeuropa/bcl-bootstrap/js/src/popover";
|
|
16
18
|
import ScrollSpyV2 from "@openeuropa/bcl-bootstrap/js/src/scrollspy";
|
|
@@ -29,6 +31,8 @@ export {
|
|
|
29
31
|
Collapse,
|
|
30
32
|
Dropdown,
|
|
31
33
|
Modal,
|
|
34
|
+
MainNavigation,
|
|
35
|
+
MegaMenu,
|
|
32
36
|
Offcanvas,
|
|
33
37
|
Popover,
|
|
34
38
|
ScrollSpyV2,
|
package/src/js/index.umd.js
CHANGED
|
@@ -11,6 +11,8 @@ import Carousel from "@openeuropa/bcl-bootstrap/js/src/carousel";
|
|
|
11
11
|
import Collapse from "@openeuropa/bcl-bootstrap/js/src/collapse";
|
|
12
12
|
import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
|
|
13
13
|
import Modal from "@openeuropa/bcl-bootstrap/js/src/modal";
|
|
14
|
+
import MainNavigation from "@openeuropa/bcl-theme-default/src/js/main-navigation/main-navigation";
|
|
15
|
+
import MegaMenu from "@openeuropa/bcl-theme-default/src/js/mega-menu/mega-menu";
|
|
14
16
|
import Offcanvas from "@openeuropa/bcl-bootstrap/js/src/offcanvas";
|
|
15
17
|
import Popover from "@openeuropa/bcl-bootstrap/js/src/popover";
|
|
16
18
|
import ScrollSpyV2 from "@openeuropa/bcl-bootstrap/js/src/scrollspy";
|
|
@@ -29,6 +31,8 @@ export default {
|
|
|
29
31
|
Collapse,
|
|
30
32
|
Dropdown,
|
|
31
33
|
Modal,
|
|
34
|
+
MainNavigation,
|
|
35
|
+
MegaMenu,
|
|
32
36
|
Offcanvas,
|
|
33
37
|
Popover,
|
|
34
38
|
ScrollSpyV2,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import SelectorEngine from "@openeuropa/bcl-bootstrap/js/src/dom/selector-engine";
|
|
2
|
+
import EventHandler from "@openeuropa/bcl-bootstrap/js/src/dom/event-handler";
|
|
3
|
+
|
|
4
|
+
class MainNavigation {
|
|
5
|
+
constructor(toggler) {
|
|
6
|
+
this.toggler = toggler;
|
|
7
|
+
this.top = 0;
|
|
8
|
+
|
|
9
|
+
this.target = this.getTargetFromToggler(toggler);
|
|
10
|
+
if (!this.target) return;
|
|
11
|
+
|
|
12
|
+
this.addListeners();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getTargetFromToggler(toggler) {
|
|
16
|
+
const selector = toggler.getAttribute("data-bs-target");
|
|
17
|
+
if (!selector) return null;
|
|
18
|
+
try {
|
|
19
|
+
return document.querySelector(selector);
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
addListeners() {
|
|
26
|
+
EventHandler.on(this.target, "show.bs.collapse", () => {
|
|
27
|
+
window.scrollTo(0, this.top);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static init(selector = ".bcl-toggler", options) {
|
|
32
|
+
const togglers = SelectorEngine.find(selector);
|
|
33
|
+
togglers.forEach((toggler) => new MainNavigation(toggler, options));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
38
|
+
// Run for all .bcl-toggler buttons
|
|
39
|
+
MainNavigation.init(".bcl-navbar-toggler");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default MainNavigation;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
|
|
2
|
+
import SelectorEngine from "@openeuropa/bcl-bootstrap/js/src/dom/selector-engine";
|
|
3
|
+
import EventHandler from "@openeuropa/bcl-bootstrap/js/src/dom/event-handler";
|
|
4
|
+
|
|
5
|
+
class MegaMenu {
|
|
6
|
+
|
|
7
|
+
constructor(root) {
|
|
8
|
+
this.root = root;
|
|
9
|
+
|
|
10
|
+
this.backButton = SelectorEngine.findOne(".back-button", this.root);
|
|
11
|
+
this.trigger = SelectorEngine.findOne(':scope > .dropdown-toggle[data-bs-toggle="dropdown"]', this.root);
|
|
12
|
+
this.ul = SelectorEngine.findOne('.bcl-mega-menu__items.__level-1', this.root);
|
|
13
|
+
|
|
14
|
+
this.addSubmenuTriggerListeners();
|
|
15
|
+
this.addBackButtonListener();
|
|
16
|
+
this.addTriggerListeners();
|
|
17
|
+
this.addEscapeKeyHandler();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
getPanelForTrigger(trigger) {
|
|
21
|
+
const id = trigger.getAttribute('aria-controls');
|
|
22
|
+
return id ? document.getElementById(id) : null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getFocusableChildren(container) {
|
|
26
|
+
if (!container) return [];
|
|
27
|
+
return Array.from(container.querySelectorAll(
|
|
28
|
+
'a[href], button:not([disabled]):not(.back-button), [tabindex]:not([tabindex="-1"])'
|
|
29
|
+
)).filter(el => !el.hasAttribute('disabled') && el.tabIndex !== -1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
focusFirstItemInPanel(trigger) {
|
|
33
|
+
const panel = this.getPanelForTrigger(trigger);
|
|
34
|
+
if (!panel) return;
|
|
35
|
+
const list = SelectorEngine.findOne('ul.bcl-mega-menu__items', panel);
|
|
36
|
+
if (!list) return;
|
|
37
|
+
const first = this.getFocusableChildren(list)[0];
|
|
38
|
+
if (first) first.focus();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
addEscapeKeyHandler() {
|
|
42
|
+
// Bootstrap attaches its dropdown keydown listener on `document` in the capture phase.
|
|
43
|
+
// By listening on `window` in the capture phase, our handler runs *before* Bootstrap’s.
|
|
44
|
+
// This lets us intercept Esc inside mega menu submenus and stop Bootstrap from closing
|
|
45
|
+
// the entire dropdown.
|
|
46
|
+
window.addEventListener('keydown', (e) => {
|
|
47
|
+
if (e.key !== 'Escape') return;
|
|
48
|
+
|
|
49
|
+
// Only act if Esc originated inside THIS mega menu's open submenu
|
|
50
|
+
const panel = e.target.closest('.bcl-mega-menu__submenu');
|
|
51
|
+
if (!panel || panel.hidden || !this.root.contains(panel)) {
|
|
52
|
+
// Not our submenu: let Bootstrap handle it normally
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Stop the event BEFORE it reaches Bootstrap's document-capture handler
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
e.stopImmediatePropagation();
|
|
59
|
+
e.stopPropagation();
|
|
60
|
+
|
|
61
|
+
// Close only this submenu and focus its trigger
|
|
62
|
+
const triggerId = panel.getAttribute('aria-labelledby');
|
|
63
|
+
const trigger = triggerId ? document.getElementById(triggerId) : null;
|
|
64
|
+
if (trigger) {
|
|
65
|
+
this.closeSubmenu(trigger);
|
|
66
|
+
trigger.focus();
|
|
67
|
+
}
|
|
68
|
+
}, true);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
addTriggerListeners() {
|
|
72
|
+
if (!this.trigger) return;
|
|
73
|
+
|
|
74
|
+
// When the mega menu is opened, focus the first item in the menu.
|
|
75
|
+
EventHandler.on(this.trigger, 'shown.bs.dropdown', () => {
|
|
76
|
+
const panelId = this.trigger.getAttribute('aria-controls');
|
|
77
|
+
const panel = panelId ? document.getElementById(panelId) : null;
|
|
78
|
+
const firstFocusable = panel ? this.getFocusableChildren(panel)[0] : null;
|
|
79
|
+
if (firstFocusable) firstFocusable.focus();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// When the mega menu is closed, close all submenus.
|
|
83
|
+
EventHandler.on(this.trigger, 'hide.bs.dropdown', () => {
|
|
84
|
+
this.closeAllSubmenus();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
addSubmenuTriggerListeners() {
|
|
89
|
+
// Clicking/activating a parent item button toggles the submenu.
|
|
90
|
+
SelectorEngine
|
|
91
|
+
.find(':scope li > button[aria-expanded]', this.root)
|
|
92
|
+
.forEach((trigger) => {
|
|
93
|
+
EventHandler.on(trigger, "click", () => {
|
|
94
|
+
const expanded = trigger.getAttribute('aria-expanded') === 'true';
|
|
95
|
+
if (expanded) {
|
|
96
|
+
// Close this submenu.
|
|
97
|
+
this.closeSubmenu(trigger);
|
|
98
|
+
} else {
|
|
99
|
+
this.openSubmenu(trigger);
|
|
100
|
+
// The back button is only visible in mobile / narrow viewport.
|
|
101
|
+
if (this.backButton && this.backButton.offsetParent !== null) {
|
|
102
|
+
this.backButton.focus();
|
|
103
|
+
} else {
|
|
104
|
+
this.focusFirstItemInPanel(trigger);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
addBackButtonListener() {
|
|
112
|
+
// Clicking a back button closes the submenu or the menu itself.
|
|
113
|
+
if (!this.backButton) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
EventHandler.on(this.backButton, "click", () => {
|
|
117
|
+
const submenusThatWereOpen = this.closeAllSubmenus();
|
|
118
|
+
if (submenusThatWereOpen.length > 0) {
|
|
119
|
+
// Focus the submenu trigger, to allow quick reopen by keystroke.
|
|
120
|
+
submenusThatWereOpen[0].focus();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
// Close the mega menu itself.
|
|
124
|
+
if (this.trigger) {
|
|
125
|
+
// Close using the Bootstrap dropdown API.
|
|
126
|
+
Dropdown.getOrCreateInstance(this.trigger).hide();
|
|
127
|
+
// Focus the main trigger, to allow quick reopen by keystroke.
|
|
128
|
+
this.trigger.focus();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
openSubmenu(trigger) {
|
|
134
|
+
// Close all submenus, then open the current submenu.
|
|
135
|
+
this.closeAllSubmenus();
|
|
136
|
+
trigger.setAttribute('aria-expanded', 'true');
|
|
137
|
+
const panel = this.getPanelForTrigger(trigger);
|
|
138
|
+
if (panel) panel.hidden = false;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Closes all submenus.
|
|
143
|
+
*
|
|
144
|
+
* This is simple while there is only one submenu level.
|
|
145
|
+
*
|
|
146
|
+
* @returns {HTMLElement[]}
|
|
147
|
+
* Triggers for submenus that were closed.
|
|
148
|
+
* Usually this is either exactly one, or none.
|
|
149
|
+
*/
|
|
150
|
+
closeAllSubmenus() {
|
|
151
|
+
if (!this.ul) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const triggers = SelectorEngine
|
|
155
|
+
.find(':scope > li > button[aria-expanded="true"]', this.ul);
|
|
156
|
+
// Use arrow fn to keep `this` bound.
|
|
157
|
+
triggers.forEach((t) => this.closeSubmenu(t));
|
|
158
|
+
return triggers;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
closeSubmenu(trigger) {
|
|
162
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
163
|
+
const panel = this.getPanelForTrigger(trigger);
|
|
164
|
+
if (panel) panel.hidden = true;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
static init(selector = ".bcl-mega-menu") {
|
|
168
|
+
const megaMenus = SelectorEngine.find(selector);
|
|
169
|
+
megaMenus.forEach((menuEl) => new MegaMenu(menuEl));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
174
|
+
MegaMenu.init();
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export default MegaMenu;
|
package/src/scss/_header.scss
CHANGED
|
@@ -4,12 +4,7 @@ $header-background-start: #039 !default;
|
|
|
4
4
|
$header-background-end: #1b4ac3 !default;
|
|
5
5
|
$header-link-active-background: #003776 !default;
|
|
6
6
|
|
|
7
|
-
.bcl-
|
|
8
|
-
position: relative;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.bcl-header__project,
|
|
12
|
-
.bcl-header__navbar {
|
|
7
|
+
.bcl-header__project {
|
|
13
8
|
background: linear-gradient(
|
|
14
9
|
90deg,
|
|
15
10
|
$header-background-start 0%,
|
|
@@ -17,71 +12,15 @@ $header-link-active-background: #003776 !default;
|
|
|
17
12
|
);
|
|
18
13
|
}
|
|
19
14
|
|
|
20
|
-
.bcl-header__top-navbar {
|
|
21
|
-
.navbar-collapse {
|
|
22
|
-
justify-content: end;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.navbar-toggler {
|
|
26
|
-
border: none;
|
|
27
|
-
color: $light;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.navbar-toggler-icon {
|
|
31
|
-
background: url("data:image/svg+xml;utf8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTYgMjU2Ij48cmVjdCB3aWR0aD0iMjU2IiBoZWlnaHQ9IjI1NiIgZmlsbD0ibm9uZSIvPjxjaXJjbGUgY3g9IjEyOCIgY3k9IjY0IiByPSIxNiIvPjxjaXJjbGUgY3g9IjEyOCIgY3k9IjEyOCIgcj0iMTYiLz48Y2lyY2xlIGN4PSIxMjgiIGN5PSIxOTIiIHI9IjE2Ii8+PC9zdmc+");
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
15
|
.bcl-header .nav-link {
|
|
36
16
|
color: $eu-blue;
|
|
37
17
|
display: flex;
|
|
38
18
|
align-items: center;
|
|
39
|
-
padding: map-get($spacers, 2);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.bcl-header__navbar {
|
|
43
|
-
.navbar-collapse {
|
|
44
|
-
padding-bottom: map-get($spacers, 3);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.navbar-nav {
|
|
48
|
-
.nav-link {
|
|
49
|
-
color: $gray-100;
|
|
50
|
-
|
|
51
|
-
&:focus,
|
|
52
|
-
&:hover,
|
|
53
|
-
&.active {
|
|
54
|
-
color: #fff;
|
|
55
|
-
}
|
|
56
|
-
&:focus-visible {
|
|
57
|
-
outline: 2px solid $white;
|
|
58
|
-
border-radius: 4px;
|
|
59
|
-
outline-offset: 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.navbar-toggler {
|
|
65
|
-
position: absolute;
|
|
66
|
-
top: -43px;
|
|
67
|
-
left: map-get($spacers, "2-5");
|
|
68
|
-
border-color: $white;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.navbar-toggler-icon {
|
|
72
|
-
background: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
input:active,
|
|
76
|
-
input:focus {
|
|
77
|
-
box-shadow: 0 0 0 0.25rem hsl(210deg 2% 83% / 50%);
|
|
78
|
-
}
|
|
79
19
|
}
|
|
80
20
|
|
|
81
21
|
.bcl-header--ec,
|
|
82
22
|
.ec__header {
|
|
83
|
-
.bcl-header__project
|
|
84
|
-
.bcl-header__navbar {
|
|
23
|
+
.bcl-header__project {
|
|
85
24
|
background: $header-background;
|
|
86
25
|
}
|
|
87
26
|
/* stylelint-disable-next-line no-descending-specificity */
|
|
@@ -95,8 +34,7 @@ $header-link-active-background: #003776 !default;
|
|
|
95
34
|
}
|
|
96
35
|
|
|
97
36
|
.bcl-header--neutral {
|
|
98
|
-
.bcl-header__project
|
|
99
|
-
.bcl-header__navbar {
|
|
37
|
+
.bcl-header__project {
|
|
100
38
|
background: $gray-700;
|
|
101
39
|
}
|
|
102
40
|
}
|
|
@@ -136,15 +74,22 @@ $header-link-active-background: #003776 !default;
|
|
|
136
74
|
max-width: 80%;
|
|
137
75
|
}
|
|
138
76
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
77
|
+
.bcl-header__navbar.navbar {
|
|
78
|
+
padding: 0;
|
|
79
|
+
.dropdown-toggle,
|
|
80
|
+
.nav-link {
|
|
81
|
+
padding: map-get($spacers, "2-5") map-get($spacers, 3);
|
|
82
|
+
border: none;
|
|
83
|
+
background: transparent;
|
|
84
|
+
}
|
|
85
|
+
&.collapsing {
|
|
86
|
+
transition: none;
|
|
142
87
|
}
|
|
143
88
|
}
|
|
144
89
|
|
|
145
|
-
@
|
|
146
|
-
.bcl-header .
|
|
147
|
-
|
|
90
|
+
@media only screen and (max-width: 400px) {
|
|
91
|
+
.bcl-header--neutral .bcl-header__project-logo {
|
|
92
|
+
display: none;
|
|
148
93
|
}
|
|
149
94
|
}
|
|
150
95
|
|
|
@@ -158,34 +103,44 @@ $header-link-active-background: #003776 !default;
|
|
|
158
103
|
}
|
|
159
104
|
|
|
160
105
|
@include media-breakpoint-down(lg) {
|
|
161
|
-
.bcl-
|
|
162
|
-
|
|
106
|
+
body:has(.bcl-header__navbar #main-navbar.collapsing),
|
|
107
|
+
body:has(.bcl-header__navbar #main-navbar.show),
|
|
108
|
+
body:has(.bcl-header__navbar.collapsing),
|
|
109
|
+
body:has(.bcl-header__navbar.show) {
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
header:has(.bcl-header__navbar #main-navbar.collapsing),
|
|
114
|
+
header:has(.bcl-header__navbar #main-navbar.show),
|
|
115
|
+
header:has(.bcl-header__navbar.collapsing),
|
|
116
|
+
header:has(.bcl-header__navbar.show) {
|
|
117
|
+
height: 100vh;
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-flow: column;
|
|
120
|
+
overflow: auto;
|
|
121
|
+
|
|
122
|
+
> div:has(.breadcrumb) {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
163
125
|
}
|
|
164
126
|
|
|
165
|
-
.bcl-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
right: map-get($spacers, "2-5");
|
|
169
|
-
top: 100%;
|
|
170
|
-
background: white;
|
|
171
|
-
border: 1px solid $gray-300;
|
|
172
|
-
border-radius: 4px;
|
|
173
|
-
|
|
174
|
-
.nav {
|
|
175
|
-
align-items: flex-start;
|
|
176
|
-
flex-direction: column;
|
|
177
|
-
min-width: 16rem;
|
|
178
|
-
padding: map-get($spacers, 3);
|
|
127
|
+
.bcl-header__project {
|
|
128
|
+
padding: map-get($spacers, 3) 0;
|
|
129
|
+
}
|
|
179
130
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
131
|
+
.bcl-header {
|
|
132
|
+
.bcl-header__project {
|
|
133
|
+
z-index: 1040; // Make sure project bar is above the mega menu
|
|
134
|
+
position: relative;
|
|
135
|
+
box-shadow: var(--bs-box-shadow);
|
|
136
|
+
flex-shrink: 0;
|
|
183
137
|
}
|
|
184
138
|
}
|
|
185
139
|
|
|
186
|
-
.bcl-header__project {
|
|
187
|
-
|
|
188
|
-
|
|
140
|
+
.bcl-header:not(:has(.bcl-header__project)) {
|
|
141
|
+
> .navbar:first-child {
|
|
142
|
+
box-shadow: var(--bs-box-shadow);
|
|
143
|
+
}
|
|
189
144
|
}
|
|
190
145
|
|
|
191
146
|
.bcl-header nav + nav {
|
|
@@ -195,21 +150,76 @@ $header-link-active-background: #003776 !default;
|
|
|
195
150
|
position: static;
|
|
196
151
|
}
|
|
197
152
|
}
|
|
153
|
+
.bcl-header__top-navbar {
|
|
154
|
+
z-index: 1040;
|
|
155
|
+
}
|
|
198
156
|
|
|
199
|
-
.bcl-header__navbar {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
157
|
+
.bcl-header__navbar.navbar {
|
|
158
|
+
background: $white;
|
|
159
|
+
padding-top: 0;
|
|
160
|
+
z-index: 1030;
|
|
161
|
+
width: 100%;
|
|
162
|
+
align-items: flex-start;
|
|
163
|
+
.navbar-nav {
|
|
164
|
+
width: 100%;
|
|
165
|
+
margin-top: 1rem;
|
|
166
|
+
&:has(.bcl-mega-menu__container.show) {
|
|
167
|
+
.nav-item {
|
|
168
|
+
display: none;
|
|
169
|
+
}
|
|
170
|
+
.nav-item:has(.bcl-mega-menu__container.show) {
|
|
171
|
+
display: block;
|
|
211
172
|
}
|
|
212
173
|
}
|
|
174
|
+
.dropdown-toggle,
|
|
175
|
+
.nav-link {
|
|
176
|
+
color: $dark;
|
|
177
|
+
width: 100%;
|
|
178
|
+
// Use flex for icon spacing.
|
|
179
|
+
display: flex;
|
|
180
|
+
gap: 1rem;
|
|
181
|
+
justify-content: space-between;
|
|
182
|
+
position: relative;
|
|
183
|
+
padding: 1rem;
|
|
184
|
+
border-bottom: 1px solid $primary-bg-subtle;
|
|
185
|
+
text-align: left;
|
|
186
|
+
// Unset border-radius for buttons.
|
|
187
|
+
border-radius: 0;
|
|
188
|
+
// Allow text wrapping in buttons.
|
|
189
|
+
white-space: normal;
|
|
190
|
+
&.active {
|
|
191
|
+
color: $dark;
|
|
192
|
+
}
|
|
193
|
+
&:focus-visible {
|
|
194
|
+
outline: 2px solid $primary;
|
|
195
|
+
// Don't let the outline overlap other elements.
|
|
196
|
+
outline-offset: -2px;
|
|
197
|
+
// Remove the shadow from bootstrap style.
|
|
198
|
+
box-shadow: none;
|
|
199
|
+
}
|
|
200
|
+
// Whenever ::after is used for an icon, it must not shrink.
|
|
201
|
+
// This also applies to .dropdown-toggle, which gets the icon from Bootstrap.
|
|
202
|
+
&::after {
|
|
203
|
+
flex-shrink: 0;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// The mega menu trigger gets a different type of icon.
|
|
207
|
+
.bcl-mega-menu > .dropdown-toggle {
|
|
208
|
+
&:after {
|
|
209
|
+
background: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2215%22%20viewBox%3D%220%200%2016%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M7.57488%2013.25L8.46238%2014.125L15.1374%207.45L8.43738%200.75L7.56238%201.625L12.7276%206.81247H0.5V8.06247H12.7512L7.57488%2013.25Z%22%20fill%3D%22%23212529%22%2F%3E%3C%2Fsvg%3E");
|
|
210
|
+
align-self: center;
|
|
211
|
+
content: "";
|
|
212
|
+
// Unset border from bootstrap style.
|
|
213
|
+
border: none;
|
|
214
|
+
width: 20px;
|
|
215
|
+
height: 20px;
|
|
216
|
+
background-size: cover;
|
|
217
|
+
background-position: center;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
.dropdown-item {
|
|
221
|
+
white-space: normal;
|
|
222
|
+
}
|
|
213
223
|
}
|
|
214
224
|
}
|
|
215
225
|
}
|
|
@@ -221,6 +231,31 @@ $header-link-active-background: #003776 !default;
|
|
|
221
231
|
background: $white;
|
|
222
232
|
}
|
|
223
233
|
|
|
234
|
+
.bcl-header__navbar {
|
|
235
|
+
background: linear-gradient(
|
|
236
|
+
90deg,
|
|
237
|
+
$header-background-start 0%,
|
|
238
|
+
$header-background-end 100%
|
|
239
|
+
);
|
|
240
|
+
.dropdown-toggle,
|
|
241
|
+
.nav-link {
|
|
242
|
+
color: $white;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.bcl-header--ec,
|
|
247
|
+
.ec__header {
|
|
248
|
+
.bcl-header__navbar {
|
|
249
|
+
background: $header-background;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.bcl-header--neutral {
|
|
254
|
+
.bcl-header__navbar {
|
|
255
|
+
background: $gray-700;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
224
259
|
.bcl-header__site-name {
|
|
225
260
|
margin-left: map-get($spacers, 4);
|
|
226
261
|
font-weight: 500;
|
|
@@ -240,24 +275,90 @@ $header-link-active-background: #003776 !default;
|
|
|
240
275
|
width: auto;
|
|
241
276
|
}
|
|
242
277
|
|
|
243
|
-
.bcl-header__navbar .
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.bcl-header__navbar .dropdown-menu {
|
|
248
|
-
z-index: 1050; // Make sure dropdown overlaps the search offcanvas
|
|
278
|
+
.bcl-header__navbar .bcl-mega-menu {
|
|
279
|
+
--bcl-mega-menu-zindex: 1050; // Make sure dropdown overlaps the search offcanvas
|
|
249
280
|
}
|
|
250
281
|
|
|
251
282
|
.bcl-header:not(.bcl-header--neutral) .bcl-header__project {
|
|
252
283
|
padding-bottom: map-get($spacers, 3);
|
|
253
284
|
}
|
|
254
285
|
|
|
286
|
+
.bcl-header__navbar.collapse {
|
|
287
|
+
display: block;
|
|
288
|
+
}
|
|
289
|
+
|
|
255
290
|
.bcl-header--ec,
|
|
256
291
|
.ec__header {
|
|
257
292
|
.navbar-brand img {
|
|
258
293
|
width: 285px;
|
|
259
294
|
}
|
|
260
295
|
}
|
|
296
|
+
|
|
297
|
+
.bcl-header__navbar.navbar {
|
|
298
|
+
.dropdown-toggle,
|
|
299
|
+
.nav-link {
|
|
300
|
+
border-radius: 0;
|
|
301
|
+
&:hover {
|
|
302
|
+
background: $primary-bg-subtle;
|
|
303
|
+
color: $dark;
|
|
304
|
+
&:focus-visible {
|
|
305
|
+
outline-color: $primary;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
&.active,
|
|
309
|
+
&.show {
|
|
310
|
+
background: $white;
|
|
311
|
+
color: $dark;
|
|
312
|
+
&:focus-visible {
|
|
313
|
+
outline-color: $primary;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
&:focus-visible {
|
|
317
|
+
box-shadow: none;
|
|
318
|
+
border: none;
|
|
319
|
+
outline: 2px solid $white;
|
|
320
|
+
outline-offset: -8px;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
.dropdown-toggle {
|
|
324
|
+
&:after {
|
|
325
|
+
background-color: $white;
|
|
326
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0.625 0.725L1.19375 0.1375L4.99375 3.9625L8.80625 0.125L9.375 0.7125L4.99375 5.125L0.625 0.725Z' fill='black'/%3E%3C/svg%3E");
|
|
327
|
+
-webkit-mask-repeat: no-repeat;
|
|
328
|
+
-webkit-mask-size: contain;
|
|
329
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0.625 0.725L1.19375 0.1375L4.99375 3.9625L8.80625 0.125L9.375 0.7125L4.99375 5.125L0.625 0.725Z' fill='black'/%3E%3C/svg%3E");
|
|
330
|
+
mask-repeat: no-repeat;
|
|
331
|
+
mask-position: center;
|
|
332
|
+
mask-size: contain;
|
|
333
|
+
display: inline-block;
|
|
334
|
+
width: 10px;
|
|
335
|
+
height: 10px;
|
|
336
|
+
border: none;
|
|
337
|
+
margin-top: 4px;
|
|
338
|
+
}
|
|
339
|
+
&:hover {
|
|
340
|
+
&:after {
|
|
341
|
+
background-color: $dark;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
&.active {
|
|
345
|
+
&:after {
|
|
346
|
+
background-color: $primary;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
&.show {
|
|
350
|
+
&:after {
|
|
351
|
+
background-color: $primary;
|
|
352
|
+
transform: rotate(180deg);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
&.no-chevron {
|
|
356
|
+
&:after {
|
|
357
|
+
display: none;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
261
362
|
}
|
|
262
363
|
|
|
263
364
|
.bcl-language-list-modal {
|