From 2827275da61b9c4a57485faf8d0c8c04752e853d Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Thu, 23 Mar 2017 13:02:54 -0400 Subject: [PATCH] refactor(typography): remove the native element selectors BREAKING CHANGES: The following selectors to style the text color of the native text elements have been removed: ``` 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] ``` These have been throwing a deprecation warning since rc.3 but still working. They are officially gone and therefore these elements will not get the color unless the `ion-text` attribute is added. Please see the documentation. --- src/components/typography/typography.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/typography/typography.ts b/src/components/typography/typography.ts index 57eb9449407..a3337ffcddb 100644 --- a/src/components/typography/typography.ts +++ b/src/components/typography/typography.ts @@ -1,11 +1,10 @@ -import { Attribute, Directive, ElementRef, Input, Renderer } from '@angular/core'; +import { Directive, ElementRef, Input, Renderer } from '@angular/core'; import { Config } from '../../config/config'; import { Ion } from '../ion'; /** - * @hidden TODO remove this line when we remove the other selectors in order to document it * @name Typography * @module ionic * @description @@ -47,7 +46,7 @@ import { Ion } from '../ion'; * */ @Directive({ - 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]' + selector: '[ion-text]' }) export class Typography extends Ion { @@ -71,14 +70,8 @@ export class Typography extends Ion { this._setMode(val); } - constructor(config: Config, elementRef: ElementRef, renderer: Renderer, @Attribute('ion-text') ionText: string) { + constructor(config: Config, elementRef: ElementRef, renderer: Renderer) { super(config, elementRef, renderer, 'text'); - - // 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`'); - } } }