label.md.scss 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. @import "../../themes/ionic.globals.md";
  2. // Material Design Label
  3. // --------------------------------------------------
  4. /// @prop - Text color of the label by an input, select, or datetime
  5. $label-md-text-color: #999 !default;
  6. /// @prop - Text color of the stacked/floating label when it is focused
  7. $label-md-text-color-focused: color($colors-md, primary) !default;
  8. // deprecated
  9. $label-md-margin: null !default;
  10. /// @prop - Margin top of the label
  11. $label-md-margin-top: $item-md-padding-top !default;
  12. /// @prop - Margin end of the label
  13. $label-md-margin-end: ($item-md-padding-end / 2) !default;
  14. /// @prop - Margin bottom of the label
  15. $label-md-margin-bottom: $item-md-padding-bottom !default;
  16. /// @prop - Margin start of the label
  17. $label-md-margin-start: 0 !default;
  18. // Material Design Default Label
  19. // --------------------------------------------------
  20. .label-md {
  21. @include deprecated-variable(margin, $label-md-margin) {
  22. @include margin($label-md-margin-top, $label-md-margin-end, $label-md-margin-bottom, $label-md-margin-start);
  23. }
  24. }
  25. [text-wrap] .label-md {
  26. font-size: $item-md-body-text-font-size;
  27. line-height: $item-md-body-text-line-height;
  28. }
  29. // Material Design Default Label Inside An Input/Select Item
  30. // --------------------------------------------------
  31. .item-input .label-md,
  32. .item-select .label-md,
  33. .item-datetime .label-md {
  34. color: $label-md-text-color;
  35. }
  36. // Material Design Stacked & Floating Labels
  37. // --------------------------------------------------
  38. .label-md[stacked] {
  39. font-size: 1.2rem;
  40. }
  41. .label-md[floating] {
  42. @include transform(translate3d(0, 27px, 0));
  43. @include transform-origin(start, top);
  44. transition: transform 150ms ease-in-out;
  45. }
  46. .label-md[stacked],
  47. .label-md[floating] {
  48. @include margin(null, null, 0, 0);
  49. }
  50. // TODO remove all uses of input-has-focus in v4
  51. // TODO remove all uses of input-has-value in v4
  52. .item-input-has-focus .label-md[stacked],
  53. .input-has-focus .label-md[stacked],
  54. .item-input-has-focus .label-md[floating],
  55. .input-has-focus .label-md[floating] {
  56. color: $label-md-text-color-focused;
  57. }
  58. .item-input-has-focus .label-md[floating],
  59. .input-has-focus .label-md[floating],
  60. .item-input-has-value .label-md[floating],
  61. .input-has-value .label-md[floating] {
  62. @include transform(translate3d(0, 0, 0), scale(.8));
  63. }
  64. .item-md.item-label-stacked [item-right], // deprecated
  65. .item-md.item-label-floating [item-right], // deprecated
  66. .item-md.item-label-stacked [item-end],
  67. .item-md.item-label-floating [item-end] {
  68. @include margin($item-md-padding-media-top - 2, null, $item-md-padding-media-bottom - 2, null);
  69. }
  70. // Generate Material Design Label colors
  71. // --------------------------------------------------
  72. @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
  73. .label-md-#{$color-name},
  74. .item-input .label-md-#{$color-name},
  75. .item-select .label-md-#{$color-name},
  76. .item-datetime .label-md-#{$color-name} {
  77. color: $color-base;
  78. }
  79. }