From d79068a73440f6b23859434675ef92d16ca9c5ff Mon Sep 17 00:00:00 2001 From: mustafahlvc Date: Sun, 30 Jul 2017 00:53:43 +0300 Subject: [PATCH] Color helper updated. --- src/app/core/scss/partials/_colors.scss | 75 +++++++++++++------- src/app/main/ui/colors/colors.component.html | 43 ++++++++--- src/app/main/ui/colors/colors.component.scss | 1 - src/app/main/ui/colors/colors.component.ts | 2 +- 4 files changed, 81 insertions(+), 40 deletions(-) diff --git a/src/app/core/scss/partials/_colors.scss b/src/app/core/scss/partials/_colors.scss index 083096eb..3dddc712 100644 --- a/src/app/core/scss/partials/_colors.scss +++ b/src/app/core/scss/partials/_colors.scss @@ -1,26 +1,26 @@ $matColorsMap: ( - red: $mat-red, - pink:$mat-pink, - purple:$mat-purple, - deep-purple:$mat-deep-purple, - indigo:$mat-indigo, - blue:$mat-blue, - light-blue:$mat-light-blue, - cyan:$mat-cyan, - teal:$mat-teal, - green:$mat-green, - light-green:$mat-light-green, - lime:$mat-lime, - yellow:$mat-yellow, - amber:$mat-amber, - orange:$mat-orange, - deep-orange:$mat-deep-orange, - brown:$mat-brown, - grey:$mat-grey, - blue-grey:$mat-blue-grey, - primary:$primary, - accent: $accent, - warn: $warn + red: $mat-red, + pink:$mat-pink, + purple:$mat-purple, + deep-purple:$mat-deep-purple, + indigo:$mat-indigo, + blue:$mat-blue, + light-blue:$mat-light-blue, + cyan:$mat-cyan, + teal:$mat-teal, + green:$mat-green, + light-green:$mat-light-green, + lime:$mat-lime, + yellow:$mat-yellow, + amber:$mat-amber, + orange:$mat-orange, + deep-orange:$mat-deep-orange, + brown:$mat-brown, + grey:$mat-grey, + blue-grey:$mat-blue-grey, + primary:$primary, + accent: $accent, + warn: $warn ); $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700; @@ -39,6 +39,19 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400 .md-#{$colorName}-#{$hue}-bg { background-color: $bgColor !important; color: $fgColor; + + .secondary-text { + color: rgba($fgColor, .7); + } + + .hint-text { + color: rgba($fgColor, .3); + } + + .fade-text { + color: rgba($fgColor, .12); + } + } .#{$colorName}-#{$hue}-fg { @@ -70,6 +83,19 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400 .md-#{$colorName}-bg { background-color: $bgColor !important; color: $fgColor; + + .secondary-text { + color: rgba($fgColor, .7); + } + + .hint-text { + color: rgba($fgColor, .3); + } + + .fade-text { + color: rgba($fgColor, .12); + } + } .#{$colorName}-bg { @@ -103,11 +129,6 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400 } } - - - - - // Black text .black-fg, .black-text { diff --git a/src/app/main/ui/colors/colors.component.html b/src/app/main/ui/colors/colors.component.html index 62ab632a..da363711 100644 --- a/src/app/main/ui/colors/colors.component.html +++ b/src/app/main/ui/colors/colors.component.html @@ -2,11 +2,11 @@
-

Material Colors

+

Colors

+ href="https://www.google.com/design/spec/style/color.html#color-color-palette" + target="_blank"> link Reference @@ -18,6 +18,12 @@ + + + {{color}} + + + {{color.key}} @@ -41,9 +47,21 @@

{{selectedColor}}

-
-
500
-
+
+ +
500
+ +
+
.{{'md-'+selectedColor+'-bg'}}
+
.secondary-text
+
.hint-text
+
.fade-text
+
+ +
+
+ +
{{selectedColorDefaultValue}}
@@ -56,16 +74,19 @@ fxFlex="1 0 auto" fxLayout="row" fxLayout.sm="column" [ngClass]="selectedColor+'-'+hue+'-bg'"> -
{{hue}}
+
{{hue}}
-
- .{{'md-'+selectedColor+'-'+hue+'-bg'}} +
+
.{{'md-'+selectedColor+'-'+hue+'-bg'}}
+
.secondary-text
+
.hint-text
+
.fade-text
-
.{{selectedColor+'-'+hue+'-bg'}}
+
.{{selectedColor+'-'+hue+'-bg'}}
+ [ngClass]="selectedColor+'-'+hue+'-fg'" fxFlex="128px" fxLayoutAlign="center center"> .{{selectedColor+'-'+hue+'-fg'}}
diff --git a/src/app/main/ui/colors/colors.component.scss b/src/app/main/ui/colors/colors.component.scss index 4887b6dd..b05c10da 100644 --- a/src/app/main/ui/colors/colors.component.scss +++ b/src/app/main/ui/colors/colors.component.scss @@ -16,7 +16,6 @@ .fg-box { background-color: white; - min-width: 128px; } } diff --git a/src/app/main/ui/colors/colors.component.ts b/src/app/main/ui/colors/colors.component.ts index c77d8a6b..d2766877 100644 --- a/src/app/main/ui/colors/colors.component.ts +++ b/src/app/main/ui/colors/colors.component.ts @@ -16,7 +16,7 @@ export class ColorsComponent implements OnInit constructor() { this.colors = MatColors.all; - this.updateSelectedColor('red'); + this.updateSelectedColor('primary'); } ngOnInit()