Files
openfoodnetwork/app/assets/stylesheets/darkswarm/menu.css.scss
2019-07-26 11:22:33 +01:00

313 lines
5.3 KiB
SCSS

@import 'compass';
@import 'branding';
@import 'mixins';
@import 'typography';
@import 'variables';
nav.top-bar {
@include textpress;
text-shadow: none;
text-align: center;
font-size: 16px;
margin-bottom: 0;
height: $topbar-height;
}
@media #{$large-only} {
.top-bar--menu-item-with-icon span {
display: none;
}
.top-bar--current-hub-prefix,
.top-bar--current-hub-name {
display: inline-block;
vertical-align: middle;
}
.top-bar--current-hub-name {
max-width: 10em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.top-bar-section ul li > a.top-bar--menu-item-with-icon {
display: inline;
}
.top-bar--menu-item-with-icon i,
.top-bar--menu-item-with-icon img {
line-height: $topbar-height;
}
.top-bar-section {
border-bottom: 1px solid $ofn-grey;
a.icon {
&:hover {
text-decoration: none;
}
> span {
display: inline-block;
font-weight: 300;
height: $topbar-height;
line-height: $topbar-height;
vertical-align: top;
}
}
// Avoid menu items blocking logo
li:not(.has-form), li:not(.has-form) a:not(.button), li:not(.has-form) a:not(.button):hover {
background-color: transparent;
}
li.cart {
background-color: #f4704c;
a span {
color: white;
}
i {
color: white;
}
.count {
position: relative;
img {
width: 32px;
height: 26px;
margin-top: 16px;
margin-right: 5px;
}
span {
background-color: white;
border-radius: 20px;
color: #f4704c;
font-size: 12px;
line-height: 18px;
position: absolute;
right: -8px;
top: 8px;
width: 18px;
}
}
}
ul.center {
display: inline-block;
// By default, we center between the left and right uls, but we want to be centered
// relative to the whole page. The difference in width between the other uls is 74px,
// so we offset by that amount here.
margin-left: -74px;
}
ul.dropdown {
border: 1px solid $smoke;
border-top: none;
}
ul.right {
> li {
border-left: 1px solid #ddd;
padding: 0 14px;
@media screen and (max-width: 1450px) {
padding: 0 6px;
}
}
li > a {
opacity: 0.8;
&:hover, &:focus, &:active {
opacity: 1;
}
i {
color: #f4704c;
display: inline-block;
margin-right: 2px;
margin-top: -3px;
vertical-align: middle;
}
img {
margin-right: 2px;
margin-top: -5px;
}
}
}
ul li > a {
font-size: 16px;
height: $topbar-height;
}
ul li.ofn-logo > a {
display: table-cell;
vertical-align: middle;
}
ul .nav-primary {
@include headingFont;
text-transform: uppercase;
font-weight: 300;
font-size: 16px;
}
.joyride-tip-guide .button {
text-shadow: none;
}
}
// Mobile Menu
.tab-bar {
background-color: white;
position: fixed;
width: 100%;
height: 2.8em;
z-index: 1;
.cart-span {
background-color: #f4704c;
padding: 13px;
a,
span {
color: white;
display: inline-block;
}
.count {
position: relative;
img {
margin-left: 2px;
width: 26px;
}
span {
background-color: white;
border-radius: 20px;
color: #f4704c;
font-size: 12px;
line-height: 16px;
position: absolute;
right: -10px;
text-align: center;
top: -9px;
width: 16px;
}
}
}
}
.off-canvas-list li.language-switcher ul li {
list-style-type: none;
padding-left: 0.5em;
}
.off-canvas-wrap.move-right .tab-bar .menu-icon {
@include box-shadow(inset 0 0 6px 2px rgba(0, 0, 0, 0.5));
}
.off-canvas-wrap .tab-bar .menu-icon {
@include box-shadow(none);
}
.off-canvas-wrap.move-right .tab-bar .menu-icon span {
box-shadow: 0 0px 0 1px #666, 0 7px 0 1px #666, 0 14px 0 1px #666;
}
.tab-bar .menu-icon span::after {
box-shadow: 0 0 0 1px black, 0 7px 0 1px black, 0 14px 0 1px black;
}
.tab-bar .ofn-logo {
padding: 9px 0 0 9px;
}
// Leave space for tab bar, in screens smaller than large.
[role="main"] {
margin-top: 2.8em;
@media #{$large-up} {
margin-top: 0;
}
}
.top-bar .ofn-logo img {
height: auto;
width: auto;
max-height: 44px;
max-width: 250px;
}
.left-off-canvas-menu {
background-color: white;
}
.off-canvas-wrap ul.off-canvas-list {
font-size: 0.875rem;
.li-menu {
@include headingFont;
font-size: 1rem;
a {
color: rgba(0, 0, 0, 0.9);
}
}
li a {
color: rgba(0, 0, 0, 0.9);
&:hover {
background-color: transparent;
color: $brand-colour;
}
}
}
.off-canvas-wrap ul.off-canvas-list i {
font-size: 1.5rem;
margin-right: 0.25rem;
}
// Responsive
@media screen and (max-width: 1450px) {
nav .top-bar-section {
ul li a,
.has-dropdown > a {
padding: 0 ($topbar-height / 8) !important;
}
ul.center {
margin-left: -24px;
}
}
}
@media screen and (min-width: 1025px) {
body.off-canvas {
// padding required to placehold for fixed menu bar
padding-top: $topbar-height;
}
}
@media screen and (max-width: 1025px) {
body.off-canvas {
// padding required to placehold for fixed menu bar
padding-top: 0;
}
}