Skip to content

Instantly share code, notes, and snippets.

@msarit
Created February 17, 2021 01:13
Show Gist options
  • Save msarit/7a6c89624754cb1f712c4cb268ecc4b7 to your computer and use it in GitHub Desktop.
Save msarit/7a6c89624754cb1f712c4cb268ecc4b7 to your computer and use it in GitHub Desktop.
// Variables
$white: #fff !default;
$gray-100: #f8f9fa !default;
$gray-200: #e9ecef !default;
$gray-600: #868e96 !default;
$gray-800: #343a40 !default;
$gray-900: #212529 !default;
$black: #000 !default;
$red: #dc3545 !default;
$yellow: #ffc107 !default;
$green: #28a745 !default;
$teal: #0085A1 !default;
$cyan: #17a2b8 !default;
$primary: $teal !default;
.current-link {
color: green;
}
a {
text-decoration: none;
}
// Styling for the masthead
header.masthead {
margin-bottom: 50px;
background: no-repeat center center;
background-color: gray;
background-attachment: scroll;
background-size: cover;
position: relative;
.page-heading,
.post-heading,
.site-heading {
padding: 200px 0 150px;
color: white;
@media only screen and (min-width: 768px) {
padding: 200px 0;
}
}
.page-heading,
.site-heading {
text-align: center;
h1 {
font-size: 50px;
margin-top: 0;
color: white;
}
.subheading {
font-size: 24px;
font-weight: 300;
line-height: 1.1;
display: block;
margin: 10px 0 0;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: white;
}
@media only screen and (min-width: 768px) {
h1 {
font-size: 80px;
}
}
}
.post-heading {
h1 {
font-size: 35px;
}
.meta,
.subheading {
line-height: 1.1;
display: block;
}
.subheading {
font-size: 24px;
font-weight: 600;
margin: 10px 0 30px;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.meta {
font-size: 20px;
font-weight: 300;
font-style: italic;
font-family: 'Lora', 'Times New Roman', serif;
a {
color: white;
}
}
@media only screen and (min-width: 768px) {
h1 {
font-size: 55px;
}
.subheading {
font-size: 30px;
}
}
}
}
// Styling for the post page
.post-preview {
> a {
color: $gray-900;
text-decoration: none;
&:focus,
&:hover {
text-decoration: none;
color: $primary;
}
> .post-title {
font-size: 30px;
margin-top: 30px;
margin-bottom: 10px;
}
> .post-subtitle {
font-weight: 300;
margin: 0 0 10px;
}
}
> .post-meta {
font-size: 18px;
font-style: italic;
margin-top: 0;
color: $gray-600;
> a {
text-decoration: none;
color: $gray-900;
&:focus,
&:hover {
text-decoration: underline;
color: $primary;
}
}
}
@media only screen and (min-width: 768px) {
> a {
> .post-title {
font-size: 36px;
}
}
}
}
// Styling for the navbar
#mainNav {
position: absolute;
border-bottom: 1px solid $gray-200;
background-color: white;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
.navbar-brand {
font-weight: 800;
color: $gray-800;
}
.navbar-toggler {
font-size: 12px;
font-weight: 800;
padding: 13px;
text-transform: uppercase;
color: $gray-800;
}
.navbar-nav {
> li.nav-item {
> a {
font-size: 12px;
font-weight: 800;
letter-spacing: 1px;
text-transform: uppercase;
}
}
}
@media only screen and (min-width: 992px) {
border-bottom: 1px solid transparent;
background: transparent;
.navbar-brand {
padding: 10px 20px;
color: $white;
&:focus,
&:hover {
color: fade-out($white, .2);
}
}
.navbar-nav {
> li.nav-item {
> a {
padding: 10px 20px;
color: $white;
&:focus,
&:hover {
color: fade-out($white, .2);
}
}
}
}
}
@media only screen and (min-width: 992px) {
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
/* Force Hardware Acceleration in WebKit */
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
&.is-fixed {
/* when the user scrolls down, we hide the header right above the viewport */
position: fixed;
top: -67px;
-webkit-transition: -webkit-transform 0.2s;
-moz-transition: -moz-transform 0.2s;
transition: transform 0.2s;
border-bottom: 1px solid darken($white, .05);
background-color: fade-out($white, .1);
.navbar-brand {
color: $gray-900;
&:focus,
&:hover {
color: $primary;
}
}
.navbar-nav {
> li.nav-item {
> a {
color: $gray-900;
&:focus,
&:hover {
color: $primary;
}
}
}
}
}
&.is-visible {
/* if the user changes the scrolling direction, we show the header */
-webkit-transform: translate3d(0, 100%, 0);
-moz-transform: translate3d(0, 100%, 0);
-ms-transform: translate3d(0, 100%, 0);
-o-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment