edited menu lines and view in small screens

This commit is contained in:
jorge 2024-03-12 14:20:42 +01:00
parent 2f4861857a
commit 2f3caed771
1 changed files with 56 additions and 74 deletions

View File

@ -23,40 +23,56 @@
padding-left: 1rem; padding-left: 1rem;
} }
} }
li { li {
position: relative; position: relative;
&:hover > a, &:hover > a,
&.focus > a { &.focus > a {
} }
} }
a { a {
display: flex; display: flex;
align-items: center; align-items: center;
min-height: 100%; min-height: 100%;
padding: 0 0.5rem;
text-decoration: none; text-decoration: none;
font-size: 1rem; font-size: 1rem;
} }
.current_page_item > a,
.current-menu-item > a,
.current_page_ancestor > a,
.current-menu-ancestor > a {
text-decoration: underline;
}
} }
//.main-navigation { .main-navigation {
// a[href^="http://localhost"], &.toggled {
// a[href^="http://xarxaprod.cat"], ul {
// a[href^="https://xarxaprod.cat"] display: block;
// { }
// font-family: $font__bold; .main-navigation-content {
// border-left: 1px solid $color__black; display: inline-block;
// } position: absolute;
//} top: 0;
left: 0;
width: 100%;
height: 100vh;
padding: 4rem;
background-color: rgba(255,255,255,0.95);
overflow: auto;
}
.menu-toggle {
position: relative;
z-index: 9999;
}
.current-menu-ancestor > a::after {
background-color: transparent;
}
.current-menu-item > a::after {
display: inline-block;
content: "";
position: absolute;
left: 0;
top: 2em;
height: 2px;
width: 100%;
background-color: $color__black;
}
}
}
.secondary-navigation { .secondary-navigation {
padding: 0 1em 1em 0; padding: 0 1em 1em 0;
ul { ul {
@ -69,7 +85,6 @@
text-transform: uppercase; text-transform: uppercase;
} }
} }
.menu-item-has-children { .menu-item-has-children {
} }
@ -121,25 +136,6 @@
} }
/* end of menu hidden*/ /* end of menu hidden*/
/* Small menu. */
.main-navigation.toggled {
ul {
display: block;
}
.main-navigation-content {
display: inline-block;
position: absolute;
top: 5rem;
left: 0;
width: 100%;
height: calc(100vh - 25rem);
padding: 0 3rem;
background-color: $color__white;
overflow: auto;
}
}
.menu-toggle {
}
} }
@media screen and (max-width: 47.99em) { @media screen and (max-width: 47.99em) {
.site-branding { .site-branding {
@ -167,9 +163,10 @@
.main-navigation,.secondary-navigation { .main-navigation,.secondary-navigation {
ul { ul {
display: flex; display: flex;
.menu-item-has-children > ul {
ul { background-color: rgba(255,255,255,0.95);
background-color: rgba(255,255,255,0.8); }
.sub-menu {
float: left; float: left;
position: absolute; position: absolute;
top: 100%; top: 100%;
@ -203,16 +200,15 @@
a.focus { a.focus {
} }
} }
li {
li:hover > ul, padding: 0 1em;
li.focus > ul { &:hover > ul,
left: auto; &.focus > ul {
left: auto;
}
} }
} }
a {
padding: 0 0.5rem;
}
} }
.main-navigation { .main-navigation {
padding-bottom: 1em; padding-bottom: 1em;
@ -220,31 +216,23 @@
justify-content: end; justify-content: end;
ul.sub-menu { ul.sub-menu {
flex-direction: column; flex-direction: column;
padding: 1rem; padding: 0.5rem;
li { li {
margin: 0.5rem 0; margin: 0.5rem 0;
} }
} }
} }
//a[href^="http://localhost"], .current-menu-ancestor > a::after,
//a[href^="http://xarxaprod.cat"], .current-menu-item > a::after {
//a[href^="https://xarxaprod.cat"]
//{
// font-family: $font__bold;
// border-left:none;
//}
//a[href^="http://localhost"]::after,
//a[href^="http://xarxaprod.cat"]::after,
//a[href^="https://xarxaprod.cat"]::after,
.current-menu-item a::after {
display: inline-block; display: inline-block;
content: ""; content: "";
position: absolute; position: absolute;
left: 5%; left: 1em;
bottom: -0.5em;
min-height: 2px; min-height: 2px;
height: 100%; height: 2px;
width: 90%; width: calc(100% - 2em);
margin-top: 2.3em; background-color: $color__black;
} }
.menu-item-has-children { .menu-item-has-children {
ul { ul {
@ -321,17 +309,11 @@
display:none; display:none;
} }
a { //a {
padding: 0 1rem; // padding: 0 1rem;
} //}
} }
.main-navigation { .main-navigation {
padding-bottom: 0; padding-bottom: 0;
//a[href^="http://localhost"]::after,
//a[href^="http://xarxaprod.cat"]::after,
//a[href^="https://xarxaprod.cat"]::after,
.current-menu-item a::after {
margin-top: 5em;
}
} }
} }