diff --git a/src/components/fab/fab.ios.scss b/src/components/fab/fab.ios.scss index ff81d6be13..ba04cbb606 100755 --- a/src/components/fab/fab.ios.scss +++ b/src/components/fab/fab.ios.scss @@ -50,12 +50,12 @@ $fab-ios-list-button-background-color-activated: color-shade($fab-ios-list-butt $bg-color-activated: color-shade($bg-color); $fg-color: $color-contrast; - .fab-ios.fab-ios-#{$color-name} { + .fab-ios-#{$color-name} { color: $fg-color; background-color: $bg-color; } - .fab-ios.fab-ios-#{$color-name}.activated { + .fab-ios-#{$color-name}.activated { background-color: $bg-color-activated; } } diff --git a/src/components/fab/fab.md.scss b/src/components/fab/fab.md.scss index 610e5789b2..b2296e3588 100755 --- a/src/components/fab/fab.md.scss +++ b/src/components/fab/fab.md.scss @@ -63,12 +63,12 @@ $fab-md-list-button-background-color-activated: color-shade($fab-md-list-butto $bg-color-activated: color-shade($bg-color); $fg-color: $color-contrast; - .fab-md.fab-md-#{$color-name} { + .fab-md-#{$color-name} { color: $fg-color; background-color: $bg-color; } - .fab-md.fab-md-#{$color-name}.activated { + .fab-md-#{$color-name}.activated { background-color: $bg-color-activated; } } diff --git a/src/components/fab/fab.wp.scss b/src/components/fab/fab.wp.scss index f307b2a86f..b60793626c 100755 --- a/src/components/fab/fab.wp.scss +++ b/src/components/fab/fab.wp.scss @@ -50,12 +50,12 @@ $fab-wp-list-button-background-color-activated: color-shade($fab-wp-list-butto $bg-color-activated: color-shade($bg-color); $fg-color: $color-contrast; - .fab-wp.fab-wp-#{$color-name} { + .fab-wp-#{$color-name} { color: $fg-color; background-color: $bg-color; } - .fab-wp.fab-wp-#{$color-name}.activated { + .fab-wp-#{$color-name}.activated { background-color: $bg-color-activated; } } diff --git a/src/components/fab/test/basic/main.html b/src/components/fab/test/basic/main.html index 2dff97d6e2..6fe5eb30fc 100755 --- a/src/components/fab/test/basic/main.html +++ b/src/components/fab/test/basic/main.html @@ -51,7 +51,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/src/components/item/test/text/main.html b/src/components/item/test/text/main.html index 9ab5d4cd87..705709b765 100644 --- a/src/components/item/test/text/main.html +++ b/src/components/item/test/text/main.html @@ -37,9 +37,9 @@ -

H3 Title Text

+

H3 Title Text

Paragraph line 1

-

Paragraph line 2 secondary

+

Paragraph line 2 secondary

diff --git a/src/components/nav/test/nav-push-pop/main.html b/src/components/nav/test/nav-push-pop/main.html index 3c81e3cd67..18e2ff5528 100644 --- a/src/components/nav/test/nav-push-pop/main.html +++ b/src/components/nav/test/nav-push-pop/main.html @@ -107,13 +107,13 @@

- a (p *ngIf="!visible")

- a (a *ngIf="!visible") diff --git a/src/components/typography/test/basic/main.html b/src/components/typography/test/basic/main.html index 9cf4179e38..99f0ce24d5 100644 --- a/src/components/typography/test/basic/main.html +++ b/src/components/typography/test/basic/main.html @@ -9,29 +9,29 @@ -

H1: The quick brown fox jumps over the lazy dog

+

H1: The quick brown fox jumps over the lazy dog

-

H2: The quick brown fox jumps over the lazy dog

+

H2: The quick brown fox jumps over the lazy dog

-

H3: The quick brown fox jumps over the lazy dog

+

H3: The quick brown fox jumps over the lazy dog

-

H4: The quick brown fox jumps over the lazy dog

+

H4: The quick brown fox jumps over the lazy dog

-
H5: The quick brown fox jumps over the lazy dog
+
H5: The quick brown fox jumps over the lazy dog
-
H6: The quick brown fox jumps over the lazy dog
+
H6: The quick brown fox jumps over the lazy dog

I saw a werewolf with a Chinese menu in his hand. - Walking through the streets of Soho in the rain. - He was looking for a place called Lee Ho Fook's. - Gonna get a big dish of beef chow mein. + Walking through the streets of Soho in the rain. + He was looking for a place called Lee Ho Fook's. + Gonna get a big dish of beef chow mein. My purple class link.

He's the hairy-handed gent who ran amuck in Kent. - Lately he's been overheard in Mayfair. + Lately he's been overheard in Mayfair. Better stay away from him. He'll rip your lungs out, Jim. I'd like to meet his tailor. diff --git a/src/components/typography/typography.ts b/src/components/typography/typography.ts index 081f8dd02c..bace39dc08 100644 --- a/src/components/typography/typography.ts +++ b/src/components/typography/typography.ts @@ -1,15 +1,53 @@ -import { Directive, ElementRef, Input, Renderer } from '@angular/core'; +import { Attribute, Directive, ElementRef, Input, Renderer } from '@angular/core'; import { Config } from '../../config/config'; import { Ion } from '../ion'; /** - * @private - * Select all of the HTML text elements with the color attribute to apply the text-color class. + * @private TODO remove this line when we remove the other selectors in order to document it + * @name Typography + * @module ionic + * @description + * + * The Typography component is a simple component that can be used to style the text color of any element. + * The `ion-text` attribute should be added to the element in order to pass a color from the Sass `$colors` + * map and change the text color of that element. + * + * @usage + * + * ```html + *

H1: The quick brown fox jumps over the lazy dog

+ * + *

H2: The quick brown fox jumps over the lazy dog

+ * + *

H3: The quick brown fox jumps over the lazy dog

+ * + *

H4: The quick brown fox jumps over the lazy dog

+ * + *
H5: The quick brown fox jumps over the lazy dog
+ * + *
H6: The quick brown fox jumps over the lazy dog
+ * + *

+ * I saw a werewolf with a Chinese menu in his hand. + * Walking through the streets of Soho in the rain. + * He was looking for a place called Lee Ho Fook's. + * Gonna get a big dish of beef chow mein. + *

+ * + *

+ * He's the hairy-handed gent who ran amuck in Kent. + * Lately he's been overheard in Mayfair. + * Better stay away from him. + * He'll rip your lungs out, Jim. + * I'd like to meet his tailor. + *

+ * ``` + * */ @Directive({ - selector: 'h1[color], h2[color], h3[color], h4[color], h5[color], h6[color], a[color]:not([ion-button]):not([ion-item]), p[color], span[color], b[color], i[color], strong[color], em[color], small[color], sub[color], sup[color]' + selector: 'h1[color], h2[color], h3[color], h4[color], h5[color], h6[color], a[color]:not([ion-button]):not([ion-item]):not([ion-fab]), p[color], span[color], b[color], i[color], strong[color], em[color], small[color], sub[color], sup[color], [ion-text]' }) export class Typography extends Ion { @@ -29,10 +67,16 @@ export class Typography extends Ion { this._setMode('text', val); } - constructor(config: Config, elementRef: ElementRef, renderer: Renderer) { + constructor(config: Config, elementRef: ElementRef, renderer: Renderer, @Attribute('ion-text') ionText: string) { super(config, elementRef, renderer); this.mode = config.get('mode'); + + // TODO: Deprecated: all selectors besides `[ion-text]` rc.3 + // Remove all other selectors and the `ionText` attribute + if (ionText === null) { + console.warn('Deprecated: The color input has been removed from HTML elements. Please add the `ion-text` attribute in order to use the color input. For example: `Link`'); + } } }