_header.scss 5.31 KB
.header {
	background-color: $brand-color;
	color: $white;
	position: fixed;
		top: 0;
		right: 0;
		left: 0;
	z-index: $header-base;
	@include backface(hidden);
	@include clearfix();
	@include transition(background-color 0.3s $timing, box-shadow 0.15s linear);
	&.fixed,
	&.open,
	.menu-open & {
		background-color: $brand-color-dark-m;
		@include box-shadow(0 1px 10px rgba(0, 0, 0, 0.5));
	}
	// colour
		@each $color in $palette-list {
			$i: index($palette-list, $color);
			
			.page-#{$color} & {
				background-color: nth($palette-color, $i);
				&.fixed,
				&.open {
					background-color: nth($palette-color-dark-m, $i);
				}
			}
			.menu-open.page-#{$color} & {
				background-color: nth($palette-color-dark-m, $i);
			}
		}
	a {
		color: $white;
	}
	.breadcrumb {
		color: $white;
		margin-top: 0;
		margin-bottom: 0;
		max-height: ($line-height * 2);
		overflow: hidden;
		padding-right: $grid-gutter;
		padding-left: $grid-gutter;
		a,
		.a {
			text-decoration: none;
		}
		> .active {
			color: $white;
			font-weight: 300;
			> a,
			> .a {
				color: $white;
			}
		}
		// 0 - 767
			@include responsive("(max-width: #{$screen-sm - 1})") {
				> li {
					display: none;
				}
				> .active {
					display: block;
					&:before {
						display: none;
					}
				}
			}
	}
	.dropdown-menu {
		border-radius: 2px;
		a {
			color: $black-text;
		}
	}
	.dropdown-toggle {
		z-index: 1;
		&:after {
			background-color: $brand-color;
			border-radius: 50%;
			content: "";
			display: block;
			height: ($line-height * 1.5);
			position: absolute;
				top: ($line-height * 0.25);
				right: ($line-height * 0.25);
				bottom: ($line-height * 0.25);
				left: ($line-height * 0.25);
			z-index: -1;
			@include transform(scale(0));
			@include transition(all 0.3s $timing);
			-webkit-transition-property: background-color, -webkit-transform;
			        transition-property: background-color, transform;
			// colour
				@each $color in $palette-list {
					$i: index($palette-list, $color);
					
					.page-#{$color} & {
						background-color: nth($palette-color, $i);
					}
				}
			// no csstransforms
				.no-csstransforms & {
					display: none;
				}
		}
	}
	.dropdown.open .dropdown-toggle {
		background-color: transparent;
		&:after {
			@include transform(scale(1));
			// no csstransforms
				.no-csstransforms & {
					display: block;
				}
		}
	}
	.nav {
		margin: 0;
		> li {
			> a {
				.avatar,
				.fa,
				.icon {
					@include transition(all 0.3s $timing);
					-webkit-transition-property: opacity, -webkit-transform;
					        transition-property: opacity, transform;
				}
				.header-close {
					position: absolute;
						top: ($line-height / 2 + ($line-height - $font-size) / 2);
						left: 0;
					text-align: center;
					width: 100%;
					@include opacity(0);
					@include transform(rotate(-225deg));
					&:after {
						background-color: $brand-color;
						border-radius: 50%;
						content: "";
						display: block;
						height: ($line-height * 1.5);
						margin-top: ($line-height * -0.75);
						margin-left: ($line-height * -0.75);
						position: absolute;
							top: 50%;
							left: 50%;
						width: ($line-height * 1.5);
						@include transform(scale(0));
						@include transition(all 0.3s $timing);
						-webkit-transition-property: -webkit-transform;
						        transition-property: transform;
						@each $color in $palette-list {
							$i: index($palette-list, $color);
							
							.page-#{$color} & {
								background-color: nth($palette-color, $i);
							}
						}
					}
					&:before {
						position: relative;
						z-index: 1;
					}
				}
			}
			&.active > a {
				.avatar,
				.fa,
				.icon {
					@include opacity(0);
					@include transform(rotate(225deg));
				}
				.header-close {
					@include opacity(1);
					@include transform(rotate(0));
					&:after {
						@include transform(scale(1));
					}
				}
			}
		}
	}
}

.header-btn {
	display: block;
	float: left;
	height: ($line-height * 2);
	padding: (($line-height * 2 - $line-height-h4) / 2) $grid-gutter;
	text-align: center;
	&:focus,
	&:hover {
		text-decoration: none;
	}
}

.header-fix-hide {
	.header.fixed & {
		display: none !important;
	}
}

.header-fix-show {
	display: none !important;
	.header.fixed & {
		display: block !important;
	}
}

.header-logo,
.header-text {
	display: block;
	float: left;
	font-weight: 300;
	height: ($line-height * 2);
	line-height: $line-height-h4;
	margin: 0;
	padding: (($line-height * 2 - $line-height-h4) / 2) $grid-gutter;
	&:focus,
	&:hover {
		text-decoration: none;
	}
}

.header-logo {
	font-size: $font-size-h4;
	img {
		display: block;
		max-height: $line-height-h4;
		width: auto;
	}
}

.header-nav-scroll {
	height: ($line-height * 2);
	overflow: hidden;
	position: relative;
	&.pull-down {
		position: absolute;
			top: 100%;
			left: 0;
		width: 100%;
		@include transition(opacity 0.15s $timing 0.15s, top 0.3s $timing);
		.header.fixed &,
		.header.open &,
		.menu-open & {
			// position
				top: 0;
			z-index: -1;
			@include opacity(0);
			@include transition(opacity 0.15s $timing, top 0.3s $timing);
		}
	}
}

.header-nav-wrap {
	height: 150%;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: $line-height;
	position: absolute;
		top: 0;
		left: 0;
	white-space: nowrap;
	width: 100%;
	-webkit-overflow-scrolling: touch;
	-ms-overflow-style: none;
	.nav > li {
		display: inline-block;
		float: none;
	}
}