Abstract.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. /**
  2. * @class Ext.dataview.Abstract
  3. */
  4. /**
  5. * @var {color}
  6. * DataView background-color
  7. */
  8. $dataview-background-color: dynamic($background-color);
  9. /**
  10. * @var {color}
  11. * DataView Item text color
  12. */
  13. $dataview-item-color: dynamic($color);
  14. /**
  15. * @var {color}
  16. * DataView Item text color when hovered
  17. */
  18. $dataview-item-hovered-color: dynamic(null);
  19. /**
  20. * @var {color}
  21. * DataView Item text color when selected
  22. */
  23. $dataview-item-selected-color: dynamic(null);
  24. /**
  25. * @var {color}
  26. * DataView Item text color when pressed
  27. */
  28. $dataview-item-pressed-color: dynamic(null);
  29. /**
  30. * @var {color}
  31. * DataView Item background-color
  32. */
  33. $dataview-item-background-color: dynamic($background-color);
  34. /**
  35. * @var {color}
  36. * background-color for `striped` DataView Items
  37. */
  38. $dataview-item-alt-background-color: dynamic(darken($dataitem-background-color, 2));
  39. /**
  40. * @var {color}
  41. * DataView Item background-color when hovered
  42. */
  43. $dataview-item-hovered-background-color: dynamic(mix(#fff, $base-light-color, 65%));
  44. /**
  45. * @var {color}
  46. * DataView Item background-color when selected
  47. */
  48. $dataview-item-selected-background-color: dynamic(mix(#fff, $base-light-color, 25%));
  49. /**
  50. * @var {color}
  51. * DataView Item background-color when pressed
  52. */
  53. $dataview-item-pressed-background-color: dynamic(null);
  54. /**
  55. * @var {number}
  56. * DataView Item border-width
  57. */
  58. $dataview-item-border-width: dynamic(null);
  59. /**
  60. * @var {string}
  61. * DataView Item border-style
  62. */
  63. $dataview-item-border-style: dynamic(null);
  64. /**
  65. * @var {color}
  66. * DataView Item border-color
  67. */
  68. $dataview-item-border-color: dynamic(null);
  69. /**
  70. * @var {color}
  71. * DataView Item border-color when hovered
  72. */
  73. $dataview-item-hovered-border-color: dynamic(null);
  74. /**
  75. * @var {color}
  76. * DataView Item border-color when selected
  77. */
  78. $dataview-item-selected-border-color: dynamic(null);
  79. /**
  80. * @var {color}
  81. * DataView Item border-color when pressed
  82. */
  83. $dataview-item-pressed-border-color: dynamic(null);
  84. /**
  85. * @var {number}
  86. * DataView Item outline-width when focused
  87. */
  88. $dataview-item-focused-outline-width: dynamic(1px);
  89. /**
  90. * @var {string}
  91. * DataView Item outline-style when focused
  92. */
  93. $dataview-item-focused-outline-style: dynamic(solid);
  94. /**
  95. * @var {color}
  96. * DataView Item outline-color when focused
  97. */
  98. $dataview-item-focused-outline-color: dynamic($base-color);
  99. /**
  100. * @var {number}
  101. * DataView Item outline-offset when focused
  102. */
  103. $dataview-item-focused-outline-offset: dynamic(-$dataview-item-focused-outline-width);
  104. /**
  105. * @var {string/number}
  106. * DataView Item font-weight
  107. */
  108. $dataview-item-font-weight: dynamic($font-weight-normal);
  109. /**
  110. * @var {number}
  111. * DataView Item font-size
  112. */
  113. $dataview-item-font-size: dynamic($font-size);
  114. /**
  115. * @var {number}
  116. * DataView Item font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  117. */
  118. $dataview-item-font-size-big: dynamic($font-size-big);
  119. /**
  120. * @var {number}
  121. * DataView Item line-height
  122. */
  123. $dataview-item-line-height: dynamic(16px);
  124. /**
  125. * @var {number}
  126. * DataView Item line-height in the {@link Global_CSS#$enable-big big} sizing scheme
  127. */
  128. $dataview-item-line-height-big: dynamic(18px);
  129. /**
  130. * @var {string}
  131. * DataView Item font-family
  132. */
  133. $dataview-item-font-family: dynamic($font-family);
  134. /**
  135. * @var {number/list}
  136. * DataView Item padding
  137. */
  138. $dataview-item-padding: dynamic(null);
  139. /**
  140. * @var {number/list}
  141. * DataView Item padding in the {@link Global_CSS#$enable-big big} sizing scheme
  142. */
  143. $dataview-item-padding-big: dynamic(null);
  144. /**
  145. * @var {map}
  146. * Parameters for the "default" DataView UI.
  147. * Set to `null` to eliminate the UI from the CSS output.
  148. */
  149. $dataview-default-ui: dynamic((
  150. item-color: $dataview-item-color,
  151. item-hovered-color: $dataview-item-hovered-color,
  152. item-selected-color: $dataview-item-selected-color,
  153. item-pressed-color: $dataview-item-pressed-color,
  154. item-background-color: $dataview-item-background-color,
  155. item-alt-background-color: $dataview-item-alt-background-color,
  156. item-hovered-background-color: $dataview-item-hovered-background-color,
  157. item-selected-background-color: $dataview-item-selected-background-color,
  158. item-pressed-background-color: $dataview-item-pressed-background-color,
  159. item-border-width: $dataview-item-border-width,
  160. item-border-style: $dataview-item-border-style,
  161. item-border-color: $dataview-item-border-color,
  162. item-hovered-border-color: $dataview-item-hovered-border-color,
  163. item-selected-border-color: $dataview-item-selected-border-color,
  164. item-pressed-border-color: $dataview-item-pressed-border-color,
  165. item-focused-outline-width: $dataview-item-focused-outline-width,
  166. item-focused-outline-style: $dataview-item-focused-outline-style,
  167. item-focused-outline-color: $dataview-item-focused-outline-color,
  168. item-focused-outline-offset: $dataview-item-focused-outline-offset,
  169. item-font-weight: $dataview-item-font-weight,
  170. item-font-size: $dataview-item-font-size,
  171. item-font-size-big: $dataview-item-font-size-big,
  172. item-line-height: $dataview-item-line-height,
  173. item-line-height-big: $dataview-item-line-height-big,
  174. item-font-family: $dataview-item-font-family,
  175. item-padding: $dataview-item-padding,
  176. item-padding-big: $dataview-item-padding-big
  177. ));
  178. /**
  179. * Creates a visual theme for a DataView.
  180. *
  181. * @param {string} $ui
  182. * The name of the UI being created. Can not included spaces or special punctuation
  183. * (used in CSS class names).
  184. *
  185. * @param {String} [$xtype=dataview] (protected) The {@link Ext.Class#xtype} to use
  186. * in CSS selectors. For use by UI mixins of derived classes.
  187. *
  188. * @param {color} $background-color
  189. * DataView background-color
  190. *
  191. * @param {color} $item-color
  192. * DataView Item text color
  193. *
  194. * @param {color} $item-hovered-color
  195. * DataView Item text color when hovered
  196. *
  197. * @param {color} $item-selected-color
  198. * DataView Item text color when selected
  199. *
  200. * @param {color} $item-pressed-color
  201. * DataView Item text color when pressed
  202. *
  203. * @param {color} $item-background-color
  204. * DataView Item background-color
  205. *
  206. * @param {color} $item-alt-background-color
  207. * background-color for `striped` DataView Items
  208. *
  209. * @param {color} $item-hovered-background-color
  210. * DataView Item background-color when hovered
  211. *
  212. * @param {color} $item-selected-background-color
  213. * DataView Item background-color when selected
  214. *
  215. * @param {color} $item-pressed-background-color
  216. * DataView Item background-color when pressed
  217. *
  218. * @param {number} $item-border-width
  219. * DataView Item border-width
  220. *
  221. * @param {string} $item-border-style
  222. * DataView Item border-style
  223. *
  224. * @param {color} $item-border-color
  225. * DataView Item border-color
  226. *
  227. * @param {color} $item-hovered-border-color
  228. * DataView Item border-color when hovered
  229. *
  230. * @param {color} $item-selected-border-color
  231. * DataView Item border-color when selected
  232. *
  233. * @param {color} $item-pressed-border-color
  234. * DataView Item border-color when pressed
  235. *
  236. * @param {number} $item-focused-outline-width
  237. * DataView outline-width when focused
  238. *
  239. * @param {string} $item-focused-outline-style
  240. * DataView outline-style when focused
  241. *
  242. * @param {color} $item-focused-outline-color
  243. * DataView outline-color when focused
  244. *
  245. * @param {number} $item-focused-outline-offset
  246. * DataView outline-offset when focused
  247. *
  248. * @param {string/number} $item-font-weight
  249. * DataView Item font-weight
  250. *
  251. * @param {number} $item-font-size
  252. * DataView Item font-size
  253. *
  254. * @param {number} $item-font-size-big
  255. * DataView Item font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  256. *
  257. * @param {number} $item-line-height
  258. * DataView Item line-height
  259. *
  260. * @param {number} $item-line-height-big
  261. * DataView Item line-height in the {@link Global_CSS#$enable-big big} sizing scheme
  262. *
  263. * @param {string} $item-font-family
  264. * DataView Item font-family
  265. *
  266. * @param {number/list} $item-padding
  267. * DataView Item padding
  268. *
  269. * @param {number/list} $item-padding-big
  270. * DataView Item padding in the {@link Global_CSS#$enable-big big} sizing scheme
  271. */
  272. @mixin dataview-ui(
  273. $ui: null,
  274. $xtype: dataview,
  275. $background-color: null,
  276. $item-color: null,
  277. $item-hovered-color: null,
  278. $item-selected-color: null,
  279. $item-pressed-color: null,
  280. $item-background-color: null,
  281. $item-alt-background-color: null,
  282. $item-hovered-background-color: null,
  283. $item-selected-background-color: null,
  284. $item-pressed-background-color: null,
  285. $item-border-width: null,
  286. $item-border-style: null,
  287. $item-border-color: null,
  288. $item-hovered-border-color: null,
  289. $item-selected-border-color: null,
  290. $item-pressed-border-color: null,
  291. $item-focused-outline-width: null,
  292. $item-focused-outline-style: null,
  293. $item-focused-outline-color: null,
  294. $item-focused-outline-offset: null,
  295. $item-font-weight: null,
  296. $item-font-size: null,
  297. $item-font-size-big: null,
  298. $item-line-height: null,
  299. $item-line-height-big: null,
  300. $item-font-family: null,
  301. $item-padding: null,
  302. $item-padding-big: null
  303. ) {
  304. $ui-suffix: ui-suffix($ui);
  305. .#{$prefix}#{$xtype}#{$ui-suffix} {
  306. background-color: $background-color;
  307. }
  308. .#{$prefix}#{$xtype}#{$ui-suffix}-body-el > .#{$prefix}dataview-item {
  309. color: $item-color;
  310. background-color: $item-background-color;
  311. @include border($item-border-width, $item-border-style, $item-border-color);
  312. @include font($item-font-weight, $item-font-size, $item-line-height, $item-font-family);
  313. padding: $item-padding;
  314. @if $enable-big {
  315. .#{$prefix}big & {
  316. font-size: $item-font-size-big;
  317. line-height: $item-line-height-big;
  318. padding: $item-padding-big;
  319. }
  320. }
  321. &.#{$prefix}odd {
  322. background-color: $item-alt-background-color;
  323. }
  324. &.#{$prefix}hovered {
  325. color: $item-hovered-color;
  326. background-color: $item-hovered-background-color;
  327. border-color: $item-hovered-border-color;
  328. }
  329. &.#{$prefix}pressed {
  330. color: $item-pressed-color;
  331. background-color: $item-pressed-background-color;
  332. border-color: $item-pressed-border-color;
  333. }
  334. &.#{$prefix}focused {
  335. .#{$prefix}keyboard-mode & {
  336. @include outline(
  337. $width: $item-focused-outline-width,
  338. $style: $item-focused-outline-style,
  339. $color: $item-focused-outline-color,
  340. $offset: $item-focused-outline-offset,
  341. $border-width: $item-border-width
  342. );
  343. }
  344. }
  345. }
  346. .#{$prefix}#{$xtype}#{$ui-suffix}-body-el.#{$prefix}show-selection {
  347. > .#{$prefix}dataview-item.#{$prefix}selected {
  348. color: $item-selected-color;
  349. background-color: $item-selected-background-color;
  350. border-color: $item-selected-border-color;
  351. }
  352. }
  353. }