label.wp.scss 2.2KB

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