From f1bac0b4b9242f0c480e1e77ae29f364a73ccfe2 Mon Sep 17 00:00:00 2001 From: Korgan Date: Sat, 6 Dec 2014 02:44:57 +0100 Subject: [PATCH] All colors mixed --- index.html | 296 ++++++++++++++++++++++++++++++++++++++++++++- less/_buttons.less | 13 +- less/_colors.less | 18 +++ less/_mixins.less | 111 ++++++++++++++++- less/_navbar.less | 4 +- 5 files changed, 418 insertions(+), 24 deletions(-) diff --git a/index.html b/index.html index c8c74289..43c2cfe9 100644 --- a/index.html +++ b/index.html @@ -569,6 +569,51 @@ + +

Progress Bar

@@ -673,7 +718,8 @@

Material Color Samples

-
+
+

@@ -687,7 +733,10 @@ -

+ +
+
+

@@ -701,7 +750,27 @@ -

+ +
+
+

+ + + + + + + + + +
+ + + + +
+
+

@@ -715,7 +784,180 @@ -

+ +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

+ + + + + + + + + +
+ + + + +
+
+

@@ -729,7 +971,10 @@ -

+ +
+
+

@@ -745,6 +990,45 @@

+
+

+ + + + + + + + + + +
+
+

+ + + + + + + + + + +
+
+

+ + + + + + + + + + +

Button

@@ -989,7 +1273,7 @@
-
+ diff --git a/less/_buttons.less b/less/_buttons.less index 5755079e..0517856d 100644 --- a/less/_buttons.less +++ b/less/_buttons.less @@ -18,18 +18,9 @@ transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); outline: none !important; - .variations(~":not(.btn-link):not(.btn-flat)", background-color, @btn-default); - .variations(~".btn-flat:not(.btn-link)", color, @lightbg-text); - /* - .background-variations(@extra) { - &-material-test { - background-color: blue !important; - color: red !important; - } - }*/ - .background-variations(~":not(.btn-link):not(.btn-flat)"); - .background-variations(~".btn-flat:not(.btn-link)"); + + .background-variations(~":not(.btn-link):not(.btn-flat)", @btn-default); &.btn-flat { background: none; diff --git a/less/_colors.less b/less/_colors.less index 44b2da88..9cf1ab6c 100644 --- a/less/_colors.less +++ b/less/_colors.less @@ -315,6 +315,12 @@ Then, run this script to get the list. @brown-700: #5d4037; @brown-800: #4e342e; @brown-900: #3e2723; +// this colors are duplicated +// created to keep pattern and to keep working variations and background variations mixin. +@brown-A100: #d7ccc8; +@brown-A200: #bcaaa4; +@brown-A400: #8d6e63; +@brown-A700: #5d4037; @grey: #9e9e9e; @@ -328,6 +334,12 @@ Then, run this script to get the list. @grey-700: #616161; @grey-800: #424242; @grey-900: #212121; +// this colors are duplicated +// created to keep pattern and to keep working variations and background variations mixin. +@grey-A100: #f5f5f5; +@grey-A200: #eeeeee; +@grey-A400: #bdbdbd; +@grey-A700: #616161; @blue-grey: #607d8b; @@ -341,6 +353,12 @@ Then, run this script to get the list. @blue-grey-700: #455a64; @blue-grey-800: #37474f; @blue-grey-900: #263238; +// this colors are duplicated +// created to keep pattern and to keep working variations and background variations mixin. +@blue-grey-A100: #cfd8dc; +@blue-grey-A200: #b0bec5; +@blue-grey-A400: #78909c; +@blue-grey-A700: #455a64; @black: #000000; diff --git a/less/_mixins.less b/less/_mixins.less index 3e51f3e6..e2a9f314 100644 --- a/less/_mixins.less +++ b/less/_mixins.less @@ -1,5 +1,6 @@ // usage: .variations(~" .check", color, transparent); .variations(@extra, @property, @default) { + // Bootstrap shades &@{extra}, &-default@{extra} { @{property}: @default; @@ -18,7 +19,55 @@ } &-danger@{extra} { @{property}: @danger; - } + } + + + .variations-factory(@material-color) { + .variations-factory-deep(@material-color-number) { + + &-material-@{material-color}@{material-color-number}@{extra} { + @final-color: "@{material-color}@{material-color-number}"; + @{property}: @@final-color; + } + + } + .variations-factory-deep(~""); + .variations-factory-deep(~"-50"); + .variations-factory-deep(~"-100"); + .variations-factory-deep(~"-200"); + .variations-factory-deep(~"-300"); + .variations-factory-deep(~"-400"); + .variations-factory-deep(~"-500"); + .variations-factory-deep(~"-600"); + .variations-factory-deep(~"-700"); + .variations-factory-deep(~"-800"); + .variations-factory-deep(~"-900"); + .variations-factory-deep(~"-A100"); + .variations-factory-deep(~"-A200"); + .variations-factory-deep(~"-A400"); + .variations-factory-deep(~"-A700"); + } + .variations-factory(~"red"); + .variations-factory(~"pink"); + .variations-factory(~"purple"); + .variations-factory(~"deep-purple"); + .variations-factory(~"indigo"); + .variations-factory(~"blue"); + .variations-factory(~"light-blue"); + .variations-factory(~"cyan"); + .variations-factory(~"teal"); + .variations-factory(~"green"); + .variations-factory(~"light-green"); + .variations-factory(~"lime"); + .variations-factory(~"yellow"); + .variations-factory(~"amber"); + .variations-factory(~"orange"); + .variations-factory(~"deep-orange"); + .variations-factory(~"brown"); + .variations-factory(~"grey"); + .variations-factory(~"blue-grey"); + + /* // Material shades &-material-red@{extra} { @{property}: @red; @@ -74,17 +123,51 @@ &-material-lightgrey@{extra} { @{property}: @lightgrey; } + */ } -.background-variations(@extra) { +.background-variations(@extra, @default) { + + @contrast-factor: 40%; + + .set-background-and-font-color(@bg-color) { + background-color: @bg-color; + color: contrast(@bg-color, @lightbg-text, @darkbg-text, @contrast-factor); + } + + // bootstrap styles + &@{extra}, &-default@{extra} { + .set-background-and-font-color(@default); + } + &-primary@{extra} { + .set-background-and-font-color(@primary); + } + &-success@{extra} { + .set-background-and-font-color(@success); + } + &-info@{extra} { + .set-background-and-font-color(@info); + } + &-warning@{extra} { + .set-background-and-font-color(@warning); + } + &-danger@{extra} { + .set-background-and-font-color(@danger); + } + + // given a color build multiples dephs .background-variations-factory(@material-color) { + + // given a color and its deph build css .background-variations-factory-deep(@material-color-number) { + &-material-@{material-color}@{material-color-number}@{extra} { @final-background-color: "@{material-color}@{material-color-number}"; - background-color: @@final-background-color; - color: contrast(@@final-background-color, @lightbg-text, @darkbg-text, 25%); + .set-background-and-font-color(@@final-background-color); } + } + .background-variations-factory-deep(~""); .background-variations-factory-deep(~"-50"); .background-variations-factory-deep(~"-100"); @@ -101,12 +184,28 @@ .background-variations-factory-deep(~"-A400"); .background-variations-factory-deep(~"-A700"); } - .background-variations-factory(~"lime"); + .background-variations-factory(~"red"); .background-variations-factory(~"pink"); + .background-variations-factory(~"purple"); .background-variations-factory(~"deep-purple"); - .background-variations-factory(~"deep-orange"); + .background-variations-factory(~"indigo"); + .background-variations-factory(~"blue"); + .background-variations-factory(~"light-blue"); + .background-variations-factory(~"cyan"); + .background-variations-factory(~"teal"); + .background-variations-factory(~"green"); + .background-variations-factory(~"light-green"); + .background-variations-factory(~"lime"); + .background-variations-factory(~"yellow"); + .background-variations-factory(~"amber"); .background-variations-factory(~"orange"); + .background-variations-factory(~"deep-orange"); + .background-variations-factory(~"brown"); + .background-variations-factory(~"grey"); + .background-variations-factory(~"blue-grey"); + + } @all-variations: ~"-default, -primary, -info, -success, -warning, -danger"; diff --git a/less/_navbar.less b/less/_navbar.less index ecea6106..dda867f2 100644 --- a/less/_navbar.less +++ b/less/_navbar.less @@ -161,7 +161,9 @@ :-ms-input-placeholder { color: @navbar-border; }; } - .variations(~"", background-color, @primary); + //.variations(~"", background-color, @primary); + .background-variations(~"", @primary); + &-inverse { background-color: @navbar-inverse-bg; }