Skip to content

Commit

Permalink
More progress on sticky bar styling
Browse files Browse the repository at this point in the history
  • Loading branch information
L8D committed Mar 15, 2016
1 parent 805d891 commit 3f23cd3
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 10 deletions.
2 changes: 2 additions & 0 deletions app/components/restaurant/menu/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ export class RestaurantMenuBarWrapperComponent extends Component {
};

window.addEventListener('scroll', this.handleScroll);
window.addEventListener('resize', this.handleScroll);
}

componentWillUnmount() {
window.removeEventListener('scroll', this.handleScroll);
window.removeEventListener('resize', this.handleScroll);
}

render() {
Expand Down
1 change: 0 additions & 1 deletion app/styles/navbar/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
display: none;
.gb-navbar-toggle {
&:extend(.gb-button-white);
&:extend(.gb-button-small);
}
}

Expand Down
19 changes: 19 additions & 0 deletions app/styles/restaurant/menu/bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,30 @@
right: 0;
background: @gb-white;
border-bottom: 1px solid @gb-shadow-tide;
height: 52px;

.gb-restaurant-menu-bar-content {
.gb-body;

position: relative;
}

.gb-restaurant-menu-tab-title-catering,
.gb-restaurant-menu-tab-title-individual {
border-top-radius: none;
border: 0;

&:before {
display: none;
}

&.active .gb-restaurant-menu-tab-title-content:after {
display: block;
}
}

.gb-restaurant-menu-searchbox {
display: none;
}
}
}
40 changes: 31 additions & 9 deletions app/styles/restaurant/menu/tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.gb-restaurant-menu-tab-title-catering,
.gb-restaurant-menu-tab-title-individual {
display: inline-block;
text-align: center;
position: relative;
background: @gb-background;
height: 52px;
Expand All @@ -23,42 +24,63 @@
@media screen and (max-width: @gb-breakpoint-tablet) {
width: 49%;
}

@media screen and (min-width: @gb-breakpoint-tablet) {
width: 26%;
max-width: 186px;
width: 180px;
}
}

.gb-menu-tab-top-color(@color) {
&::before {
&:before {
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
height: 3px;
width: 100%;
background-color: @color;
}
}

.gb-menu-tab-bottom-color(@color) {
&:after {
content: "";
position: absolute;
bottom: -1px;
left: 0;
right: 0;
height: 5px;
width: 100%;
background-color: @color;
display: none;
}
}

.gb-restaurant-menu-tab-title-catering {
.gb-menu-tab-top-color(@gb-blue);
margin-right: 2px;

.gb-restaurant-menu-tab-title-content {
.gb-menu-tab-bottom-color(@gb-blue);
}
}

.gb-restaurant-menu-tab-title-individual {
.gb-menu-tab-top-color(@gb-teal);
margin-left: 2px;

.gb-restaurant-menu-tab-title-content {
.gb-menu-tab-bottom-color(@gb-teal);
}
}

.gb-restaurant-menu-tab-title-content {
width: 96%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: inline-block;
position: relative;
text-transform: uppercase;
text-align: center;
color: @gb-shadow-shuttle-gray;
font-size: 0.89em;
font-weight: 600;
line-height: 52px;
}

0 comments on commit 3f23cd3

Please sign in to comment.