- 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`');
+ }
}
}