From c9d59bec1c6afdee900e38beedfb4db8c7b36894 Mon Sep 17 00:00:00 2001 From: ouidade Date: Tue, 21 Dec 2021 11:56:01 +0100 Subject: [PATCH] header menu propre --- web/themes/custom/eql/css-compiled/styles.css | 50 ++++++-------- .../custom/eql/scss/partials/_header.scss | 59 ++++++---------- .../eql/templates/partials/menu.html.twig | 67 ------------------- 3 files changed, 40 insertions(+), 136 deletions(-) delete mode 100644 web/themes/custom/eql/templates/partials/menu.html.twig diff --git a/web/themes/custom/eql/css-compiled/styles.css b/web/themes/custom/eql/css-compiled/styles.css index ecaa990..5215ca7 100644 --- a/web/themes/custom/eql/css-compiled/styles.css +++ b/web/themes/custom/eql/css-compiled/styles.css @@ -1989,45 +1989,35 @@ a { display: flex; flex-direction: row; width: 100%; } - #header-top .region-header-top-left ul :is(.sous-liste) { + #header-top .region-header-top-left ul .is-active { + color: #009ee3; } + #header-top .region-header-top-left ul ul { display: flex; flex-direction: column; padding: 1rem; } - #header-top .region-header-top-left ul li a { - color: black; } - #header-top .region-header-top-left ul li .is-active { - color: #009ee3; } - #header-top .region-header-top-left ul li :hover { - color: #009ee3; } - #header-top .region-header-top-left ul div:first-child li div { - display: none; } - #header-top .region-header-top-left ul div:nth-child(2) li div { - display: none; } - #header-top .region-header-top-left ul:is(.ul1 .sous-liste .ul2) { - display: none; } - #header-top .region-header-top-left :hover ul div:first-child li div { - display: block; - background-color: white; - padding: 0.2rem; } - #header-top .region-header-top-left :hover ul div:first-child li div a { - color: black; } - #header-top .region-header-top-left :hover ul div:first-child li div a:hover { + #header-top .region-header-top-left ul ul .is-active { color: #009ee3; } - #header-top .region-header-top-left :hover ul div:nth-child(2) li div { - display: block; - background-color: white; - padding: 0.2rem; } - #header-top .region-header-top-left :hover ul div:nth-child(2) li div a { - color: black; } - #header-top .region-header-top-left :hover ul div:nth-child(2) li div a:hover { + #header-top .region-header-top-left ul li { + display: flex; + flex-direction: column; + padding: 1rem; } + #header-top .region-header-top-left ul li a { + color: black; } + #header-top .region-header-top-left ul li .is-active { color: #009ee3; } - #header-top .region-header-top-left :hover ul:is(.ul1 .sous-liste .ul2) { + #header-top .region-header-top-left ul li :hover { + color: #009ee3; } + #header-top .region-header-top-left ul ul { + display: none; } + #header-top .region-header-top-left :hover ul ul { display: block; background-color: white; padding: 0.2rem; } - #header-top .region-header-top-left :hover ul:is(.ul1 .sous-liste .ul2) a { + #header-top .region-header-top-left :hover ul ul .is-active { + color: #009ee3; } + #header-top .region-header-top-left :hover ul ul a { color: black; } - #header-top .region-header-top-left :hover ul:is(.ul1 .sous-liste .ul2) a:hover { + #header-top .region-header-top-left :hover ul ul a:hover { color: #009ee3; } #header-top #block-socialnetwork-2 { position: relative; diff --git a/web/themes/custom/eql/scss/partials/_header.scss b/web/themes/custom/eql/scss/partials/_header.scss index bd06054..aa02158 100644 --- a/web/themes/custom/eql/scss/partials/_header.scss +++ b/web/themes/custom/eql/scss/partials/_header.scss @@ -78,16 +78,22 @@ list-style: none; display: flex; flex-direction: row; - // padding-left: 1rem; - // justify-content: space-between; width: 100%; - :is(.sous-liste){ + .is-active{ + color:$blue-light; + } + ul{ display: flex; flex-direction: column; padding: 1rem; + .is-active{ + color:$blue-light; + } } li{ - + display: flex; + flex-direction: column; + padding: 1rem; a { color: $black; } @@ -99,53 +105,28 @@ } } } - ul div:first-child li div{ + + ul ul { display: none; } - ul div:nth-child(2) li div{ - display: none; - } - ul:is(.ul1 .sous-liste .ul2){ - display: none; - } - :hover ul{ - div:first-child li div{ + + :hover ul{ + ul{ display: block; background-color: $white; padding: 0.2rem; + .is-active{ + color:$blue-light; + } a{ color: $black; &:hover{ color: $blue-light; - } - } - } - } - :hover ul { - div:nth-child(2) li div{ - display: block; - background-color: $white; - padding: 0.2rem; - a{ - color: $black; - &:hover{ - color: $blue-light; - } + } } } } - :hover ul:is(.ul1 .sous-liste .ul2){ - display: block; - background-color: $white; - padding: 0.2rem; - a{ - color: $black; - &:hover{ - color: $blue-light; - } - } - - } + } // reseaux sociaux diff --git a/web/themes/custom/eql/templates/partials/menu.html.twig b/web/themes/custom/eql/templates/partials/menu.html.twig deleted file mode 100644 index dce54bb..0000000 --- a/web/themes/custom/eql/templates/partials/menu.html.twig +++ /dev/null @@ -1,67 +0,0 @@ -{# -/** - * @file - * Default theme implementation to display a menu. - * - * Available variables: - * - menu_name: The machine name of the menu. - * - items: A nested list of menu items. Each menu item contains: - * - attributes: HTML attributes for the menu item. - * - below: The menu item child items. - * - title: The menu link title. - * - url: The menu link url, instance of \Drupal\Core\Url - * - localized_options: Menu link localized options. - * - is_expanded: TRUE if the link has visible children within the current - * menu tree. - * - is_collapsed: TRUE if the link has children within the current menu tree - * that are not currently visible. - * - in_active_trail: TRUE if the link is in the active trail. - * - * @ingroup themeable - */ -#} -{% import _self as menus %} -{% - set classes = [ - 'sous-liste', - ] -%} - -{% - set ulClasses = [ - 'ul1', - 'ul2' - ] -%} -{# - We call a macro which calls itself to render the full tree. - @see https://twig.symfony.com/doc/1.x/tags/macro.html -#} -{{ menus.menu_links(items, attributes, 0) }} - -{% macro menu_links(items, attributes, menu_level) %} - {% import _self as menus %} - - {% endfor %} - {# #} - - {% endif %} - -{% endmacro %}