Skip to content

Commit

Permalink
cleans up CSS and removes duplicate .card-logo code, closes #88
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Pollak committed Jul 1, 2014
1 parent 75dd227 commit 612fa41
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 47 deletions.
27 changes: 0 additions & 27 deletions lib/css/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@
.card.amex.identified .front:after {
opacity: 1; }

.card-logo {
height: 36px;
width: 60px;
font-style: italic; }
.card-logo, .card-logo:before, .card-logo:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }

.card-logo.discover {
background: #FF6600;
color: #111;
Expand Down Expand Up @@ -156,15 +147,6 @@
-webkit-box-shadow: inset 1px 1px 3px 1px rgba(0, 0, 0, 0.5);
box-shadow: inset 1px 1px 3px 1px rgba(0, 0, 0, 0.5); }

.card-logo {
height: 36px;
width: 60px;
font-style: italic; }
.card-logo, .card-logo:before, .card-logo:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }

.card-logo.visa.visa {
background: white;
text-transform: uppercase;
Expand All @@ -189,15 +171,6 @@
.card.visa.identified .card-logo.visa {
opacity: 1; }

.card-logo {
height: 36px;
width: 60px;
font-style: italic; }
.card-logo, .card-logo:before, .card-logo:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }

.card-logo.mastercard {
color: white;
font-weight: bold;
Expand Down
12 changes: 11 additions & 1 deletion src/scss/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@

// only import a module once
// https://github.com/wilsonpage/sass-import-once
$modules: () !default;
@mixin exports($name) {
@if (index($modules, $name) == false) {
$modules: append($modules, $name);
@content;
}
}

@mixin shape() {
content: " ";
display: block;
Expand Down Expand Up @@ -66,5 +77,4 @@
linear-gradient(-25deg, $b1 50%, opacify($b1, .2) 70%, $b1 90%)
);
}

}
6 changes: 3 additions & 3 deletions src/scss/cards/_amex.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../cards/_card";
@import "../logos/_amex";
@import "card";
@import "../logos/amex";

$fill-color: #108168;

Expand All @@ -8,7 +8,7 @@ $fill-color: #108168;
&.flipped{
@include transform(none);
}

&.identified {
.front, .back {
&:before {
Expand Down
4 changes: 2 additions & 2 deletions src/scss/cards/_discover.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../cards/_card";
@import "../logos/_discover";
@import "card";
@import "../logos/discover";

$fill-color: #86B8CF;
$highlight-color: #FF6600;
Expand Down
4 changes: 2 additions & 2 deletions src/scss/cards/_mastercard.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../cards/_card";
@import "../logos/_mastercard";
@import "card";
@import "../logos/mastercard";

$fill-color: #0061A8;

Expand Down
4 changes: 2 additions & 2 deletions src/scss/cards/_visa.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../cards/_card";
@import "../logos/_visa";
@import "card";
@import "../logos/visa";

$fill-color: #191278;

Expand Down
2 changes: 1 addition & 1 deletion src/scss/logos/_amex.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "_logo";
@import "logo";

.card-logo.amex {
$box-offset: 8px;
Expand Down
2 changes: 1 addition & 1 deletion src/scss/logos/_discover.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "_logo";
@import "logo";

.card-logo.discover {
$orange: #FF6600;
Expand Down
14 changes: 8 additions & 6 deletions src/scss/logos/_logo.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
$logo-height: 36px;
$logo-width: 60px;

.card-logo {
&, &:before, &:after {
box-sizing: border-box;
@include exports("_logo.scss") {
.card-logo {
&, &:before, &:after {
box-sizing: border-box;
}
height: $logo-height;
width: $logo-width;
font-style: italic;
}
height: $logo-height;
width: $logo-width;
font-style: italic;
}
2 changes: 1 addition & 1 deletion src/scss/logos/_mastercard.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "_logo";
@import "logo";

.card-logo.mastercard {
// display: none;
Expand Down
2 changes: 1 addition & 1 deletion src/scss/logos/_visa.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "_logo";
@import "logo";

.card-logo.visa {
&.visa {
Expand Down

0 comments on commit 612fa41

Please sign in to comment.