Header

header.css is styles for header and header navigation.

Configurations

You can change it by changing the following configurations.

  • Header Height ($header-height) : default is 60px;

Basic Structure

#header-main block set width with $content-max-width, so header has same width of main content.

Box Shadow effect

When screen scrolls to bottom and has top scroll offset, .shadow class added and appeare box-shadow effect like the following

#header {
  background-color: #f6f5f4;
  height: 60px;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  position: absolute;
  z-index: 1000;
  -webkit-transition: box-shadow 0.3s ease;
  -webkit-transition-delay: 0s;
  -moz-transition: box-shadow 0.3s ease 0s;
  -o-transition: box-shadow 0.3s ease 0s;
  transition: box-shadow 0.3s ease 0s;
}
#header.shadow {
  -webkit-box-shadow: 0 4px 4px rgba(158, 158, 158, 0.2);
  -moz-box-shadow: 0 4px 4px rgba(158, 158, 158, 0.2);
  box-shadow: 0 4px 4px rgba(158, 158, 158, 0.2);
  -webkit-transition: box-shadow 0.3s ease;
  -webkit-transition-delay: 0s;
  -moz-transition: box-shadow 0.3s ease 0s;
  -o-transition: box-shadow 0.3s ease 0s;
  transition: box-shadow 0.3s ease 0s;
}

#header-main {
  margin: 0 auto;
  padding: 10px 0;
  width: 450px;
}
#header-main nav {
  position: relative;
}

Header Title

.header-title {
  font-size: 18px;
  font-size: 1.125rem;
  line-height: 40px;
  text-align: center;
}

Header Button Base Style

when button tapped

.header-button-container {
  cursor: pointer;
  position: absolute;
  top: 0px;
}
.header-button-container.tapped .header-button {
  background-color: #ccc;
}
.header-button-container.tapped .header-button:before {
  background-color: #ccc;
}

.header-button {
  background-color: #e0e0e0;
  border: 1px solid #cccccc;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -ms-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  height: 40px;
  line-height: 38px;
  min-width: 39px;
  text-align: center;
}
.header-button a {
  width: 100%;
  display: block;
  padding: 0 5px;
}

Arrow Style (Left Side Button)

If you want to apply arrow style to the left side button, use .header-button-container-left class

when button tapped

.header-button-container-left {
  left: 0;
}
.header-button-container-left .header-button {
  border-left: 0 none transparent;
  margin-left: 14px;
  padding-left: 4px;
}
.header-button-container-left .header-button a {
  padding-right: 7px;
}
.header-button-container-left .header-button:before {
  background-color: #e0e0e0;
  border: 1px solid #cccccc;
  content: '\00a0';
  display: block;
  height: 26px;
  margin-top: 5px;
  margin-left: -16px;
  position: absolute;
  width: 26px;
  z-index: -1;
  -webkit-transform: rotateY(42deg) rotate(45deg);
  -moz-transform: rotateY(42deg) rotate(45deg);
  -ms-transform: rotateY(42deg) rotate(45deg);
  -o-transform: rotateY(42deg) rotate(45deg);
  transform: rotateY(42deg) rotate(45deg);
}

Right Side Button

.header-button-container-right class set position to right

.header-button-container-right {
  right: 0;
}

Share Button

.share-button-container class (no style though) and #share-button are for styling share button

when share button tapped

#share-button {
  display: block;
  font-size: 20px;
  line-height: 30px;
  padding: 5px 10px 5px 14px;
  text-align: center;
  width: 50px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -ms-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
}
#share-button.tapped {
  background-color: #ccc;
}

@media screen and (max-width: 450px) {
  #header #header-main {
    width: 100%;
    min-width: 320px;
  }

  .header-button-container {
    margin-left: 5px;
    margin-right: 5px;
  }
}