From e350a78a003a1225a4569a224e2f63a0b60e7b30 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Thu, 10 Nov 2016 17:22:21 -0500 Subject: [PATCH] refactor(item): remove paragraph styles, update activated colors - Adds test for item colors - Removes the color from native paragraph elements allowing colors to be passed Closes #9081 --- src/components/item/item.ios.scss | 8 +- src/components/item/item.md.scss | 8 +- src/components/item/item.wp.scss | 8 +- src/components/item/test/colors/app-module.ts | 33 ++++++++ src/components/item/test/colors/e2e.ts | 1 + src/components/item/test/colors/main.html | 78 +++++++++++++++++++ 6 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 src/components/item/test/colors/app-module.ts create mode 100644 src/components/item/test/colors/e2e.ts create mode 100644 src/components/item/test/colors/main.html diff --git a/src/components/item/item.ios.scss b/src/components/item/item.ios.scss index 23dc5e4296c..be4e7f45407 100644 --- a/src/components/item/item.ios.scss +++ b/src/components/item/item.ios.scss @@ -6,9 +6,6 @@ /// @prop - Font size of the item text $item-ios-body-text-font-size: 1.6rem !default; -/// @prop - Color of the item paragraph -$item-ios-paragraph-text-color: #666 !default; - /// @prop - Size of the avatar in the item $item-ios-avatar-size: 3.6rem !default; @@ -93,7 +90,6 @@ $item-ios-sliding-content-background: $list-ios-background-color !default; font-size: 1.2rem; line-height: normal; text-overflow: inherit; - color: $item-ios-paragraph-text-color; } .item-ios h2:last-child, @@ -236,6 +232,10 @@ ion-item-divider.item-ios { .item-ios-#{$color-name} { color: $color-contrast; background-color: $color-base; + + &.activated { + background-color: color-shade($color-base); + } } } diff --git a/src/components/item/item.md.scss b/src/components/item/item.md.scss index 2a00f90fbfb..5c14c1a409a 100644 --- a/src/components/item/item.md.scss +++ b/src/components/item/item.md.scss @@ -9,9 +9,6 @@ $item-md-body-text-font-size: 1.4rem !default; /// @prop - line height of the item text $item-md-body-text-line-height: 1.5 !default; -/// @prop - Color of the item paragraph -$item-md-paragraph-text-color: #666 !default; - /// @prop - Font size of the item $item-md-font-size: 1.6rem !default; @@ -103,7 +100,6 @@ $item-md-sliding-content-background: $list-md-background-color !default; font-size: 1.4rem; line-height: normal; text-overflow: inherit; - color: $item-md-paragraph-text-color; } .item-md.item-block .item-inner { @@ -239,6 +235,10 @@ ion-item-divider.item-md { .item-md-#{$color-name} { color: $color-contrast; background-color: $color-base; + + &.activated { + background-color: color-shade($color-base); + } } } diff --git a/src/components/item/item.wp.scss b/src/components/item/item.wp.scss index b14eb619d25..883c1afe5f6 100644 --- a/src/components/item/item.wp.scss +++ b/src/components/item/item.wp.scss @@ -15,9 +15,6 @@ $item-wp-body-background-color: $list-wp-background-color !default; /// @prop - Color of the item text $item-wp-body-text-color: $list-wp-text-color !default; -/// @prop - Color of the item paragraph -$item-wp-paragraph-text-color: #666 !default; - /// @prop - Font size of the item $item-wp-font-size: 1.6rem !default; @@ -108,7 +105,6 @@ $item-wp-sliding-content-background: $list-wp-background-color !default; font-size: 1.4rem; line-height: normal; text-overflow: inherit; - color: $item-wp-paragraph-text-color; } .item-wp.item-block .item-inner { @@ -236,6 +232,10 @@ ion-item-divider.item-wp { .item-wp-#{$color-name} { color: $color-contrast; background-color: $color-base; + + &.activated { + background-color: color-shade($color-base); + } } } diff --git a/src/components/item/test/colors/app-module.ts b/src/components/item/test/colors/app-module.ts new file mode 100644 index 00000000000..b27ac52c142 --- /dev/null +++ b/src/components/item/test/colors/app-module.ts @@ -0,0 +1,33 @@ +import { Component, NgModule } from '@angular/core'; +import { IonicApp, IonicModule } from '../../../..'; + + +@Component({ + templateUrl: 'main.html' +}) +export class E2EPage { + +} + +@Component({ + template: '' +}) +export class E2EApp { + rootPage = E2EPage; +} + +@NgModule({ + declarations: [ + E2EApp, + E2EPage + ], + imports: [ + IonicModule.forRoot(E2EApp) + ], + bootstrap: [IonicApp], + entryComponents: [ + E2EApp, + E2EPage + ] +}) +export class AppModule {} diff --git a/src/components/item/test/colors/e2e.ts b/src/components/item/test/colors/e2e.ts new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/src/components/item/test/colors/e2e.ts @@ -0,0 +1 @@ + diff --git a/src/components/item/test/colors/main.html b/src/components/item/test/colors/main.html new file mode 100644 index 00000000000..bf9f9086723 --- /dev/null +++ b/src/components/item/test/colors/main.html @@ -0,0 +1,78 @@ + + + + Item Colors + + + + + + + + + Primary label + + + + Primary label + + + + a[ion-item] danger + + + + a[ion-item].activated danger + + + + + + + + + Inner Buttons +

Normal paragraph

+ +
+ + + left icon buttons +

Primary paragraph

+ + + + disabled left icon buttons +

Primary paragraph

+ + + + + right icon buttons + + + + + a ion-item disabled right icon/text button large +

Default paragraph

+
+ +