Skip to content

Commit ac54971

Browse files
tibi2303donquixote
andauthored
OEL-4185: Improved mega menu. (#702)
* OEL-4185: Fixed mega menu and update header. * OEL-4185: See all button fixed. * OEL-4185: Fix spacing and improved see all fixed position. * OEL-4185: Improved selectors. * OEL-4185: Full clickable area. * OEL-4185: Prettier. * OEL-4185: Fix span spacing. * OEL-4185: Cleanup and markup improvements. * OEL-4185: Darker border color. * OEL-4185: Move the .__see-all style down. * OEL-4185: Move the .see-all-button style into .__see-all section. * OEL-4185: Remove redundant background color on .__body. * OEL-4185: Rely on flex-basis, instead of block-size: 1px. * OEL-4185: Drop the .__body wrapper. * OEL-4185: Update snaps, dropping the .__body wrapper. * OEL-4185: Fix extra header height when extra elements present. * OEL-4185: Improvement for mega menu height calculation js. --------- Co-authored-by: Andreas Hennings <andreas@dqxtech.net>
1 parent 6fd6d68 commit ac54971

File tree

35 files changed

+6812
-2267
lines changed

35 files changed

+6812
-2267
lines changed

src/compositions/bcl-contact-form/__snapshots__/contact-form.test.js.snap

Lines changed: 519 additions & 162 deletions
Large diffs are not rendered by default.

src/compositions/bcl-event/__snapshots__/event.test.js.snap

Lines changed: 346 additions & 108 deletions
Large diffs are not rendered by default.

src/compositions/bcl-glossary/__snapshots__/glossary.test.js.snap

Lines changed: 346 additions & 108 deletions
Large diffs are not rendered by default.

src/compositions/bcl-group/__snapshots__/group.test.js.snap

Lines changed: 692 additions & 216 deletions
Large diffs are not rendered by default.

src/compositions/bcl-header/__snapshots__/header.test.js.snap

Lines changed: 511 additions & 200 deletions
Large diffs are not rendered by default.

src/compositions/bcl-header/header.html.twig

Lines changed: 43 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
- language_modal (object) (default: {})
1818
- light (boolean) (default: false)
1919
- modals (modal[]) (default: [])
20+
- toggler_attributes (drupal attrs)
21+
- icon_path (string) (default: '')
2022
- attributes (drupal attrs)
2123
#}
2224

@@ -30,6 +32,8 @@
3032
{% set _breadcrumbs = breadcrumbs|default({}) %}
3133
{% set _language_modal = language_modal|default({}) %}
3234
{% set _light = light ?? false %}
35+
{% set _toggler_attributes = toggler_attributes ?: create_attribute() %}
36+
{% set _icon_path = icon_path|default('') %}
3337
{% set _modals = modals|default([]) %}
3438

3539
{% set _site_name_classes = 'bcl-header__site-name' %}
@@ -38,7 +42,7 @@
3842
{% set attributes = create_attribute() %}
3943
{% endif %}
4044

41-
{% set attributes = attributes.addClass(['bcl-header', 'bcl-header--' ~ _variant]) %}
45+
{% set attributes = attributes.addClass(['bcl-header', 'bcl-header--' ~ _variant, 'shadow-sm']) %}
4246

4347
{% if site_name_classes is not empty %}
4448
{% set _site_name_classes = _site_name_classes ~ ' ' ~ site_name_classes %}
@@ -49,6 +53,33 @@
4953
{% set _project_classes = _project_classes ~ ' light' %}
5054
{% endif %}
5155

56+
{% set toggler_attributes = _toggler_attributes.addClass(['bcl-navbar-toggler', 'd-lg-none'])
57+
.setAttribute('type', 'button')
58+
.setAttribute('data-bs-toggle', 'collapse')
59+
.setAttribute('data-bs-target', '#' ~ navbar_id)
60+
.setAttribute('aria-controls', navbar_id)
61+
.setAttribute('aria-expanded', 'false')
62+
%}
63+
64+
{% set navbar_toggle_button %}
65+
<button
66+
{{ toggler_attributes }}
67+
>
68+
{% include '@oe-bcl/bcl-icon/icon.html.twig' with {
69+
name: 'list',
70+
size: 'fluid',
71+
path: _icon_path,
72+
attributes: create_attribute().addClass(['default-icon']),
73+
} only %}
74+
{% include '@oe-bcl/bcl-icon/icon.html.twig' with {
75+
name: 'x',
76+
size: 'fluid',
77+
path: _icon_path,
78+
attributes: create_attribute().addClass(['active-icon']),
79+
} only %}
80+
</button>
81+
{% endset %}
82+
5283
<header
5384
{{ attributes }}
5485
>
@@ -70,54 +101,16 @@
70101
{% endfor %}
71102
</a>
72103
{% endif %}
73-
<button
74-
class="navbar-toggler bcl-navbar-toggler"
75-
type="button"
76-
data-bs-toggle="collapse"
77-
data-bs-target='#{{ _navbar_id }}'
78-
aria-controls='{{ _navbar_id }}'
79-
aria-expanded="false"
80-
aria-label="Toggle navigation"
81-
>
82-
<span class="navbar-toggler-icon"></span>
83-
</button>
104+
{{ navbar_toggle_button }}
84105
</div>
85106
</nav>
86107

87-
88-
<!-- project name -->
89-
{% if _project_logo is not empty or _site_name is not empty %}
90-
<div class="{{ _project_classes }}">
108+
<!-- site name -->
109+
<div class="bcl-header__site-name" id="site-name-heading">
91110
<div class="container">
92-
{% if _project_link is not empty %}
93-
<a
94-
href="{{ _project_link }}"
95-
>
96-
{% endif %}
97-
{% if _project_logo is not empty %}
98-
<img
99-
{% if _project_logo.path is not empty %}
100-
src="{{ _project_logo.path }}"
101-
{% endif %}
102-
{% if _project_logo.alt is not empty %}
103-
alt="{{ _project_logo.alt }}"
104-
{% endif %}
105-
{% if _project_logo.classes is not empty %}
106-
class="{{ _project_logo.classes }}"
107-
{% endif %}
108-
/>
109-
{% endif %}
110-
{% if _site_name is not empty %}
111-
<span class="{{ _site_name_classes }}">
112-
{{- _site_name -}}
113-
</span>
114-
{% endif %}
115-
{% if _project_link is not empty %}
116-
</a>
117-
{% endif %}
111+
<span class="h5 py-3-5 border-top-subtle mb-0 d-block">{{ _site_name }}</span>
118112
</div>
119113
</div>
120-
{% endif %}
121114

122115
<!-- navbar -->
123116
{% if _navbar is not empty %}
@@ -126,15 +119,15 @@
126119
attributes: create_attribute().addClass('bcl-header__navbar collapse navbar-collapse').setAttribute('id', _navbar_id).setAttribute('aria-label', 'Main Navigation'),
127120
}) only %}
128121
{% endif %}
129-
130-
<!-- breadcrumbs -->
131-
{% if _breadcrumbs is not empty %}
132-
<div class="container">
133-
{% include '@oe-bcl/bcl-breadcrumb/breadcrumb.html.twig' with _breadcrumbs only %}
134-
</div>
135-
{% endif %}
136122
</header>
137123

124+
<!-- breadcrumbs -->
125+
{% if _breadcrumbs is not empty %}
126+
<div class="container">
127+
{% include '@oe-bcl/bcl-breadcrumb/breadcrumb.html.twig' with _breadcrumbs only %}
128+
</div>
129+
{% endif %}
130+
138131
{% for modal in _modals %}
139132
{% include '@oe-bcl/bcl-modal/modal.html.twig' with modal only %}
140133
{% endfor %}

0 commit comments

Comments
 (0)