Thumb.scss 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. /**
  2. * @class Ext.slider.Thumb
  3. */
  4. /**
  5. * @var {number}
  6. * Thumb height
  7. */
  8. $thumb-height: dynamic(15px);
  9. /**
  10. * @var {number}
  11. * Thumb height in the {@link Global_CSS#$enable-big big} sizing scheme
  12. */
  13. $thumb-height-big: dynamic(28px);
  14. /**
  15. * @var {number}
  16. * Thumb width
  17. */
  18. $thumb-width: dynamic(15px);
  19. /**
  20. * @var {number}
  21. * Thumb width in the {@link Global_CSS#$enable-big big} sizing scheme
  22. */
  23. $thumb-width-big: dynamic(28px);
  24. /**
  25. * @var {color}
  26. * Thumb background-color
  27. */
  28. $thumb-background-color: dynamic($slider-track-background-color);
  29. /**
  30. * @var {color}
  31. * Thumb background-color when hovered
  32. */
  33. $thumb-hovered-background-color: dynamic(null);
  34. /**
  35. * @var {color}
  36. * Thumb background-color when pressed
  37. */
  38. $thumb-pressed-background-color: dynamic(null);
  39. /**
  40. * @var {color}
  41. * Thumb background-color when disabled
  42. */
  43. $thumb-disabled-background-color: dynamic(null);
  44. /**
  45. * @var {number/list}
  46. * Thumb border-width
  47. */
  48. $thumb-border-width: dynamic(1px);
  49. /**
  50. * @var {string/list}
  51. * Thumb border-style
  52. */
  53. $thumb-border-style: dynamic(solid);
  54. /**
  55. * @var {color/list}
  56. * Thumb border-color
  57. */
  58. $thumb-border-color: dynamic($neutral-medium-dark-color);
  59. /**
  60. * @var {number}
  61. * Thumb border-radius
  62. */
  63. $thumb-border-radius: dynamic($thumb-height / 2);
  64. /**
  65. * @var {number}
  66. * Thumb border-radius in the {@link Global_CSS#$enable-big big} sizing scheme
  67. */
  68. $thumb-border-radius-big: dynamic($thumb-height-big / 2);
  69. /**
  70. * @var {string}
  71. * Thumb icon
  72. */
  73. $thumb-icon: dynamic($fa-var-circle);
  74. /**
  75. * @var {color}
  76. * Thumb icon color
  77. */
  78. $thumb-icon-color: dynamic($highlight-color);
  79. /**
  80. * @var {number}
  81. * Thumb icon size
  82. */
  83. $thumb-icon-size: dynamic(7px);
  84. /**
  85. * @var {number}
  86. * Thumb icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  87. */
  88. $thumb-icon-size-big: dynamic(12px);
  89. /**
  90. * @var {number}
  91. * Thumb icon font-size
  92. */
  93. $thumb-icon-font-size: dynamic(null);
  94. /**
  95. * @var {number}
  96. * Thumb icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  97. */
  98. $thumb-icon-font-size-big: dynamic(null);
  99. /**
  100. * @var {list}
  101. * Thumb box-shadow
  102. */
  103. $thumb-box-shadow: dynamic(1px 1px 2px $neutral-dark-color);
  104. /**
  105. * @var {list}
  106. * Thumb box-shadow in the {@link Global_CSS#$enable-big big} sizing scheme
  107. */
  108. $thumb-box-shadow-big: dynamic($thumb-box-shadow);
  109. /**
  110. * @var {map}
  111. * Parameters for the "toggle-on" thumb UI.
  112. * Set to `null` to eliminate the UI from the CSS output.
  113. */
  114. $thumb-toggle-on-ui: dynamic(null);
  115. /**
  116. * @var {map}
  117. * Parameters for the "toggle-off" thumb UI.
  118. * Set to `null` to eliminate the UI from the CSS output.
  119. */
  120. $thumb-toggle-off-ui: dynamic(null);
  121. /**
  122. * Creates a visual theme for a Thumb.
  123. *
  124. * @param {string} $ui
  125. * The name of the UI being created. Can not included spaces or special punctuation
  126. * (used in CSS class names).
  127. *
  128. * @param {number} $height
  129. * Thumb height
  130. *
  131. * @param {number} $height-big
  132. * Thumb height in the {@link Global_CSS#$enable-big big} sizing scheme
  133. *
  134. * @param {number} $width
  135. * Thumb width
  136. *
  137. * @param {number} $width-big
  138. * Thumb width in the {@link Global_CSS#$enable-big big} sizing scheme
  139. *
  140. * @param {color} $background-color
  141. * Thumb background-color
  142. *
  143. * @param {color} $hovered-background-color
  144. * Thumb background-color when hovered
  145. *
  146. * @param {color} $pressed-background-color
  147. * Thumb background-color when pressed
  148. *
  149. * @param {color} $disabled-background-color
  150. * Thumb background-color when disabled
  151. *
  152. * @param {number/list} $border-width
  153. * Thumb border-width
  154. *
  155. * @param {string/list} $border-style
  156. * Thumb border-style
  157. *
  158. * @param {color/list} $border-color
  159. * Thumb border-color
  160. *
  161. * @param {number} $border-radius
  162. * Thumb border-radius
  163. *
  164. * @param {number} $border-radius-big
  165. * Thumb border-radius in the {@link Global_CSS#$enable-big big} sizing scheme
  166. *
  167. * @param {string/list} $icon
  168. * Thumb icon
  169. *
  170. * @param {color} $icon-color
  171. * Thumb icon color
  172. *
  173. * @param {number} $icon-size
  174. * Thumb icon size
  175. *
  176. * @param {number} $icon-size-big
  177. * Thumb icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  178. *
  179. * @param {number} $icon-font-size
  180. * Thumb icon font-size
  181. *
  182. * @param {number} $icon-font-size-big
  183. * Thumb icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  184. *
  185. * @param {list} $box-shadow
  186. * Thumb box-shadow
  187. *
  188. * @param {list} $box-shadow-big
  189. * Thumb box-shadow in the {@link Global_CSS#$enable-big big} sizing scheme
  190. */
  191. @mixin thumb-ui(
  192. $ui: null,
  193. $height: null,
  194. $height-big: null,
  195. $width: null,
  196. $width-big: null,
  197. $background-color: null,
  198. $hovered-background-color: null,
  199. $pressed-background-color: null,
  200. $disabled-background-color: null,
  201. $border-width: null,
  202. $border-style: null,
  203. $border-color: null,
  204. $border-radius: null,
  205. $border-radius-big: null,
  206. $icon: null,
  207. $icon-color: null,
  208. $icon-size: null,
  209. $icon-size-big: null,
  210. $icon-font-size: null,
  211. $icon-font-size-big: null,
  212. $box-shadow: null,
  213. $box-shadow-big: null
  214. ) {
  215. $ui-suffix: ui-suffix($ui);
  216. .#{$prefix}thumb#{$ui-suffix} {
  217. height: $height;
  218. width: $width;
  219. background-color: $background-color;
  220. border-radius: $border-radius;
  221. box-shadow: $box-shadow;
  222. @if $height != null {
  223. margin-top: -$height / 2;
  224. }
  225. @include border($border-width, $border-style, $border-color);
  226. @if $enable-big {
  227. .#{$prefix}big & {
  228. height: $height-big;
  229. width: $width-big;
  230. box-shadow: $box-shadow-big;
  231. margin-top: -($height-big or $thumb-height-big) / 2;
  232. @include border-radius($border-radius-big);
  233. }
  234. }
  235. .#{$prefix}icon-el {
  236. @include icon(
  237. $icon: $icon,
  238. $color: $icon-color,
  239. $size: $icon-size,
  240. $size-big: $icon-size-big,
  241. $font-size: $icon-font-size,
  242. $font-size-big: $icon-font-size-big
  243. );
  244. }
  245. &:hover {
  246. background-color: $hovered-background-color;
  247. }
  248. &:active {
  249. background-color: $pressed-background-color;
  250. }
  251. &.#{$prefix}disabled {
  252. background-color: $disabled-background-color;
  253. }
  254. }
  255. // This element ensures the containing slider is at least as high as its largest thumb
  256. .#{$prefix}thumb-sizer#{$ui-suffix} {
  257. height: $height;
  258. @if $enable-big {
  259. .#{$prefix}big & {
  260. height: $height-big;
  261. }
  262. }
  263. }
  264. }