123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. @import "../../themes/ionic.globals.ios";
  2. // iOS Range
  3. // --------------------------------------------------
  4. /// @prop - Padding top/bottom of the range
  5. $range-ios-padding-vertical: 8px !default;
  6. /// @prop - Padding start/end of the range
  7. $range-ios-padding-horizontal: 16px !default;
  8. /// @prop - Height of the range slider
  9. $range-ios-slider-height: 42px !default;
  10. /// @prop - Width of the area that will select the range knob
  11. $range-ios-hit-width: 42px !default;
  12. /// @prop - Height of the area that will select the range knob
  13. $range-ios-hit-height: $range-ios-slider-height !default;
  14. /// @prop - Height of the range bar
  15. $range-ios-bar-height: 1px !default;
  16. /// @prop - Background of the range bar
  17. $range-ios-bar-background-color: #bdbdbd !default;
  18. /// @prop - Background of the active range bar
  19. $range-ios-bar-active-background-color: color($colors-ios, primary) !default;
  20. /// @prop - Width of the range knob
  21. $range-ios-knob-width: 28px !default;
  22. /// @prop - Height of the range knob
  23. $range-ios-knob-height: $range-ios-knob-width !default;
  24. /// @prop - Box shadow of the range knob
  25. $range-ios-knob-box-shadow: 0 3px 1px rgba(0, 0, 0, .1), 0 4px 8px rgba(0, 0, 0, .13), 0 0 0 1px rgba(0, 0, 0, .02) !default;
  26. /// @prop - Border radius of the range knob
  27. $range-ios-knob-border-radius: 50% !default;
  28. /// @prop - Background of the range knob
  29. $range-ios-knob-background-color: #fff !default;
  30. /// @prop - Width of the range tick
  31. $range-ios-tick-width: $range-ios-bar-height !default;
  32. /// @prop - Height of the range tick
  33. $range-ios-tick-height: 8px !default;
  34. /// @prop - Border radius of the range tick
  35. $range-ios-tick-border-radius: 0 !default;
  36. /// @prop - Background of the range tick
  37. $range-ios-tick-background-color: $range-ios-bar-background-color !default;
  38. /// @prop - Background of the active range tick
  39. $range-ios-tick-active-background-color: $range-ios-bar-active-background-color !default;
  40. /// @prop - Background of the range pin
  41. $range-ios-pin-background-color: transparent !default;
  42. /// @prop - Color of the range pin
  43. $range-ios-pin-color: $text-ios-color !default;
  44. /// @prop - Font size of the range pin
  45. $range-ios-pin-font-size: 12px !default;
  46. // deprecated
  47. $range-ios-pin-padding: null !default;
  48. /// @prop - Padding top of the range pin
  49. $range-ios-pin-padding-top: 8px !default;
  50. /// @prop - Padding end of the range pin
  51. $range-ios-pin-padding-end: $range-ios-pin-padding-top !default;
  52. /// @prop - Padding bottom of the range pin
  53. $range-ios-pin-padding-bottom: $range-ios-pin-padding-top !default;
  54. /// @prop - Padding start of the range pin
  55. $range-ios-pin-padding-start: $range-ios-pin-padding-end !default;
  56. .range-ios {
  57. @include padding($range-ios-padding-vertical, $range-ios-padding-horizontal);
  58. }
  59. .range-ios [range-left] {
  60. @include margin(0, 20px, 0, 0);
  61. }
  62. .range-ios [range-right] {
  63. @include margin(0, 0, 0, 20px);
  64. }
  65. .range-ios.range-has-pin {
  66. @include padding($range-ios-padding-vertical + $range-ios-pin-font-size, null, null, null);
  67. }
  68. .range-ios .range-slider {
  69. height: $range-ios-slider-height;
  70. }
  71. .range-ios .range-bar {
  72. @include position(($range-ios-slider-height / 2), null, null, 0);
  73. @include border-radius(1px);
  74. position: absolute;
  75. width: 100%;
  76. height: $range-ios-bar-height;
  77. background: $range-ios-bar-background-color;
  78. pointer-events: none;
  79. }
  80. .range-ios.range-pressed .range-bar-active {
  81. will-change: left, right;
  82. }
  83. .range-ios.range-pressed .range-knob-handle {
  84. will-change: left;
  85. }
  86. .range-ios .range-bar-active {
  87. bottom: 0;
  88. width: auto;
  89. background: $range-ios-bar-active-background-color;
  90. }
  91. .range-ios .range-knob-handle {
  92. @include position(($range-ios-slider-height / 2), null, null, 0);
  93. @include margin(-($range-ios-hit-height / 2), null, null, -($range-ios-hit-width / 2));
  94. @include text-align(center);
  95. position: absolute;
  96. width: $range-ios-hit-width;
  97. height: $range-ios-hit-height;
  98. }
  99. .range-ios .range-knob {
  100. @include position(($range-ios-hit-height / 2) - ($range-ios-knob-height / 2) + ($range-ios-bar-height / 2) - .5px,
  101. null, null, ($range-ios-hit-width / 2) - ($range-ios-knob-width / 2));
  102. @include border-radius($range-ios-knob-border-radius);
  103. position: absolute;
  104. width: $range-ios-knob-width;
  105. height: $range-ios-knob-height;
  106. background: $range-ios-knob-background-color;
  107. box-shadow: $range-ios-knob-box-shadow;
  108. pointer-events: none;
  109. }
  110. .range-ios .range-tick {
  111. @include margin-horizontal(-($range-ios-tick-width / 2), null);
  112. @include border-radius($range-ios-tick-border-radius);
  113. position: absolute;
  114. top: ($range-ios-hit-height / 2) - ($range-ios-tick-height / 2) + ($range-ios-bar-height / 2);
  115. width: $range-ios-tick-width;
  116. height: $range-ios-tick-height;
  117. background: $range-ios-tick-background-color;
  118. pointer-events: none;
  119. }
  120. .range-ios .range-tick-active {
  121. background: $range-ios-tick-active-background-color;
  122. }
  123. .range-ios .range-pin {
  124. @include text-align(center);
  125. @include border-radius(50px);
  126. @include transform(translate3d(0, 28px, 0), scale(.01));
  127. position: relative;
  128. top: -20px;
  129. display: inline-block;
  130. min-width: 28px;
  131. font-size: $range-ios-pin-font-size;
  132. color: $range-ios-pin-color;
  133. background: $range-ios-pin-background-color;
  134. transition: transform 120ms ease;
  135. @include deprecated-variable(padding, $range-ios-pin-padding) {
  136. @include padding($range-ios-pin-padding-top, $range-ios-pin-padding-end, $range-ios-pin-padding-bottom, $range-ios-pin-padding-start);
  137. }
  138. }
  139. .range-ios .range-knob-pressed .range-pin {
  140. @include transform(translate3d(0, 0, 0), scale(1));
  141. }
  142. .range-ios.range-disabled {
  143. opacity: .5;
  144. }
  145. // Generate iOS Range Colors
  146. // --------------------------------------------------
  147. @each $color-name, $color-base, $color-contrast in get-colors($colors-ios) {
  148. .range-ios-#{$color-name} {
  149. .range-bar-active,
  150. .range-tick-active {
  151. background: $color-base;
  152. }
  153. }
  154. }