ProgressBar.scss 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. /**
  2. * @class Ext.ProgressBar
  3. */
  4. /**
  5. * @var {number}
  6. * The height of the ProgressBar
  7. */
  8. $progress-height: dynamic(20px);
  9. /**
  10. * @var {color}
  11. * The border-color of the ProgressBar
  12. */
  13. $progress-border-color: dynamic($base-color);
  14. /**
  15. * @var {string}
  16. * The border-style of the ProgressBar
  17. */
  18. $progress-border-style: dynamic(solid);
  19. /**
  20. * @var {number}
  21. * The border-width of the ProgressBar
  22. */
  23. $progress-border-width: dynamic(1px);
  24. /**
  25. * @var {number}
  26. * The border-radius of the ProgressBar
  27. */
  28. $progress-border-radius: dynamic(0);
  29. /**
  30. * @var {color}
  31. * The border color of a focused ProgressBar
  32. */
  33. $progress-focus-border-color: dynamic($progress-border-color);
  34. /**
  35. * @var {string}
  36. * The border style of a focused ProgressBar
  37. */
  38. $progress-focus-border-style: dynamic($progress-border-style);
  39. /**
  40. * @var {number}
  41. * The border width of a focused ProgressBar
  42. */
  43. $progress-focus-border-width: dynamic($progress-border-width);
  44. /**
  45. * @var {color}
  46. * The background-color of the ProgressBar
  47. */
  48. $progress-background-color: dynamic($base-color);
  49. /**
  50. * @var {color}
  51. * The background-color of the ProgressBar's moving element
  52. */
  53. $progress-bar-background-color: dynamic($base-color);
  54. /**
  55. * @var {string/list}
  56. * The background-gradient of the ProgressBar's moving element. Can be either the name of
  57. * a predefined gradient or a list of color stops. Used as the `$type` parameter for
  58. * {@link Global_CSS#background-gradient}.
  59. */
  60. $progress-bar-background-gradient: dynamic('none');
  61. /**
  62. * @var {color}
  63. * The color of the ProgressBar's text when in front of the ProgressBar's moving element
  64. */
  65. $progress-text-front-color: dynamic(#fff);
  66. /**
  67. * @var {color}
  68. * The color of the ProgressBar's text when the ProgressBar's 'moving element is not under it
  69. */
  70. $progress-text-back-color: dynamic(#000);
  71. /**
  72. * @var {string}
  73. * The text-align of the ProgressBar's text
  74. */
  75. $progress-text-text-align: dynamic(center);
  76. /**
  77. * @var {number}
  78. * The font-size of the ProgressBar's text
  79. */
  80. $progress-text-font-size: dynamic($font-size);
  81. /**
  82. * @var {string}
  83. * The font-weight of the ProgressBar's text
  84. */
  85. $progress-text-font-weight: dynamic($font-weight-bold);
  86. /**
  87. * @var {string}
  88. * The font-family of the ProgressBar's text
  89. */
  90. $progress-text-font-family: dynamic($font-family);
  91. /**
  92. * @var {boolean}
  93. * True to include the "default" ProgressBar UI
  94. */
  95. $include-progress-default-ui: dynamic($include-default-uis);
  96. /**
  97. * Creates a visual theme for an Ext.ProgressBar
  98. *
  99. * @param {string} $ui
  100. * The name of the UI being created. Can not included spaces or special punctuation
  101. * (used in CSS class names).
  102. *
  103. * @param {color} [$ui-border-color=$progress-border-color]
  104. * The border-color of the ProgressBar
  105. *
  106. * @param {color} [$ui-background-color=$progress-background-color]
  107. * The background-color of the ProgressBar
  108. *
  109. * @param {color} [$ui-bar-background-color=$progress-bar-background-color]
  110. * The background-color of the ProgressBar's moving element
  111. *
  112. * @param {string/list} [$ui-bar-background-gradient=$progress-bar-background-gradient]
  113. * The background-gradient of the ProgressBar's moving element. Can be either the name of
  114. * a predefined gradient or a list of color stops. Used as the `$type` parameter for
  115. * {@link Global_CSS#background-gradient}.
  116. *
  117. * @param {color} [$ui-color-front=$progress-text-front-color]
  118. * The color of the ProgressBar's text when in front of the ProgressBar's moving element
  119. *
  120. * @param {color} [$ui-color-back=$progress-text-back-color]
  121. * The color of the ProgressBar's text when the ProgressBar's 'moving element is not under it
  122. *
  123. * @param {number} [$ui-height=$progress-height]
  124. * The height of the ProgressBar
  125. *
  126. * @param {string} [$ui-border-style=$progress-border-style]
  127. * The border-style of the ProgressBar
  128. *
  129. * @param {number} [$ui-border-width=$progress-border-width]
  130. * The border-width of the ProgressBar
  131. *
  132. * @param {number} [$ui-border-radius=$progress-border-radius]
  133. * The border-radius of the ProgressBar
  134. *
  135. * @param {color} [$ui-focus-border-color]
  136. * The border color of a focused ProgressBar
  137. *
  138. * @param {color} [$ui-focus-border-style]
  139. * The border style of a focused ProgressBar
  140. *
  141. * @param {color} [$ui-focus-border-width]
  142. * The border width of a focused ProgressBar
  143. *
  144. * @param {string} [$ui-text-text-align=$progress-text-text-align]
  145. * The text-align of the ProgressBar's text
  146. *
  147. * @param {number} [$ui-text-font-size=$progress-text-font-size]
  148. * The font-size of the ProgressBar's text
  149. *
  150. * @param {string} [$ui-text-font-weight=$progress-text-font-weight]
  151. * The font-weight of the ProgressBar's text
  152. *
  153. * @param {string} [$ui-text-font-family=$progress-text-font-family]
  154. * The font-family of the ProgressBar's text
  155. *
  156. * @param {string} [$ui-label=null]
  157. * The ui label. **Deprecated**, please use $ui instead
  158. *
  159. * @member Ext.ProgressBar
  160. */
  161. @mixin extjs-progress-ui(
  162. $ui: null,
  163. $ui-border-color: $progress-border-color,
  164. $ui-background-color: $progress-background-color,
  165. $ui-bar-background-color: $progress-bar-background-color,
  166. $ui-bar-background-gradient: $progress-bar-background-gradient,
  167. $ui-color-front: $progress-text-front-color,
  168. $ui-color-back: $progress-text-back-color,
  169. $ui-height: $progress-height,
  170. $ui-border-style: $progress-border-style,
  171. $ui-border-width: $progress-border-width,
  172. $ui-border-radius: $progress-border-radius,
  173. $ui-focus-border-color: $progress-focus-border-color,
  174. $ui-focus-border-style: $progress-focus-border-style,
  175. $ui-focus-border-width: $progress-focus-border-width,
  176. $ui-text-text-align: $progress-text-text-align,
  177. $ui-text-font-size: $progress-text-font-size,
  178. $ui-text-font-weight: $progress-text-font-weight,
  179. $ui-text-font-family: $progress-text-font-family,
  180. // deprecated - use $ui instead
  181. $ui-label: null
  182. ){
  183. @if $ui == null {
  184. @if $ui-label != null {
  185. @warn '$ui-label is deprecated. Use $ui instead';
  186. $ui: $ui-label;
  187. } @else {
  188. // No @error "$ui is required";
  189. // See https://gist.github.com/MoOx/1671259
  190. @warn "#{error("$ui is required")}";
  191. }
  192. }
  193. $progress-content-height: $ui-height - vertical($ui-border-width);
  194. .#{$prefix}progress-#{$ui} {
  195. background-color: $ui-background-color;
  196. border-width: $ui-border-width;
  197. height: $ui-height;
  198. @if $ui-border-radius != 0 {
  199. @include border-radius($ui-border-radius);
  200. }
  201. @if not is-null($ui-border-color) {
  202. border-color: $ui-border-color;
  203. }
  204. @if not is-null($ui-border-style) {
  205. border-style: $ui-border-style;
  206. }
  207. .#{$prefix}progress-bar-#{$ui} {
  208. @if $ui-border-radius != 0 {
  209. @include border-radius($ui-border-radius);
  210. }
  211. @if not is-null($ui-bar-background-color) {
  212. @include background-gradient($ui-bar-background-color, $ui-bar-background-gradient);
  213. }
  214. @if $include-slicer-gradient and not is-null($ui-bar-background-gradient) {
  215. .#{$prefix}nlg & {
  216. background: repeat-x;
  217. background-image: slicer-background-image(progress-bar-#{$ui}, 'progress/progress-#{$ui}-bg');
  218. }
  219. }
  220. }
  221. .#{$prefix}progress-text {
  222. color: $ui-color-front;
  223. font-weight: $ui-text-font-weight;
  224. font-size: $ui-text-font-size;
  225. font-family: $ui-text-font-family;
  226. text-align: $ui-text-text-align;
  227. line-height: $progress-content-height;
  228. }
  229. .#{$prefix}progress-text-back {
  230. color: $ui-color-back;
  231. line-height: $progress-content-height;
  232. }
  233. &.#{$prefix}progress-focus {
  234. .#{$prefix}keyboard-mode & {
  235. @include css-outline(
  236. $width: $ui-focus-border-width,
  237. $style: $ui-focus-border-style,
  238. $color: $ui-focus-border-color,
  239. $offset: -$ui-focus-border-width,
  240. $pseudo: true
  241. );
  242. }
  243. }
  244. }
  245. $stretch: slicer-background-stretch(progress-bar-#{$ui}, bottom);
  246. @include x-slicer(progress-bar-#{$ui});
  247. @if $include-ext-view-table {
  248. // here we need to add three selectors, one for the progress classic component (xtype: 'pogressbar')
  249. // and one for each progressbarwidget alias (xtype: ['progress', 'progressbarwidget']).
  250. .#{$prefix}progressbar-#{$ui}-cell,
  251. .#{$prefix}progress-#{$ui}-cell,
  252. .#{$prefix}progressbarwidget-#{$ui}-cell {
  253. > .#{$prefix}grid-cell-inner {
  254. padding-top: max(ceil(($grid-row-height - $ui-height) / 2), 0);
  255. padding-bottom: max(floor(($grid-row-height - $ui-height) / 2), 0);
  256. .#{$prefix}progress-#{$ui} {
  257. height: min($progress-height, $grid-row-height - 2);
  258. }
  259. }
  260. }
  261. }
  262. }