typography.js 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. import { Directive, ElementRef, Renderer } from '@angular/core';
  12. import { Config } from '../../config/config';
  13. import { Ion } from '../ion';
  14. /**
  15. * @name Typography
  16. * @module ionic
  17. * @description
  18. *
  19. * The Typography component is a simple component that can be used to style the text color of any element.
  20. * The `ion-text` attribute should be added to the element in order to pass a color from the Sass `$colors`
  21. * map and change the text color of that element.
  22. *
  23. * @usage
  24. *
  25. * ```html
  26. * <h1 ion-text color="secondary">H1: The quick brown fox jumps over the lazy dog</h1>
  27. *
  28. * <h2 ion-text color="primary">H2: The quick brown fox jumps over the lazy dog</h2>
  29. *
  30. * <h3 ion-text color="light">H3: The quick brown fox jumps over the lazy dog</h3>
  31. *
  32. * <h4 ion-text color="danger">H4: The quick brown fox jumps over the lazy dog</h4>
  33. *
  34. * <h5 ion-text color="dark">H5: The quick brown fox jumps over the lazy dog</h5>
  35. *
  36. * <h6 ion-text [color]="dynamicColor">H6: The quick brown fox jumps over the lazy dog</h6>
  37. *
  38. * <p>
  39. * I saw a werewolf with a Chinese menu in his hand.
  40. * Walking through the <sub ion-text color="danger">streets</sub> of Soho in the rain.
  41. * He <i ion-text color="primary">was</i> looking for a place called Lee Ho Fook's.
  42. * Gonna get a <a ion-text color="secondary">big dish of beef chow mein.</a>
  43. * </p>
  44. *
  45. * <p>
  46. * He's the hairy-handed gent who ran amuck in Kent.
  47. * Lately he's <sup ion-text color="primary">been</sup> overheard in Mayfair.
  48. * Better stay away from him.
  49. * He'll rip your lungs out, Jim.
  50. * I'd like to meet his tailor.
  51. * </p>
  52. * ```
  53. *
  54. */
  55. var Typography = (function (_super) {
  56. __extends(Typography, _super);
  57. function Typography(config, elementRef, renderer) {
  58. return _super.call(this, config, elementRef, renderer, 'text') || this;
  59. }
  60. Typography.decorators = [
  61. { type: Directive, args: [{
  62. selector: '[ion-text]'
  63. },] },
  64. ];
  65. /** @nocollapse */
  66. Typography.ctorParameters = function () { return [
  67. { type: Config, },
  68. { type: ElementRef, },
  69. { type: Renderer, },
  70. ]; };
  71. return Typography;
  72. }(Ion));
  73. export { Typography };
  74. //# sourceMappingURL=typography.js.map