Skip to content

Commit

Permalink
Merge pull request #13 from LukyVj/master
Browse files Browse the repository at this point in the history
Fix #12
  • Loading branch information
LukyVj committed Jan 3, 2016
2 parents ba5d2dc + dfabfa3 commit c685d5f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 53 deletions.
4 changes: 4 additions & 0 deletions README.md
@@ -1,7 +1,11 @@
# colofilter.css
Colofilter.css - Duotone filters made with CSS !

More info at [http://lukyvj.github.io/colofilter.css](http://lukyvj.github.io/colofilter.css)

## Codepen demo
You can check this codepen collection using colofilter.css : [http://codepen.io/collection/AGpJpm/](http://codepen.io/collection/AGpJpm/)

---
![](https://github.com/LukyVj/colofilter.css/raw/master/filters.png)

31 changes: 12 additions & 19 deletions styles/colofilter.css
@@ -1,4 +1,3 @@
@charset "UTF-8";
[class^="blend"] img {
mix-blend-mode: luminosity;
}
Expand Down Expand Up @@ -54,6 +53,8 @@
}
[class^="blend"][class*="-red"]:after {
background: #E50914;
}
[class^="blend"][class*="-red"]:after {
background: #282581;
}
[class^="blend"][class*="-orange"] {
Expand Down Expand Up @@ -83,6 +84,8 @@
}
[class^="blend"][class*="-blue"]:after {
background: #0066BF;
}
[class^="blend"][class*="-blue"]:after {
background: #93EF90;
}
[class^="blend"][class*="-yellow"] {
Expand All @@ -108,6 +111,8 @@
}
[class^="blend"][class*="-yellow"]:after {
background: #FEDD31;
}
[class^="blend"][class*="-yellow"]:after {
background: #EF3CB4;
}
[class^="blend"][class*="-purple"] {
Expand All @@ -134,6 +139,8 @@
}
[class^="blend"][class*="-purple"]:after {
background: #BC6D14;
}
[class^="blend"][class*="-purple"]:after {
background: #ACFCEE;
}
[class^="blend"][class*="-green"] {
Expand All @@ -149,6 +156,8 @@
}
[class^="blend"][class*="-green"]:after {
background: #11C966;
}
[class^="blend"][class*="-green"]:after {
background: #2D3181;
}
[class^="blend"][class*="-pink"] {
Expand All @@ -165,10 +174,9 @@
}
[class^="blend"][class*="-pink"]:after {
background: #EA4C89;
background: #EA4C89;
}
[class^="blend"][class*="-blue-yellow"] {
background:  ;
[class^="blend"][class*="-pink"]:after {
background: #EA4C89;
}
[class^="blend"][class*="-blue-yellow"]:not([class*="-dark"]):not([class*="-light"]) {
background: linear-gradient(to top left, #55ACEE, #FEDD31);
Expand All @@ -182,12 +190,8 @@
filter: none;
}
[class^="blend"][class*="-blue-yellow"]:after {
background:  ;
background: linear-gradient(to top left, #55ACEE, #FEDD31) !important;
}
[class^="blend"][class*="-pink-yellow"] {
background:  ;
}
[class^="blend"][class*="-pink-yellow"]:not([class*="-dark"]):not([class*="-light"]) {
background: linear-gradient(to bottom right, #FAA6FB, #FBBC05) !important;
}
Expand All @@ -202,12 +206,8 @@
filter: none !important;
}
[class^="blend"][class*="-pink-yellow"]:after {
background:  ;
background: linear-gradient(to top left, #FAA6FB, #FBBC05) !important;
}
[class^="blend"][class*="-red-blue"] {
background:  ;
}
[class^="blend"][class*="-red-blue"]:not([class*="-dark"]):not([class*="-light"]) {
background: linear-gradient(to bottom right, #3993E2, #E2544B);
}
Expand All @@ -227,12 +227,5 @@
filter: saturate(300%) brightness(1.2) !important;
}
[class^="blend"][class*="-red-blue"]:after {
background:  ;
background: linear-gradient(to bottom right, #3993E2, #E2544B);
}
[class^="blend"][class*="-lime"] {
background:  ;
}
[class^="blend"][class*="-lime"]:after {
background:  ;
}
35 changes: 25 additions & 10 deletions styles/colofilter.scss
@@ -1,4 +1,4 @@
// Colofilter.css v1.0.0
// Colofilter.css v1.0.1
$color-map: (
'red': '#E50914',
'orange': '#FCA300',
Expand All @@ -10,12 +10,9 @@ $color-map: (
'blue-yellow': ' ',
'pink-yellow': ' ',
'red-blue': ' ',
'lime': ' '
);
);

[class^="blend"] {


img {
mix-blend-mode: luminosity;
}
Expand Down Expand Up @@ -61,9 +58,19 @@ $color-map: (
}

@each $color, $value in $color-map {
&[class*="-#{$color}"] {
background: #{($value)};

@if $color == 'blue-yellow' or
$color == 'pink-yellow' or
$color == 'red-blue' {
&[class*="-#{$color}"] {
}
}
@else {
&[class*="-#{$color}"] {
background: #{($value)};
}
}
&[class*="-#{$color}"] {
@if $color == 'blue' {
&:not([class*="-dark"]):not([class*="-light"]){
&:after{
Expand Down Expand Up @@ -250,10 +257,18 @@ $color-map: (
}
}
}


@if $value == ' ' {
&:after {
}
}
@else {
&:after {
background: #{($value)};
}
}

&:after {
background: #{($value)};

@if $color == 'red' {
background: #282581;
}
Expand Down
41 changes: 17 additions & 24 deletions styles/main.css
@@ -1,4 +1,3 @@
@charset "UTF-8";
@import url(normalize.css);
@import url(https://fonts.googleapis.com/css?family=Maven+Pro:400,700,900);
[class^="blend"] img {
Expand Down Expand Up @@ -56,6 +55,8 @@
}
[class^="blend"][class*="-red"]:after {
background: #E50914;
}
[class^="blend"][class*="-red"]:after {
background: #282581;
}
[class^="blend"][class*="-orange"] {
Expand Down Expand Up @@ -85,6 +86,8 @@
}
[class^="blend"][class*="-blue"]:after {
background: #0066BF;
}
[class^="blend"][class*="-blue"]:after {
background: #93EF90;
}
[class^="blend"][class*="-yellow"] {
Expand All @@ -110,6 +113,8 @@
}
[class^="blend"][class*="-yellow"]:after {
background: #FEDD31;
}
[class^="blend"][class*="-yellow"]:after {
background: #EF3CB4;
}
[class^="blend"][class*="-purple"] {
Expand All @@ -129,13 +134,15 @@
-webkit-filter: saturate(100);
filter: saturate(100);
}
[class^="blend"][class*="-purple"][class*="-ligh"]:after {
[class^="blend"][class*="-purple"][class*="-light"]:after {
background: #A37FC7;
-webkit-filter: saturate(520%) brightness(10.5) contrast(350) !important;
filter: saturate(520%) brightness(10.5) contrast(350) !important;
}
[class^="blend"][class*="-purple"]:after {
background: #BC6D14;
}
[class^="blend"][class*="-purple"]:after {
background: #ACFCEE;
}
[class^="blend"][class*="-green"] {
Expand All @@ -151,6 +158,8 @@
}
[class^="blend"][class*="-green"]:after {
background: #11C966;
}
[class^="blend"][class*="-green"]:after {
background: #2D3181;
}
[class^="blend"][class*="-pink"] {
Expand All @@ -159,37 +168,32 @@
[class^="blend"][class*="-pink"][class*="-dark"]:after {
background: #1D0E14;
}
[class^="blend"][class*="-pink"][class*="-ligh"]:after {
[class^="blend"][class*="-pink"][class*="-light"]:after {
background: #FF468D;
mix-blend-mode: lighten !important;
-webkit-filter: contrast(1) saturate(250%) !important;
filter: contrast(1) saturate(250%) !important;
}
[class^="blend"][class*="-pink"]:after {
background: #EA4C89;
background: #EA4C89;
}
[class^="blend"][class*="-blue-yellow"] {
background:  ;
[class^="blend"][class*="-pink"]:after {
background: #EA4C89;
}
[class^="blend"][class*="-blue-yellow"]:not([class*="-dark"]):not([class*="-light"]) {
background: linear-gradient(to top left, #55ACEE, #FEDD31);
}
[class^="blend"][class*="-blue-yellow"][class*="-dark"]:after {
mix-blend-mode: hard-light !important;
}
[class^="blend"][class*="-blue-yellow"][class*="-ligh"]:after {
[class^="blend"][class*="-blue-yellow"][class*="-light"]:after {
mix-blend-mode: hard-light !important;
-webkit-filter: none;
filter: none;
}
[class^="blend"][class*="-blue-yellow"]:after {
background:  ;
background: linear-gradient(to top left, #55ACEE, #FEDD31) !important;
}
[class^="blend"][class*="-pink-yellow"] {
background:  ;
}
[class^="blend"][class*="-pink-yellow"]:not([class*="-dark"]):not([class*="-light"]) {
background: linear-gradient(to bottom right, #FAA6FB, #FBBC05) !important;
}
Expand All @@ -198,18 +202,14 @@
-webkit-filter: none !important;
filter: none !important;
}
[class^="blend"][class*="-pink-yellow"][class*="-ligh"]:after {
[class^="blend"][class*="-pink-yellow"][class*="-light"]:after {
mix-blend-mode: hard-light !important;
-webkit-filter: none !important;
filter: none !important;
}
[class^="blend"][class*="-pink-yellow"]:after {
background:  ;
background: linear-gradient(to top left, #FAA6FB, #FBBC05) !important;
}
[class^="blend"][class*="-red-blue"] {
background:  ;
}
[class^="blend"][class*="-red-blue"]:not([class*="-dark"]):not([class*="-light"]) {
background: linear-gradient(to bottom right, #3993E2, #E2544B);
}
Expand All @@ -223,21 +223,14 @@
-webkit-filter: none !important;
filter: none !important;
}
[class^="blend"][class*="-red-blue"][class*="-ligh"]:after {
[class^="blend"][class*="-red-blue"][class*="-light"]:after {
mix-blend-mode: screen !important;
-webkit-filter: saturate(300%) brightness(1.2) !important;
filter: saturate(300%) brightness(1.2) !important;
}
[class^="blend"][class*="-red-blue"]:after {
background:  ;
background: linear-gradient(to bottom right, #3993E2, #E2544B);
}
[class^="blend"][class*="-lime"] {
background:  ;
}
[class^="blend"][class*="-lime"]:after {
background:  ;
}

::root {
font-size: calc(16px + 0.35vw + 0.35vh);
Expand Down

0 comments on commit c685d5f

Please sign in to comment.