Improve language switcher

This commit is contained in:
Pierre Rudloff 2017-06-01 10:59:37 +02:00
parent 72edcf8f78
commit f6a04458e7
2 changed files with 19 additions and 8 deletions

View file

@ -586,20 +586,26 @@ h1 {
.locales a, .locales a,
.locales a:visited { .locales a:visited {
color: #737881; color: #696969;
text-decoration: none; text-decoration: none;
} }
.supportedLocales { .supportedLocales {
background-color: #f5f5f6; background-color: #fff;
display: none;
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
opacity: 0;
padding-left: 0; padding-left: 0;
transition: visibility 0.5s;
visibility: hidden;
} }
.supportedLocales li { .supportedLocales li {
border-bottom: thin solid #ebebeb; border-bottom: thin solid #E1E1E1;
}
.supportedLocales li:last-child {
border-bottom: none;
} }
.supportedLocales li a { .supportedLocales li a {
@ -609,20 +615,25 @@ h1 {
} }
.supportedLocales li:hover { .supportedLocales li:hover {
background-color: #ECECEC; background-color: #cecece;
} }
.localesBtn { .localesBtn {
border: none;
cursor: pointer;
display: inline-block; display: inline-block;
font-size: 12px;
padding: 1em; padding: 1em;
} }
.localesBtn:focus { .localesBtn:focus {
background-color: rgb(245, 245, 246); background-color: #fff;
pointer-events: none;
} }
.localesBtn:focus + .supportedLocales { .localesBtn:focus + .supportedLocales {
display: block; opacity: 1;
visibility: visible;
} }
@media (max-width: 640px) { @media (max-width: 640px) {

View file

@ -6,7 +6,7 @@
</div> </div>
{if isset($supportedLocales)} {if isset($supportedLocales)}
<div class="locales"> <div class="locales">
<a href="#" class="localesBtn">{$locale->getCountry()->getEmoji()}</a> <button class="localesBtn" title="{t}Switch language{/t}">{$locale->getCountry()->getEmoji()}</button>
<ul class="supportedLocales"> <ul class="supportedLocales">
{foreach $supportedLocales as $supportedLocale} {foreach $supportedLocales as $supportedLocale}
{if $supportedLocale != $locale} {if $supportedLocale != $locale}