From 062ebe297575cede54aab632fbcf34cbd873d5d5 Mon Sep 17 00:00:00 2001 From: Joshua Nicholson <94021017+jnicholCU@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:01:06 +0900 Subject: [PATCH] Sidebar menu theme styles Styles applied when the light gray sidebar menu style option is picked in the theme configuration. Styles override basic options with new css file. --- boulder_base.libraries.yml | 9 ++++++++- css/menu-styles/ucb-sidebar-gray-styles.css | 17 +++++++++++++++++ templates/layout/page.html.twig | 4 ++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 css/menu-styles/ucb-sidebar-gray-styles.css diff --git a/boulder_base.libraries.yml b/boulder_base.libraries.yml index 46a9bd50..eb0a925c 100644 --- a/boulder_base.libraries.yml +++ b/boulder_base.libraries.yml @@ -5,7 +5,8 @@ ucb-global: css/bootstrap/bootstrap.min.css: {} css/layout.css: {} theme: - https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;500;700&display=swap: { type: external } + https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;500;700&display=swap: + { type: external } css/style-responsive.css: {} css/styleguide/global.css: {} css/styleguide/branding.css: {} @@ -527,3 +528,9 @@ ucb-newsletter-list-block: css: theme: css/block/ucb-newsletter-list-block.css: {} + +ucb-sidebar-menu-style-gray: + version: 1.x + css: + theme: + css/menu-styles/ucb-sidebar-gray-styles.css: {weight: 50} diff --git a/css/menu-styles/ucb-sidebar-gray-styles.css b/css/menu-styles/ucb-sidebar-gray-styles.css new file mode 100644 index 00000000..f09e41e3 --- /dev/null +++ b/css/menu-styles/ucb-sidebar-gray-styles.css @@ -0,0 +1,17 @@ +.ucb-page-content .ucb-menu { + border-width: 1px 0px 1px 1px; + border-style: solid; + border-color: var(--ucb-light-gray); +} + +.ucb-page-content .ucb-menu li.menu-item a.nav-link.is-active, .ucb-page-content .ucb-menu .menu-item.active:last-child > a { + background-color: var(--ucb-light-gray); +} + +.ucb-page-content .ucb-menu .expanded.active > a.nav-link, .ucb-page-content .ucb-menu .expanded.active > .ucb-menu { + border: none; +} + +.ucb-page-content .ucb-menu li.menu-item { + border: none; +} \ No newline at end of file diff --git a/templates/layout/page.html.twig b/templates/layout/page.html.twig index 6645de86..8311d21a 100644 --- a/templates/layout/page.html.twig +++ b/templates/layout/page.html.twig @@ -80,6 +80,10 @@ {% else %} {{ attach_library('boulder_base/ucb-menu-style-default') }} {% endif %} + {% set sidebar_menu_style = drupal_config('boulder_base.settings', 'ucb_sidebar_menu_style') %} + {% if sidebar_menu_style == 'light-gray' %} + {{ attach_library('boulder_base/ucb-sidebar-menu-style-gray') }} + {% endif %} {% set header_color = 'black' %} {% set campus_header_color = 'black' %} {% set campus_header_text_color = 'white' %}