1
Fork 0

Make navbar look better on mobile

This commit is contained in:
Jake Howard 2016-01-08 19:05:50 +00:00
parent cb691cbea0
commit a67915b611
3 changed files with 44 additions and 32 deletions

View file

@ -14,7 +14,7 @@ export default class NavBar extends React.Component {
<Header /> <Header />
<div className="collapse navbar-collapse" id="navbar"> <div className="collapse navbar-collapse" id="navbar">
<ul className="nav navbar-nav home-button hidden-sm"> <ul className="nav navbar-nav home-button hidden-sm">
<li className="active home"><a href=""><i className="icon ion-home"></i></a></li> <Item href="" icon="ion-home" />
</ul> </ul>
<ul className="nav navbar-nav" id="navigation"> <ul className="nav navbar-nav" id="navigation">
<Dropdown title="Projects"> <Dropdown title="Projects">

View file

@ -1,3 +1,25 @@
#navigation {
@media (min-width: @screen-xs-max) {
.flexbox();
justify-content: center;
float: none;
}
& a {
.transition(~"ease-in-out .3s color");
}
& > li {
@media (min-width: @screen-md-min) {
margin-right: 23px;
}
& > a {
@media (min-width: @screen-md-min) {
padding: 15px 10px;
}
@media (max-width: @screen-xs-max) {
padding: 15px 15px;
}
}
}
.dropdown-menu { .dropdown-menu {
@media (min-width: @screen-sm) { @media (min-width: @screen-sm) {
right: auto; right: auto;
@ -17,50 +39,37 @@
.open & { .open & {
opacity: 1; opacity: 1;
} }
a {
padding-left: 20px;
}
}
} }
#navigation {
@media (min-width: @screen-xs-max) {
.flexbox();
justify-content: center;
float: none;
}
& a {
.transition(~"ease-in-out .3s color");
}
& > li {
@media (min-width: @screen-md-min) {
margin-right: 23px;
}
@media (max-width: @screen-sm-max) {
margin-right: 10px;
margin-left: 11px;
}
& > a {
@media (min-width: @screen-md-min) {
padding: 15px 10px;
}
@media (max-width: @screen-sm-max) {
padding: 15px 3px;
}
}
}
}
.navbar { .navbar {
border-radius: 0; border-radius: 0;
.home-button a {
.transition(~"ease-in-out .3s color");
}
} }
.navbar-nav.nav { .navbar-nav.nav {
margin: 0; margin: 0;
} }
.navbar-toggle {
right: 10px;
}
#navbar-container { #navbar-container {
z-index: 0; z-index: 0;
width: 96%; width: 96%;
left: 2%; left: 2%;
margin: 0; margin: 0;
z-index: 10000; z-index: 10000;
i + * {
margin-right: 5px;
}
& .container-fluid{ & .container-fluid{
padding-right: 0; padding-right: 0;
padding-left: 0; padding-left: 0;
@ -73,7 +82,8 @@
@media (max-width: @screen-sm) { @media (max-width: @screen-sm) {
position: fixed; position: fixed;
top: 0; top: 0;
width: 100%; width: 95%;
} }
} }
} }
@ -83,9 +93,11 @@
height: 52px; height: 52px;
} }
@media (min-width: @screen-xs-max) {
.home-button { .home-button {
margin-right: 15px !important; margin-right: 15px !important;
} }
}
#navbar { #navbar {
margin: 0; margin: 0;