From 38ffad700245df636d79999284a4923e70d90b0a Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Tue, 6 Aug 2024 15:09:12 -0500 Subject: [PATCH 01/22] adding il-header css and js to theme --- illinois_framework_theme.info.yml | 1 + illinois_framework_theme.libraries.yml | 7 +++++++ templates/layout/html.html.twig | 1 + 3 files changed, 9 insertions(+) diff --git a/illinois_framework_theme.info.yml b/illinois_framework_theme.info.yml index 2261f67..90efdf4 100644 --- a/illinois_framework_theme.info.yml +++ b/illinois_framework_theme.info.yml @@ -19,6 +19,7 @@ libraries-override: libraries: - illinois_framework_theme/global-styling - illinois_framework_theme/web-components + - illinois_framework_theme/il-header # Regions regions: diff --git a/illinois_framework_theme.libraries.yml b/illinois_framework_theme.libraries.yml index 541d50b..5cf93fa 100644 --- a/illinois_framework_theme.libraries.yml +++ b/illinois_framework_theme.libraries.yml @@ -40,6 +40,13 @@ ils-contentslider: https://contrib.webtheme.illinois.edu/ils-contentslider/contentslider.min.js: type: external minified: true +il-header: + header: true + css: + theme: + https://cdn.brand.illinois.edu/components/il-header.css: + type: external + minified: true content-adjust: js: js/content.js: {} diff --git a/templates/layout/html.html.twig b/templates/layout/html.html.twig index e38b0b2..3e925db 100644 --- a/templates/layout/html.html.twig +++ b/templates/layout/html.html.twig @@ -35,6 +35,7 @@ + {# UIUC Cookie banner: needs to be placed before any other script tags to function. Won't be included if running on From 65b3bebb69b6e4cd7c3b90756a7410dce6cd9dfe Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Tue, 6 Aug 2024 15:10:03 -0500 Subject: [PATCH 02/22] adding il-header tag to page templates --- templates/layout/page--content-page.html.twig | 4 +++- templates/layout/page--search.html.twig | 4 +++- templates/layout/page.html.twig | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/layout/page--content-page.html.twig b/templates/layout/page--content-page.html.twig index 712e964..2ca2526 100644 --- a/templates/layout/page--content-page.html.twig +++ b/templates/layout/page--content-page.html.twig @@ -63,7 +63,9 @@ {% endif %}
- {{ page.header }} + + {{ page.header }} + {{ page.breadcrumb }} {{ page.highlighted }} {{ page.help }} diff --git a/templates/layout/page--search.html.twig b/templates/layout/page--search.html.twig index f509ba7..24a8ade 100644 --- a/templates/layout/page--search.html.twig +++ b/templates/layout/page--search.html.twig @@ -46,7 +46,9 @@ */ #}
- {{ page.header }} + + {{ page.header }} + {{ page.breadcrumb }} {{ page.highlighted }} {{ page.help }} diff --git a/templates/layout/page.html.twig b/templates/layout/page.html.twig index 6bf8afe..ca9c047 100644 --- a/templates/layout/page.html.twig +++ b/templates/layout/page.html.twig @@ -45,7 +45,9 @@ */ #}
- {{ page.header }} + + {{ page.header }} + {{ page.breadcrumb }} {{ page.highlighted }} {{ page.help }} From 5105e2e53e6cd8dcfc5d5f03fb045ae8bf76fc98 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Tue, 6 Aug 2024 15:11:51 -0500 Subject: [PATCH 03/22] region header adding new il header code and update to main navigation --- scss/illinois-framework/_region.header.scss | 2 +- .../navigation/menu--main--nav-main.html.twig | 55 ++++++++++--------- templates/region/region--header.html.twig | 28 ++++------ 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/scss/illinois-framework/_region.header.scss b/scss/illinois-framework/_region.header.scss index e643dbe..e6247f5 100644 --- a/scss/illinois-framework/_region.header.scss +++ b/scss/illinois-framework/_region.header.scss @@ -1,4 +1,4 @@ -.region-header { +il-header { position: relative; z-index: 101; } diff --git a/templates/navigation/menu--main--nav-main.html.twig b/templates/navigation/menu--main--nav-main.html.twig index 36cb554..2ca83e0 100644 --- a/templates/navigation/menu--main--nav-main.html.twig +++ b/templates/navigation/menu--main--nav-main.html.twig @@ -24,34 +24,37 @@ We call a macro which calls itself to render the full tree. @see http://twig.sensiolabs.org/doc/tags/macro.html #} -{{ menus.menu_links(items, attributes, 0) }} -{% macro menu_links(items, attributes, menu_level) %} +{% import _self as menus %} +{# +We call a macro which calls itself to render the full tree. +@see http://twig.sensiolabs.org/doc/tags/macro.html +#} +{{ menus.build_menu(items, attributes, 0) }} + +{% macro build_menu(items, attributes, menu_level) %} {% import _self as menus %} {% if items %} - {% for item in items %} - {% set item_length = items|length %} - {% if menu_level == 0 and item.below %} - = 5 and loop.index > (item_length - 2) %}right="true"{% endif %}> - {# Check if there's in the top-level menu link and remove the href if there is no link #} - {% if item.url.toString is not empty -%} - {{ item.title }} - {% else %} - {{ item.title }} - {% endif -%} - - - {% else %} - - {{ item.title }} - - {% endif %} - {% endfor %} +
    + {% for item in items %} + {{ menus.add_link(item, attributes, menu_level) }} + {% endfor %} +
{% endif %} {% endmacro %} +{% macro add_link(item, attributes, menu_level) %} + {% import _self as menus %} +
  • + {% if item.below %} + + {{ item.title }} + {{ menus.build_menu(item.below, attributes, menu_level + 1) }} + + {% elseif item.url.toString is not empty -%} + {{ item.title }} + {% else %} + {{ item.title }} + {% endif -%} +
  • +{% endmacro %} + diff --git a/templates/region/region--header.html.twig b/templates/region/region--header.html.twig index 727f17d..c5750b7 100644 --- a/templates/region/region--header.html.twig +++ b/templates/region/region--header.html.twig @@ -26,24 +26,20 @@ {% else %} {% set menu_type = 'simple' %} {% endif %} - - -
    - {% if if_secondary_site_title %} -

    {% if if_secondary_site_link %} - {{ if_secondary_site_title }} + {{ if_secondary_site_title }} {% else %} - {{ if_secondary_site_title }} + {{ if_secondary_site_title }} {% endif %} -

    {% endif %} -

    {{ drupal_config('system.site', 'name') | raw }}

    -
    -
    - -
    {# /.layout-container #} diff --git a/templates/layout/page--search.html.twig b/templates/layout/page--search.html.twig index 24a8ade..98a2402 100644 --- a/templates/layout/page--search.html.twig +++ b/templates/layout/page--search.html.twig @@ -60,5 +60,7 @@
    - {{ page.footer }} + + {{ page.footer }} + {# /.layout-container #} diff --git a/templates/layout/page.html.twig b/templates/layout/page.html.twig index ca9c047..364fb01 100644 --- a/templates/layout/page.html.twig +++ b/templates/layout/page.html.twig @@ -66,6 +66,7 @@ - - {{ page.footer }} + + {{ page.footer }} + {# /.layout-container #} From be921514944eadd30939ee8ac3ee8fa9aa746a22 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Wed, 7 Aug 2024 17:02:41 -0500 Subject: [PATCH 06/22] adding il-footer code to region footer --- templates/region/region--footer.html.twig | 52 +++++++++++------------ 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/templates/region/region--footer.html.twig b/templates/region/region--footer.html.twig index 1db3e48..d2e7806 100644 --- a/templates/region/region--footer.html.twig +++ b/templates/region/region--footer.html.twig @@ -21,16 +21,33 @@ 'l-region--' ~ region|clean_class, ] %} - - - - + {% if if_footer_colleges %} {# /.layout-container #} diff --git a/templates/layout/page--spotlight.html.twig b/templates/layout/page--spotlight.html.twig index 23d0118..4c035e1 100644 --- a/templates/layout/page--spotlight.html.twig +++ b/templates/layout/page--spotlight.html.twig @@ -86,6 +86,8 @@ - {{ page.footer }} + + {{ page.footer }} + {# /.layout-container #} From 7b9f7e52d8a859c777fe227e8283c12f284ec987 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Wed, 18 Sep 2024 11:03:29 -0500 Subject: [PATCH 16/22] adding blocking=render to script tags on html.html.twig --- templates/layout/html.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/layout/html.html.twig b/templates/layout/html.html.twig index 429fc64..29b7130 100644 --- a/templates/layout/html.html.twig +++ b/templates/layout/html.html.twig @@ -45,8 +45,8 @@ {%- endif %} - - + + {{ head_title|safe_join(' | ') }} | Illinois From 5ad88c82356a50dc570f668b4e3379075f8a8a99 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Wed, 18 Sep 2024 12:01:22 -0500 Subject: [PATCH 17/22] removing async from script tag to fix navigation displaying incorrectly on mobile --- templates/layout/html.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/layout/html.html.twig b/templates/layout/html.html.twig index 29b7130..1c7c2e1 100644 --- a/templates/layout/html.html.twig +++ b/templates/layout/html.html.twig @@ -45,8 +45,8 @@ {%- endif %} - - + + {{ head_title|safe_join(' | ') }} | Illinois From 095f841d7faadab03eb8f538ce095f97ae26c270 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Thu, 19 Sep 2024 09:18:47 -0500 Subject: [PATCH 18/22] added header and footer scripts to libraries.yml --- illinois_framework_theme.libraries.yml | 14 ++++++++++++++ templates/layout/html.html.twig | 2 -- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/illinois_framework_theme.libraries.yml b/illinois_framework_theme.libraries.yml index 3ec5d46..c18f6ff 100644 --- a/illinois_framework_theme.libraries.yml +++ b/illinois_framework_theme.libraries.yml @@ -54,6 +54,13 @@ il-header: https://cdn.brand.illinois.edu/components/il-header.css: type: external minified: true + js: + https://cdn.brand.illinois.edu/components/il-header.mjs: + type: external + minified: true + attributes: + type: module + blocking: render il-footer: header: true css: @@ -61,6 +68,13 @@ il-footer: https://cdn.brand.illinois.edu/components/il-footer.css: type: external minified: true + js: + https://cdn.brand.illinois.edu/components/il-footer.mjs: + type: external + minified: true + attributes: + type: module + blocking: render content-adjust: js: js/content.js: {} diff --git a/templates/layout/html.html.twig b/templates/layout/html.html.twig index 1c7c2e1..e38b0b2 100644 --- a/templates/layout/html.html.twig +++ b/templates/layout/html.html.twig @@ -45,8 +45,6 @@ {%- endif %} - - {{ head_title|safe_join(' | ') }} | Illinois From 449333812f76c883a1a667503297c8d1b96b2a07 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Tue, 19 Nov 2024 20:57:12 -0600 Subject: [PATCH 19/22] adding important to z-index on il-header --- scss/illinois-framework/_region.header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scss/illinois-framework/_region.header.scss b/scss/illinois-framework/_region.header.scss index 699b974..b8f6133 100644 --- a/scss/illinois-framework/_region.header.scss +++ b/scss/illinois-framework/_region.header.scss @@ -1,6 +1,6 @@ il-header { position: relative; - z-index: 101; + z-index: 101 !important; } il-header a[slot="site-name"], il-header a[slot="primary-unit"] { text-decoration: none; From c691c430aef072d1d531973670450d1f9ccbf2b7 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Fri, 22 Nov 2024 13:46:04 -0600 Subject: [PATCH 20/22] header nav make links with another section underneath wrap --- scss/illinois-framework/_region.header.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scss/illinois-framework/_region.header.scss b/scss/illinois-framework/_region.header.scss index b8f6133..c3bde2a 100644 --- a/scss/illinois-framework/_region.header.scss +++ b/scss/illinois-framework/_region.header.scss @@ -11,3 +11,6 @@ il-header a[slot="site-name"], il-header a[slot="primary-unit"] { color: var(--il-altgeld); } } +il-header-nav-section-with-link > a[slot="link"] { + white-space: wrap !important; +} From 8dbd78cc61bd5deed503677013c3cd8c9da7c5b9 Mon Sep 17 00:00:00 2001 From: Natalie Johnstone Date: Fri, 6 Dec 2024 12:12:28 -0600 Subject: [PATCH 21/22] Added underline to header on footer columns --- scss/illinois-framework/_region.footer.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scss/illinois-framework/_region.footer.scss b/scss/illinois-framework/_region.footer.scss index 110e76e..495cb23 100644 --- a/scss/illinois-framework/_region.footer.scss +++ b/scss/illinois-framework/_region.footer.scss @@ -15,8 +15,11 @@ il-footer { } h2 { - font: 600 1.5rem/1.25 var(--il-font-sans); + font: 600 1.25rem/1.5 var(--il-font-sans); margin-bottom: .75rem; + font-weight: 700; + border-bottom: 1px solid var(--il-blue); + padding-bottom: .75rem; } .col-md { @include media-breakpoint-up(lg) { From 87533125a7ad498b932b14cf8e4bc37e13ffd848 Mon Sep 17 00:00:00 2001 From: Tyler Rubach <56594946+trubach@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:37:17 -0600 Subject: [PATCH 22/22] Update block.block.illinois_framework_theme_main_menu.yml Update the main menu block to limit the depth shown by default to 2 levels (top level items, and the 2nd level items) --- .../block.block.illinois_framework_theme_main_menu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/install/block.block.illinois_framework_theme_main_menu.yml b/config/install/block.block.illinois_framework_theme_main_menu.yml index d936741..1a741ce 100644 --- a/config/install/block.block.illinois_framework_theme_main_menu.yml +++ b/config/install/block.block.illinois_framework_theme_main_menu.yml @@ -16,9 +16,9 @@ plugin: 'system_menu_block:main' settings: id: 'system_menu_block:main' label: 'Main navigation' - provider: system label_display: '0' + provider: system level: 1 - depth: 0 + depth: 2 expand_all_items: true visibility: { }