(Chore) Sass Variables: Prefix color variables with "$color-" / Add typography variables

This commit is contained in:
0xfff 2016-09-26 02:37:19 +02:00
parent 92177218c3
commit bac1df746b
13 changed files with 159 additions and 147 deletions

View file

@ -6,10 +6,9 @@
line-height: 30px;
height: 40px;
display: inline-block;
font-family: $font-heading;
font-weight: 300;
background-color: $blue;
color: $white;
background-color: $color-blue;
color: $color-white;
box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.08), 0px 4px 6px 0px rgba(49,49,93,0.13);
transition: all .2s ease;
&:hover {
@ -25,33 +24,33 @@
.btn-white-solid {
@extend .btn;
border-color: $white;
background-color: darken($white, 3);
border-color: $color-white;
background-color: darken($color-white, 3);
margin-bottom: 10px;
color: lighten($black, 5) !important;
color: lighten($color-black, 5) !important;
text-decoration: none;
&:hover {
background-color: $white;
background-color: $color-white;
}
}
.btn-green {
@extend .btn;
background-color: $green;
background-color: $color-green;
padding: 10px 20px 10px 20px;
color: $white !important;
color: $color-white !important;
text-decoration: none;
border: none;
&:hover {
background-color: darken($green, 3);
color: $white !important;
background-color: darken($color-green, 3);
color: $color-white !important;
}
}
.btn-blue {
@extend .btn;
background-color: $blue;
color: $white !important;
background-color: $color-blue;
color: $color-white !important;
text-decoration: none;
&:hover {
}
@ -59,10 +58,10 @@
.btn-blue-solid {
@extend .btn;
background-color: $blue;
color: $white !important;
background-color: $color-blue;
color: $color-white !important;
&:hover {
background-color: lighten($blue, 3);
color: $white !important;
background-color: lighten($color-blue, 3);
color: $color-white !important;
}
}

View file

@ -1,19 +1,19 @@
// brand colors
$black: #2f2f2f;
$white: #ffffff;
$blue: #1c75bc;
$color-black: #2f2f2f;
$color-white: #ffffff;
$color-blue: #1c75bc;
// site colors
$red: #ec2227;
$green: #1dd68a;
$gray: #f0f0f0;
$dark-blue: #0b3b5a;
$gray-light: #f7f9fa;
$color-red: #ec2227;
$color-green: #1dd68a;
$color-gray: #f0f0f0;
$color-blue-dark: #0b3b5a;
$color-gray-light: #f7f9fa;
// for the style guide:
@function contrast-color($color, $dark, $light, $threshold: 50) {
@if (lightness(scale-color($color, $green: 30%, $blue: -6%, $red: 4%)) > $threshold) { // perceptual luminance http://www.workwithcolor.com/color-luminance-2233.htm
@if (lightness(scale-color($color, $color-green: 30%, $color-blue: -6%, $color-red: 4%)) > $threshold) { // perceptual luminance http://www.workwithcolor.com/color-luminance-2233.htm
@return $dark; // Lighter background, return dark color
} @else {
@return $light; // Darker background, return light color
@ -21,16 +21,16 @@ $gray-light: #f7f9fa;
}
$color:
('black', $black),
('white', $white),
('black', $color-black),
('white', $color-white),
('blue', $blue),
('red', $red),
('green', $green),
('blue', $color-blue),
('red', $color-red),
('green', $color-green),
('gray', $gray),
('dark-blue', $dark-blue),
('gray-light', $gray-light);
('gray', $color-gray),
('dark-blue', $color-blue-dark),
('gray-light', $color-gray-light);
@each $name, $bgcolor in $color {
.color__tile--#{$name}-bg {

View file

@ -22,7 +22,7 @@ footer
a {
color: $white;
color: $color-white;
line-height: 1.7;
}

View file

@ -2,7 +2,7 @@ form {
input {
font-size: 15px;
padding: 10px 5px 10px 5px;
border: 2px solid $black;
border: 2px solid $color-black;
box-sizing: border-box;
appearance: none;
}

View file

@ -1,12 +1,12 @@
#top {
border-bottom: 1px solid rgba($white, 0.35);
border-bottom: 1px solid rgba($color-white, 0.35);
margin-bottom: 20px;
}
.hero {
position: relative;
min-height: 600px;
color: $white;
color: $color-white;
&__title, &__lead, &__text {
text-shadow: 2px 2px 5px rgba(black, 0.2);
@ -22,7 +22,6 @@
}
&__lead {
font-family: $font-heading;
font-weight: 200;
font-size: 24px;
line-height: 1.25;

View file

@ -9,7 +9,7 @@ $homeSectionPaddingTop: 40px;
text-align: center;
&:nth-child(2n) {
background-color: $gray-light;
background-color: $color-gray-light;
}
.row {
@ -69,7 +69,7 @@ $homeSectionPaddingTop: 40px;
.home-architecture-graphic {
> img {
max-width: 100%;
box-shadow: -5px 0 10px $black;
box-shadow: -5px 0 10px $color-black;
border-radius: 8px 0 0 0;
}
}
@ -102,7 +102,7 @@ $homeSectionPaddingTop: 40px;
width: 819px;
height: 339px;
max-width: 150%;
background: linear-gradient(to right, $gray-light, rgba($gray-light, 0.5) 33%, rgba($gray-light, 0) 75%);
background: linear-gradient(to right, $color-gray-light, rgba($color-gray-light, 0.5) 33%, rgba($color-gray-light, 0) 75%);
}
}
}
@ -122,13 +122,13 @@ $homeSectionPaddingTop: 40px;
top: -$homeSectionPaddingTop;
bottom: -$homeSectionPaddingTop;
width: 200%;
background: linear-gradient(to left, $white 50%, rgba($white, 0) 87.5%);
background: linear-gradient(to left, $color-white 50%, rgba($color-white, 0) 87.5%);
}
}
}
.home-get-started-cta {
background-color: $blue;
background-color: $color-blue;
color: white;
padding-bottom: 0;
@ -142,7 +142,7 @@ $homeSectionPaddingTop: 40px;
}
.btn-white-solid {
color: $blue;
color: $color-blue;
}
}
@ -171,8 +171,8 @@ $homeSectionPaddingTop: 40px;
}
.news-post {
background-color: $white;
box-shadow: 0 1px 4px rgba($black, 0.25);
background-color: $color-white;
box-shadow: 0 1px 4px rgba($color-black, 0.25);
margin: 20px 0;
.news-image {
position: relative;
@ -208,11 +208,11 @@ $homeSectionPaddingTop: 40px;
}
h3 {
font-size: 18px;
color: $blue;
color: $color-blue;
line-height: 1.2;
}
.date {
color: lighten($black, 50%);
color: lighten($color-black, 50%);
font-size: 14px;
}
p {

View file

@ -1,5 +1,5 @@
#title{
background-color: rgba($blue, .1);
background-color: rgba($color-blue, .1);
margin-bottom: 40px;
h1 {
padding-top: 60px;
@ -41,7 +41,7 @@ iframe {
}
}
.divider {
border-top: 1px solid $gray;
border-top: 1px solid $color-gray;
text-align: center;
img {
width: 40px;
@ -51,7 +51,7 @@ iframe {
}
.boxed-content {
border: 1px solid $blue;
border: 1px solid $color-blue;
padding: 20px 40px 0px 30px;
margin-top: 20px;
li {
@ -66,19 +66,19 @@ iframe {
}
.downloads {
border: 2px solid $gray;
border: 2px solid $color-gray;
box-sizing: border-box;
padding: 10px;
margin-bottom: 20px;
h2 {
font-size: 16px;
text-transform: uppercase;
color: $black;
color: $color-black;
margin: 0px;
}
}
.callout-blue {
border: 2px solid $blue;
border: 2px solid $color-blue;
box-sizing: border-box;
padding: 10px;
margin-bottom: 20px;
@ -86,10 +86,10 @@ iframe {
h2 {
font-size: 64px;
margin-bottom: 20px;
color: $blue;
color: $color-blue;
}
span {
color: $blue;
color: $color-blue;
text-transform: uppercase;
font-weight: bold;
font-size: 16px;
@ -99,7 +99,7 @@ iframe {
}
.callout-green {
border: 2px solid $green;
border: 2px solid $color-green;
box-sizing: border-box;
padding: 10px;
margin-bottom: 20px;
@ -107,10 +107,10 @@ iframe {
h2 {
font-size: 64px;
margin-bottom: 20px;
color: $green;
color: $color-green;
}
span {
color: $green;
color: $color-green;
text-transform: uppercase;
font-weight: bold;
font-size: 16px;
@ -136,7 +136,7 @@ iframe {
width: 50%;
box-sizing: border-box;
padding: 0 50px;
border-right: 2px solid $gray;
border-right: 2px solid $color-gray;
img.icon {
width: 25px;
height: auto;

View file

@ -22,7 +22,7 @@ a.blog_link {
}
.background-title {
background-color: $gray;
background-color: $color-gray;
padding: 10px;
margin-top: 30px;
margin-bottom: 0;

View file

@ -1,8 +1,8 @@
body {
margin: 0;
padding: 0;
color: $black;
background-color: $white;
color: $color-black;
background-color: $color-white;
}
.content {

View file

@ -1,61 +1,62 @@
$nav-height: 90px;
.nav {
float: right;
text-align: right;
float: right;
text-align: right;
&__list {
list-style: none;
}
&__list {
list-style: none;
}
&__item {
position: relative;
display: inline-block;
text-transform: uppercase;
font-size: 14px;
letter-spacing: 0.02em;
line-height: $nav-height;
&:last-child > .nav__link {
padding-right: 0;
}
&__item {
position: relative;
display: inline-block;
font-weight: 300;
letter-spacing: 0.02em;
line-height: $nav-height;
&:last-child > .nav__link {
padding-right: 0;
}
&--languages {
& > .nav__link {
padding: 0 25px;
}
}
&--languages {
& > .nav__link {
padding: 0 25px;
}
}
&:hover {
.nav__sublist {
display: block;
opacity: 1;
animation: fadein 0.4s;
}
}
}
&:hover {
.nav__sublist {
display: block;
opacity: 1;
animation: fadein 0.4s;
}
}
}
&__sublist {
display: none;
position: absolute;
top: 100%;
right: 0;
padding-top: 10px;
}
&__sublist {
display: none;
position: absolute;
top: 100%;
right: 0;
padding-top: 10px;
}
&__subitem {
line-height: 45px;
}
&__subitem {
line-height: 45px;
}
&__link {
display: inline-block;
padding: 0 10px;
text-decoration: none;
color: rgba($white, 1);
}
&__link {
display: inline-block;
padding: 0 10px;
&, &:hover, &:visited, &:focus, &:active {
color: rgba($color-white, 1);
text-decoration: none;
}
}
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
from { opacity: 0; }
to { opacity: 1; }
}

View file

@ -49,7 +49,7 @@
opacity: .7;
}
span {
background: $white;
background: $color-white;
border: none;
height: 4px;
width: 100%;
@ -69,15 +69,15 @@
.button_container.active .top {
transform: translateY(8px) translateX(0) rotate(45deg);
background: $white;
background: $color-white;
}
.button_container.active .middle {
opacity: 0;
background: $white;
background: $color-white;
}
.button_container.active .bottom {
transform: translateY(-8px) translateX(0) rotate(-45deg);
background: $white;
background: $color-white;
}
}
@ -94,7 +94,7 @@
opacity: .7;
}
span {
background: $blue;
background: $color-blue;
border: none;
height: 4px;
width: 100%;
@ -115,20 +115,20 @@
.button_container.active .top {
transform: translateY(8px) translateX(0) rotate(45deg);
background: $blue;
background: $color-blue;
}
.button_container.active .middle {
opacity: 0;
background: $blue;
background: $color-blue;
}
.button_container.active .bottom {
transform: translateY(-8px) translateX(0) rotate(-45deg);
background: $blue;
background: $color-blue;
}
.overlay {
position: fixed;
background: $black;
background: $color-black;
top: 0;
left: 0;
width: 100%;
@ -175,7 +175,7 @@
a {
display: block;
position: relative;
color: $white;
color: $color-white;
text-decoration: none;
overflow: hidden;
padding-bottom: 15px;
@ -189,10 +189,10 @@
.sign-up-btn {
border: none;
padding: 30px;
color: $green !important;
color: $color-green !important;
&:hover {
background: none !important;
color: $green !important;
color: $color-green !important;
}
}
}

View file

@ -27,13 +27,13 @@
.component {
margin: 20px 0;
box-shadow: 5px 5px 15px -5px $black;
box-shadow: 5px 5px 15px -5px $color-black;
border-radius: 10px;
}
.component__header {
padding: 20px;
border-bottom: 1px solid lighten($black, 50%);
border-bottom: 1px solid lighten($color-black, 50%);
border-radius: 10px 10px 0 0;
}

View file

@ -4,52 +4,65 @@
// @import "fonts/open-sans/italic";
@import "fonts/montserrat/montserrat";
$font-body: 'Montserrat', 'Open Sans', Helvetica, Arial, sans-serif;
$font-heading: $font-body;
$font-family-body: 'Montserrat', 'Open Sans', Helvetica, Arial, sans-serif;
$font-family-heading: $font-family-body;
$font-size-base: 17px;
$font-size-base-plus: 19px;
$font-size-medium: 24px;
$font-size-large: 30px;
$font-size-xlarge: 40px;
$font-size-xxlarge: 80px;
$line-height-base: 1.5;
$line-height-heading: 1.1;
$font-base-size: 17px;
body {
font-family: $font-body;
font-size: ($font-base-size / 16px * 100%);
line-height: 1.5;
font-family: $font-family-body;
font-size: ($font-size-base / 16px * 100%);
line-height: $line-height-base;
font-weight: 300;
}
p {
font-size: $font-base-size;
line-height: 1.5;
a {
color: $blue;
text-decoration: none;
&:hover {
text-decoration: underline;
}
a {
color: $color-blue;
text-decoration: none;
&:hover, &:focus {
}
&:active {
}
&:visited {
color: $color-blue;
}
}
h1, h2, h3 {
font-family: $font-heading;
font-family: $font-family-heading;
line-height: $line-height-heading;
font-weight: 300;
}
h1 {
font-size: 36px;
line-height: 40px;
font-size: $font-size-xlarge;
font-weight: 300;
}
h2 {
font-size: 28px;
color: $blue;
font-size: $font-size-large;
color: $color-blue;
}
h3 {
font-size: 20px;
color: $black;
font-size: $font-size-medium;
color: $color-black;
}
a {
text-decoration: none;
color: $blue;
color: $color-blue;
}