Skip to content

Instantly share code, notes, and snippets.

@blessed-tawanda
Created June 25, 2018 23:06
Show Gist options
  • Save blessed-tawanda/5d65280cfd496262555e5d81acb98ae7 to your computer and use it in GitHub Desktop.
Save blessed-tawanda/5d65280cfd496262555e5d81acb98ae7 to your computer and use it in GitHub Desktop.
learningSCSS
<nav>
<ul class="navigation">
<li> <a href="#">About Us</a> </li>
<li> <a href="#">Pricing</a> </li>
<li> <a href="#">Contact</a> </li>
</ul>
<div class="button">
<a href="#" class="btn-main">Sign Up</a>
<a href="#" class="btn-hot">Get A Quote</a>
</div>
</nav>
*{
margin: 0;
padding: 0;
}
$color-primary: #f9ed69; //yellow color
$color-secondary: #f08a5d; // orange
$color-tertiary: #b83b5e; // pink
$color-text-dark: #333; //grey
$width-button: 150px;
$color-text-light: #eee;
@mixin clearfix{
&::after {
content: "";
clear: both;
display: table;
}
}
@mixin style-link-text($color){
text-transform: uppercase;
text-decoration: none;
color: $color;
}
@function divide($a, $b) {
@return $a / $b;
}
nav{
// margin: 30px;
background-color: $color-primary;
@include clearfix;
}
.navigation{
list-style: none;
float: left;
li{
display: inline-block;
margin-left: divide(60, 2) * 1px;
&:first-child{
margin:0;
}
a:link{
@include style-link-text($color-text-dark);
}
}
}
.button {
float: right;
}
%btn-placeholder {
padding: 10px;
display: inline-block;
text-align: center;
border-radius: 100px;
width: $width-button;
@include style-link-text($color-text-light);
}
.btn-main{
&:link{
@extend %btn-placeholder;
background-color: $color-secondary;
}
&:hover{
background-color: darken($color-secondary, 10%);
}
}
.btn-hot{
&:link{
@extend %btn-placeholder;
background-color: $color-tertiary;
}
&:hover{
background-color: darken($color-tertiary, 10%)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment