diff --git a/sass/components/_contextual_navigation.scss b/sass/components/_contextual_navigation.scss new file mode 100644 index 000000000..54e99fafc --- /dev/null +++ b/sass/components/_contextual_navigation.scss @@ -0,0 +1,92 @@ +@use "sass:map"; +@use '@ecl/theme-dev/theme'; +@use '@ecl/vanilla-layout-grid/mixins/breakpoints'; + +$outline-width: 3px !default; + +.ecl-contextual-navigation { + display: flex; + flex-direction: column; + margin: 0; +} + +.ecl-contextual-navigation__label { + color: map.get(theme.$color, 'black-100'); + font: map.get(theme.$font, 'm'); +} + +.ecl-contextual-navigation__list { + display: flex; + flex-wrap: wrap; + list-style: none; + margin-bottom: 0; + margin-top: map.get(theme.$spacing, 's'); + padding-left: 0; +} + +.ecl-contextual-navigation__item { + border-right: 1px solid map.get(theme.$color, 'grey-50'); + display: block; + margin-right: map.get(theme.$spacing, 's'); + padding-right: map.get(theme.$spacing, 's'); +} + +.ecl-contextual-navigation__item:last-child { + border-right-width: 0; + margin-right: 0; + padding-right: 0; +} + +.ecl-contextual-navigation__item--collapsed { + display: none; + + .no-js & { + display: block; + } +} + +.ecl-contextual-navigation__item--more { + .no-js & { + display: none; + } + button.ecl-button--ghost:focus { + padding: 0; + border: 0; + outline: $outline-width solid map.get(theme.$color, 'secondary'); + } +} + +.ecl-contextual-navigation__list[aria-expanded='true'] { + .ecl-contextual-navigation__item--collapsed { + display: block; + } +} + +.ecl-contextual-navigation__more { + font-weight: map.get(theme.$font-weight, 'regular'); + line-height: 1; + padding: 0; + + &:hover { + color: map.get(theme.$color, 'black-100'); + } + + &:focus { + color: map.get(theme.$color, 'black-100'); + outline-offset: 2px; + } +} + +@include breakpoints.up('sm') { + .ecl-contextual-navigation { + flex-direction: row; + } + + .ecl-contextual-navigation__label { + margin-right: map.get(theme.$spacing, '4xl'); + } + + .ecl-contextual-navigation__list { + margin-top: 0; + } +} diff --git a/sass/components/_contextual_navigation_print.scss b/sass/components/_contextual_navigation_print.scss new file mode 100644 index 000000000..19b18f990 --- /dev/null +++ b/sass/components/_contextual_navigation_print.scss @@ -0,0 +1,30 @@ +@use "sass:map"; +@use '@ecl/theme-dev/theme'; + +.ecl-contextual-navigation { + display: flex; + flex-direction: row; + margin: 0; +} + +.ecl-contextual-navigation__label { + color: map.get(theme.$color, 'black-100'); + font: map.get(theme.$font-print, 'm'); + margin-right: map.get(theme.$spacing-print, 'xl'); +} + +.ecl-contextual-navigation__list { + display: flex; + flex-direction: column; + list-style: none; + padding-left: 0; + margin: 0; +} + +.ecl-contextual-navigation__item { + display: block; +} + +.ecl-contextual-navigation__item--more { + display: none; +} diff --git a/sass/print.scss b/sass/print.scss index 48474a34a..2bc821d1b 100644 --- a/sass/print.scss +++ b/sass/print.scss @@ -1,6 +1,3 @@ // Style adjustment for print version. -// Workaround which should be removed after the release of Webtools with https://citnet.tech.ec.europa.eu/CITnet/jira/browse/WEBTOOLS-12842. -#globan, #cookie-consent-banner { - display: none; -} +@use "./components/_contextual_navigation_print"; diff --git a/sass/style-ec.scss b/sass/style-ec.scss index 88c8e0002..c3bdee289 100644 --- a/sass/style-ec.scss +++ b/sass/style-ec.scss @@ -14,3 +14,4 @@ @use "./components/description_list"; @use "./components/media_iframe"; @use "./components/expandable"; +@use "./components/contextual_navigation"; diff --git a/sass/style-eu.scss b/sass/style-eu.scss index d0d6fabd4..b59f61b11 100644 --- a/sass/style-eu.scss +++ b/sass/style-eu.scss @@ -19,3 +19,6 @@ @use "./components/description_list"; @use "./components/media_iframe"; @use "./components/expandable"; +@use "./components/contextual_navigation" with ( + $outline-width: 2px, +); diff --git a/templates/compositions/ec-component-contextual-navigation/contextual-navigation.html.twig b/templates/compositions/ec-component-contextual-navigation/contextual-navigation.html.twig index b52e0faf3..763dcd3d2 100644 --- a/templates/compositions/ec-component-contextual-navigation/contextual-navigation.html.twig +++ b/templates/compositions/ec-component-contextual-navigation/contextual-navigation.html.twig @@ -44,9 +44,6 @@ class="{{ _css_class }}"{{ _extra_attributes|raw }} data-ecl-contextual-navigation - {# Prevent initialization for the moment #} - {# TODO: Deprecate or reinstate the component. #} - {# data-ecl-auto-init="ContextualNavigation" #} >
{{ _label }}