diff --git a/themes/finna2/scss/finna/browsebar.scss b/themes/finna2/scss/finna/browsebar.scss index 7ed37e2638b..c42812fb7ec 100644 --- a/themes/finna2/scss/finna/browsebar.scss +++ b/themes/finna2/scss/finna/browsebar.scss @@ -7,7 +7,7 @@ } .browsebar .nav>li .iconlabel:before, .browsebar .nav-dropdown-label.iconlabel:before, -.browsebar .dropdown-menu a.iconlabel:before{ +.browsebar .dropdown-menu a.iconlabel:before { vertical-align: center; font-size: 1.3em; margin-right: 0.5em; @@ -32,7 +32,7 @@ .navbar-nav { margin: 0; - & > li > a { + > li > a { color: $finna-browsebar-link-color; padding-left: 5px; padding-right: 5px; diff --git a/themes/finna2/scss/finna/mylist.scss b/themes/finna2/scss/finna/mylist.scss index aeef3fc32d6..2dbbc84546b 100644 --- a/themes/finna2/scss/finna/mylist.scss +++ b/themes/finna2/scss/finna/mylist.scss @@ -52,7 +52,7 @@ .active a { font-weight: 600; text-decoration: none; - color: $dropdown-link-color;; + color: $dropdown-link-color; background-color: $gray-ultralight; } > li { @@ -477,11 +477,6 @@ span.caret { .sidebar.open { margin-top: 0px; } - .dropdown-menu { - border: none; - border-radius: none; - margin: 0; - } } .mylist-header { diff --git a/themes/finna2/scss/finna/myresearch.scss b/themes/finna2/scss/finna/myresearch.scss index 107c27e5ae8..39c5c0b136d 100644 --- a/themes/finna2/scss/finna/myresearch.scss +++ b/themes/finna2/scss/finna/myresearch.scss @@ -846,7 +846,8 @@ form#renewals, form#update_holds, form#purge_history { } // Menu style -.myresearch-menu, #my-info-dropdown-menu { +.myresearch-menu, +#my-info-dropdown-menu { a { display: flex; justify-content: space-between; @@ -854,7 +855,7 @@ form#renewals, form#update_holds, form#purge_history { display: flex; } &:hover { - background-color: $gray-lighter; + background-color: $dropdown-link-hover-bg; text-decoration: none; } &:focus { @@ -871,7 +872,8 @@ form#renewals, form#update_holds, form#purge_history { } // Status badges -.myresearch-menu, #my-info-dropdown-menu { +.myresearch-menu, +#my-info-dropdown-menu { .status { float: right; .badge { diff --git a/themes/finna2/scss/finna/navigation.scss b/themes/finna2/scss/finna/navigation.scss index 3570e53f23f..9b49c55342c 100644 --- a/themes/finna2/scss/finna/navigation.scss +++ b/themes/finna2/scss/finna/navigation.scss @@ -1,216 +1,223 @@ -.swipe-arrow-navigation { - position: fixed; - width: 50px; - height: 50px; - background: $link-color; - top: 50%; - color: $body-bg; - border-radius: 50%; - &.arrow-navigation-left { - left: 0px; - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; - } - &.arrow-navigation-right { - right: 0px; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px - } - .fa-arrow-right, .fa-arrow-left { - color: $body-bg; - top: 10px; - left: 8px; - position: absolute; - font-size: 30px; - } +header { + position: relative; + z-index: $zindex-header; + box-shadow : 0 1px 0 1px rgba(0,0,0,0.1); } +.finna-navbar { + .nav-item > .nav-link { + display: flex; + align-items: center; + gap: 0.25rem; + --#{$prefix}nav-link-color: #{$header-text-color}; + --#{$prefix}nav-link-hover-color: #{$header-text-hover-color}; + --#{$prefix}navbar-active-color: #{$header-text-active-color}; + } +} @include media-breakpoint-down(md) { .finna-navbar { min-height: 64px; - .nav > li > a { - padding-left: 6px; padding-right: 6px; + padding-left: 6px; } } } +/* Mobile navbar */ +@media (max-width: $grid-float-breakpoint-max) { + .finna-navbar { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 100; + background-color: $header-background-color; + border-width: 0 0 1px; + box-shadow: 0 0 3px 3px rgba(0,0,0,0.1); -// fix navbar for logoutoptions -.finna-navbar .navbar-nav .logoutOptions { - @include media-breakpoint-down(sm) { - margin: 0; - } - .dropdown-menu { - left: auto; - > li { - > a { - width: 250px; - .icon { - padding-top: 3px; + .navbar-collapse { + &.show { + max-height: calc(100vh - #{#{$navbar-height}}); + overflow: auto; + box-shadow: 0 3px 5px $gray; + } + .dropdown-toggle { + width: 100%; + } + .navbar-nav .nav-item { + border-bottom: 1px solid $gray-lighter; + &:last-child, + .dropdown-menu li { + border-bottom: none; + } + } + .dropdown-menu { + box-shadow: none; + .dropdown-item { + padding-right: 16px; + padding-left: 16px; } } - } - @include media-breakpoint-down(xs) { - right: -30px; } } - .username { - display: inline-block; - max-width: 150px; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - vertical-align: top; - @include media-breakpoint-down(md) { - max-width: 80px; - } - @include media-breakpoint-down(xs) { - @include visually-hidden(); - } +} + +.header-navbar-right { + // This is required for proper positioning of dropdown menus: + position: relative; + + display: flex; + flex-direction: row; + align-items: baseline; + + // Counter the responsive menu behavior for non-expandable items: + .dropdown-menu { + position: absolute; } - .description { - font-size: 0.9em; - line-height: 1.2em; + + .logoutOptions, + #loginOptions { + position: relative; + padding-right: 12px; + } +} +@include media-breakpoint-down(md) { + .header-navbar-right { + position: absolute; + top: 0; + right: $navbar-right; + display: flex; + align-items: center; + height: $navbar-height; } } -@media(max-width: $grid-float-breakpoint) { - #loginOptions button { - background-color: $body-bg; - a { - color: $action-link-color; +#language_menu { + #language_menu_dropdown_button { + &:active { + box-shadow: none; } } + .lang-icon { + font-size: 1.2em; + line-height: 1.1em; + color: $action-link-color; + } + .active { + font-weight: bold; + } +} - .finna-navbar .navbar-collapse { - .dropdown-toggle { - width: 100%; +.finna-navbar .navbar-nav { + .logoutOptions, + #loginOptions { + .my-account-icon { + font-size: 1.2em; + color: $action-link-color; } - & > ul > li { - border-bottom: 1px solid $gray-lighter; + .login-icon { + font-size: 1.2em; } + } + // fix navbar for .logoutOptions + .logoutOptions { .dropdown-menu { - border: 0; - box-shadow: none; - margin-top: 0; - - & > li { - border-bottom: none; + left: auto; + > li > a { + width: 250px; + .icon { + padding-top: 3px; + } + } + } + .username { + display: inline-block; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: top; + } + } +} +@include media-breakpoint-down(xs) { + .finna-navbar .navbar-nav { + .login-text { + display: inherit; + } + #loginOptions .login-text, + .logoutOptions .login-text { + display: none; + } + .logoutOptions { + .dropdown-menu { + right: -30px; } - .dropdown-item { - border: 0; - padding-left: 16px; - padding-right: 16px; + .username { + @include visually-hidden(); } } } } - -// content-navigation-menu -.main.template-dir-content.template-name-content .content-navigation-menu { - margin: 20px 0px; +@include media-breakpoint-down(md) { + .finna-navbar .navbar-nav .logoutOptions .username { + max-width: 80px; + } } .finna-navbar { - // #loginOptions.btn-uppercase included for back-compatibility - .login-button, #loginOptions .btn-uppercase { + // #loginOptions .btn-uppercase included for back-compatibility + .login-button, + #loginOptions .btn-uppercase { display: block; text-transform: uppercase; } - .nav-item > .nav-link { - display: flex; - align-items: center; - gap: 0.25rem; - --#{$prefix}nav-link-color: #{$header-text-color}; - --#{$prefix}nav-link-hover-color: #{$header-text-hover-color}; - --#{$prefix}navbar-active-color: #{$header-text-active-color}; - } - .dropdown-menu > li > .dropdown-item.active:not(:hover) { - font-weight: bold; - color: var(--#{$prefix}dropdown-link-color); - background-color: var(--#{$prefix}dropdown-link-bg); - } } -/* Finna breadcrumbs */ - -.breadcrumbs { - background-color: $breadcrumb-bg; - display: none; -} -.template-name-cites, .template-name-citedby { - .breadcrumbs { - display: block; - font-weight: 600; - .breadcrumb { - padding-left: 0; +#my-info-dropdown-menu { + width: 280px; + > li a { + width: 100%; + .sign-out-icon { + font-size: 1.2em; + line-height: 1em; } } -} -/* #SCSS> */ -@if ($breadcrumbs == true) { - .breadcrumbs { - display: block; + > li:last-child > a, + li:last-child { + border-bottom: none; } -} -/* <#SCSS */ - -.breadcrumb { - border-radius: 0; - margin-bottom: 0; -} - -/* End of Finna breadcrumbs */ - -#my-info-dropdown-menu { - width: 280px; - background-color: $body-bg; - @include box-shadow(0 6px 12px rgba(0, 0, 0, .275)); - .card-selection { - @include media-breakpoint-down(md) { - overflow-y: auto; - overflow-x: hidden; - height: 100%; - max-height: 200px; - } - p { - padding-left: 15px; - margin-bottom: 0px; - } - #select-card-label-dropdown { - display: none; - } .library-card { display: flex; flex-direction: row; + min-height: 35px; padding: 0 15px; - white-space: wrap; word-wrap: anywhere; - min-height: 35px; + white-space: wrap; .selected-icon { - padding-right: 15px; width: 10px; align-self: center; + padding-right: 15px; color: $primary; } - > a, .barcode-container { + .card-name span { + display: inline-flex; + align-items: center; + line-height: 1.5; + } + > a, + .barcode-container { border-bottom: 1px solid $gray-lighter; color: $text-color; span { padding: 3px 0px; } } - .card-name span { - display: inline-flex; - line-height: 1.5; - align-items: center; - } .barcode-container { - height: auto; display: flex; align-items: center; + height: auto; width: 20%; a { justify-content: center; @@ -218,140 +225,57 @@ .barcode-icon { margin-left: 0; color: $text-color; - font-size: 20px; + font-size: $font-size-icon-large; } } } - > :last-child a, > :last-child .barcode-container { - border-bottom: 0; + > :last-child a, + > :last-child .barcode-container { + border-bottom: none; } > a { justify-content: left; } - > a:not(.card-header) { - padding-left: 2rem; - } - .icon { - color: $primary; - } - } - > li { - border-bottom: 1px solid $gray-lighter; - cursor: pointer; - - > ul { - line-height: 20px; - > li > a { - text-indent: 5%; - li { - height: 25px; - } - } - } - a { - width: 100%; - &:hover { - text-decoration: none; - } - .sign-out-icon { - font-size: 1.2em; - line-height: 1em; - } - } } - - > li:last-child > a, li:last-child { - border-bottom: none; +} +@include media-breakpoint-down(md) { + .card-selection { + height: 100%; + max-height: 200px; + overflow-x: hidden; + overflow-y: auto; } } -// Default styling of Finna Jump menus -.jumpMenuForm { - height: 38px; - label { - font-weight: normal; - margin-left: 10px; - } +/* Finna breadcrumbs */ + +.breadcrumbs { + display: none; + background-color: $breadcrumb-bg; } -.jump-menu-style { - padding: 0; - position: relative; - width: auto; - z-index: 1; - display: inline-block; - min-width: 60px; - select { - background-color: transparent; - border: 0 none; - box-shadow: none; +.breadcrumb { + margin-bottom: 0; + background-color: transparent; + border-radius: 0; +} +.template-name-cites, +.template-name-citedby { + .breadcrumbs { display: block; - font-size: 100%; font-weight: 600; - line-height: 1em; - margin: 0; - width: 100%; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - &:focus { - outline: none; - box-shadow: none; - } - } - option { - background: $body-bg; - color: $gray; - padding: 5px; - &:hover { - background-color: $gray-light; - } } - - &:before { +} +/* #SCSS> */ +@if ($breadcrumbs == true) { + .breadcrumbs { display: block; - font-size: 1em; - height: 100%; - padding: 0 20px 0px 2px; - position: absolute; - top: 0; - right: 0px; - text-align: center; - width: 1em; - z-index: -1; - } - &.controls { - border-radius: $finna-button-radius; - background-color: $primary; - padding-top: 0px; - transition: background-color .1s linear; - option:checked { - background: $btn-primary-bg; - color: $body-bg; - } - } - &.controls:before { - transition: background-color .1s linear; - background: $btn-primary-bg; - border-top-right-radius: 10px; - border-bottom-right-radius: 10px; - color: $body-bg; - line-height: 40px; - } - &.disabled { - @include opacity(0.5); } } -.jump-menu-style select::-ms-expand { - display: none; /* to ie 10 */ -} -:-moz-any(.prefilter-select,.jump-menu-style.controls):before { - background-color: $body-bg; /* this is necessary for overcome the caret default browser */ - pointer-events: none; /* https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events */ - z-index: 1; /* this is necessary for overcome the pseudo element */ -} +/* <#SCSS */ -header { - box-shadow : 0 1px 0 1px rgba(0,0,0,0.1); - z-index: $zindex-header; - position: relative; +/* End of Finna breadcrumbs */ + +// content-navigation-menu +.main.template-dir-content.template-name-content .content-navigation-menu { + margin: 20px 0px; } diff --git a/themes/finna2/scss/global/dropdowns-bootstrap.scss b/themes/finna2/scss/global/dropdowns-bootstrap.scss index 1bebe83fd6e..51d117901a8 100644 --- a/themes/finna2/scss/global/dropdowns-bootstrap.scss +++ b/themes/finna2/scss/global/dropdowns-bootstrap.scss @@ -22,13 +22,13 @@ > li { border-bottom: 1px solid $gray-lighter; - } - > li:last-child > a, li:last-child { - border-bottom: none; - } - - > li > a { - padding: 7px 15px; + &:last-child > a, + &:last-child { + border-bottom: none; + } + > a { + padding: 7px 15px; + } } } diff --git a/themes/finna2/scss/global/navbar-bootstrap.scss b/themes/finna2/scss/global/navbar-bootstrap.scss index 09e1a88f991..cd603226cbd 100644 --- a/themes/finna2/scss/global/navbar-bootstrap.scss +++ b/themes/finna2/scss/global/navbar-bootstrap.scss @@ -1,93 +1,111 @@ .navbar { max-width: map-get($container-max-widths, "xl"); // dont fully scale the navigation bar text min-height: $navbar-height; +} +.navbar li .dropdown-menu > li > a { + white-space: normal; +} +// Fix dropdowns in navbar for wide screen +@include media-breakpoint-up(md) { + .navbar li:not(#language_menu) .dropdown-menu > li > a { + width: 280px; + } +} +.navbar-nav { + margin: calc((#{$navbar-padding-vertical} / 2) - #{$navbar-padding-horizontal}); + > li { + > a { + font-size: $navbar-font-size; + } + > .dropdown-menu { + margin-top: 0; + } + } .collapse-open-icon { font-size: $font-size-icon-tiny; - vertical-align: middle; } - .logoutOptions, #loginOptions { - .my-account-icon { - font-size: 1.2em; - color: $action-link-color; - } - .login-icon { - font-size: 1.2em; - } - .login-text { - @include media-breakpoint-down(xs) { - display: none; - } - } +} +@include media-breakpoint-down(sm) { + .navbar-nav { + margin: 0; } - .login-text { - @include media-breakpoint-down(xs) { - display: inherit; +} + +.navbar-header .navbar-brand { + display: flex; + align-items: center; + max-width: 150px; + padding: 0; + .navbar-logo { + width: auto; + height: $navbar-logo-height; + margin-right: 10px; + font-size: $navbar-logo-height; + color: $logo-color; + object-fit: contain; + } +} +@media (max-width: $grid-float-breakpoint-max) { + .navbar-header { + padding-left: 10px; + .navbar-brand { + min-height: $navbar-height; } } } .navbar .navbar-main { - .dropdown .dropdown-menu > li > a > *:not(.description) { + .dropdown .dropdown-menu > li > a > :not(.description) { font-weight: bold; } .dropdown .dropdown-menu > li > a > .description { - font-size: .9em; display: block; width: 100%; + font-size: 0.9em; white-space: normal; } } +@media (max-width: $grid-float-breakpoint-max) { + .navbar .navbar-main .dropdown-menu { + border: none; + } +} .navbar-collapse { border-top: 3px solid $primary; - @media (min-width: $grid-float-breakpoint) { - border-top: 0; +} +@media (min-width: $grid-float-breakpoint) { + .navbar-collapse { + border-top: none; box-shadow: none; } } - -.navbar-brand { - padding: 0; -// line-height: $navbar-height; - max-width: 150px; - display: flex; - align-items: center; - - @include media-breakpoint-down(md) { - min-height: 64px; - - } - - .navbar-logo { - font-size: $navbar-logo-height; - color: $logo-color; - } - img { - object-fit: contain; - height: $navbar-logo-height; - width: auto; +@include media-breakpoint-down(sm) { + #header-collapse { + padding-right: 0px; + padding-left: 0px; } } .navbar-toggler { position: absolute; - z-index: 30; top: 0; right: 0; - height: $navbar-height; + z-index: 30; width: $navbar-height; - margin:0; + height: $navbar-height; + padding: 0; + margin: 0; color: $btn-primary-color; background-color: $primary; - padding: 0; border-radius: 0; &:focus { background: darken($primary, 10%); } - .mobilemenu-bars, .mobilemenu-close { + .mobilemenu-bars, + .mobilemenu-close { font-size: 24px; - cursor: pointer; } &.collapsed .mobilemenu-close { display: none; @@ -105,240 +123,18 @@ } } +// Login button in mobile menu .navbar-nav { - margin: calc((#{$navbar-padding-vertical} / 2) - #{$navbar-padding-horizontal}); - - > li > a { - font-size: $navbar-font-size; - } - &.language:not(.lang-1):before { - color: $navbar-default-link-color; - content: ''; - height: (($navbar-height) - 24); - margin-top: calc((#{$navbar-height} - (#{$navbar-height} - 24px)) / 2); - - @media (min-width: $grid-float-breakpoint) { - border-left: solid 1px $navbar-default-link-color; - } - } - &.lang-1 { - margin-left: 10px; - } - @media (max-width: $grid-float-breakpoint-max) { - &.lang-1 { - margin-left: -15px; - border-top: 1px solid #000; - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); - &:before { - border-left: none; - } - } - // Dropdowns get custom display when collapsed - .open:not(.logoutOptions):not(.browsebar-dropdown):not(#language_menu) .dropdown-menu { - position: static; - float: none; - width: auto; - margin-top: 0; - background-color: transparent; - border: 0; - box-shadow: none; - transition: background-color 0.2s ease-in-out; - padding: 0; - > li > a, - .dropdown-header { - padding: 5px 15px 5px 25px; - } - > li { - border-bottom: none; - &:first-child, &:last-child, &:first-child > a, &:last-child > a { - @include border-top-radius(0px); - @include border-bottom-radius(0px); - } - } - > li > a { - line-height: $line-height-computed; - white-space: normal; - &:hover, - &:focus { - background-image: none; - background-color: $nav-link-hover-bg; - } - } - } - .open .dropdown-menu { - position: absolute; - float: left; - width: initial; - margin-top: 0; - background-color: $dropdown-bg; - border: 1px solid $dropdown-fallback-border; // IE8 fallback - border: 1px solid $dropdown-border; - border-radius: $border-radius-base; - @include box-shadow(0 6px 12px rgba(0,0,0,.275)); - > li > a, - .dropdown-header { - padding: 5px 15px 5px 25px; - } - > li > a { - padding: 7px 15px; - line-height: $line-height-computed; - &:hover, - &:focus, - &:active { - text-decoration: none; - color: $dropdown-link-hover-color; - background-color: $dropdown-link-hover-bg; - } - } - } - } -} - -.navbar-nav { - @include media-breakpoint-down(sm) { - margin: 0; - } -} - -.navbar-nav > li { - float: none; -} - -.navbar-nav.nav-login { - border-top: 1px solid $gray-lighter; - display: none; - line-height: 64px; - text-align: center; -} - -.navbar-nav>li>.dropdown-menu { - margin-top: -5px; -} - -// Menu position and menu carets -.navbar-nav > li > .dropdown-menu { - @include border-top-radius($border-radius-base); -} - -// Fix dropdowns in navbar for wide screen -@include media-breakpoint-up(md) { - .navbar li:not(#language_menu) .dropdown-menu > li > a { - width: 280px; - white-space: normal; - transition: none; - } -} -#language_menu { - #language_menu_dropdown_button { - padding-top: #{$btn-padding-y}; - padding-bottom: #{$btn-padding-y}; - - &:active { - box-shadow: none; - } - } - .dropdown-menu { - margin: 0; - background-color: $navbar-default-bg; - } - .lang-icon { - font-size: 1.2em; - color: $action-link-color; - } - .active { - font-weight: bold; + .nav-login { + line-height: 64px; + text-align: center; } -} -#language_menu.open { - .dropdown-menu { - position: absolute; - } - a.preserve-anchor { - width: 100%; - } -} -.header-navbar-right { - display: flex; - flex-direction: row; - align-items: baseline; - // This is required for proper positioning of dropdown menus: - position: relative; - - // Counter the responsive menu behavior for non-expandable items: - .dropdown-menu { - position: absolute; - } - - div.logoutOptions a:active { - box-shadow: none; - } - div.logoutOptions, #loginOptions { - padding-right: 12px; - position: relative; - } - - @include media-breakpoint-down(md) { - position: absolute; - top: 0; - display: flex; - align-items: center; - height: $navbar-height; - right: $navbar-right; - - div.logoutOptions, #loginOptions { - margin-top: 0; - } - .dropdown-menu { - margin-top: 1rem; - - > li > a { - white-space: normal; - } - } + > li.nav-login { + border-bottom: none; } } - -/* Mobile navbar */ -@media(max-width: $grid-float-breakpoint-max) { - .finna-navbar { - position: fixed; - right: 0; - left: 0; - z-index: 100; - top: 0; - border-width: 0 0 1px; - background-color: $header-background-color; - box-shadow: 0 0 3px 3px rgba(0,0,0,0.1); - - .navbar-collapse > ul > li { - border-bottom: 1px solid $gray-lighter; - } - .navbar-nav > li.nav-login { - border-bottom: none; - } - .navbar-nav.nav-login { - border-top: none; - display: inherit; - } - } - .navbar-collapse.show { - box-shadow: 0 3px 5px $gray; - max-height: calc(100vh - #{#{$navbar-height}}); - overflow: scroll; - } - .navbar-header { - padding-left: 10px; - } -} - -@include media-breakpoint-down(sm) { - #header-collapse { - padding-left: 0; - padding-right: 0; +@media (min-width: $grid-float-breakpoint-max) { + .navbar-nav.nav-login { + display: none; } } - -.navbar .navbar-logo { - height: $navbar-logo-height; - margin-right: 10px; -} diff --git a/themes/finna2/templates/librarycards/selectcard.phtml b/themes/finna2/templates/librarycards/selectcard.phtml index 29204747349..f08c70b84c4 100644 --- a/themes/finna2/templates/librarycards/selectcard.phtml +++ b/themes/finna2/templates/librarycards/selectcard.phtml @@ -4,11 +4,11 @@ if (count($cards) > ($this->limit ?? 1)): ?> ils()->checkCapability('getLoginDrivers') ? count($this->ils()->getLoginDrivers()) : 1; ?> -
  • +
  • transEsc($this->label ?? 'Kirjastokortti') ?> - +