added mobile nav

This commit is contained in:
2021-07-27 10:30:54 +01:00
parent 75eec56345
commit 367ed19a70
4 changed files with 233 additions and 30 deletions
+107 -4
View File
@@ -106,6 +106,109 @@ a {
color: #fff;
box-shadow: none;
}
//nav drop down
.mobileNav {
display: none;
@media screen and (max-width: 900px) {
display: block;
position: relative;
clear: both;
margin-top: 40px;
margin-right: -10px;
.mobileMenu {
float: left;
position: relative;
}
.mobileMenu label {
background-color: black;
padding: 10px 30px;
cursor: pointer;
text-align: center;
display: block;
position: relative;
}
.mobileMenu label i {
font-style: normal;
font-size: 10px;
color: white;
position: absolute;
right: 18px;
top: 13px;
}
.mobileMenu [type="radio"] {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
margin: 0;
z-index: 1;
}
.content {
position: absolute;
top: 100%;
opacity: 0;
background: #333;
color: white;
padding: 20px 10px;
width: 140px;
right: 0px;
}
.content ul {
margin: 0;
padding: 0;
list-style: none;
}
.content a {
color: white;
display: block;
white-space: nowrap;
text-decoration: none;
border-bottom: 1px solid #999;
padding: 5px;
padding: 20px 10px;
&.govuk-header__link {
background-color: inherit;
}
}
[type="radio"]:checked ~ label {
z-index: 2;
}
[type="radio"]:checked ~ label ~ .content {
z-index: 1;
opacity: 1;
}
.close-mobileMenu {
position: absolute;
z-index: -1;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.close-mobileMenu label {
background: #333;
color: white;
}
[type="radio"]:checked ~ label ~ .close-mobileMenu {
z-index: 3;
}
}
}
.fullNav {
display: block;
@media screen and (max-width: 900px) {
display: none;
}
}
}
.header__logo {
@@ -126,10 +229,10 @@ a {
width: 22% !important;
}
nav {
// margin-top: 60px;
// margin-bottom: 40px;
}
// nav {
// // margin-top: 60px;
// // margin-bottom: 40px;
// }
.govuk-footer {
padding-top: 0px;