Item.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. /**
  2. * @class Ext.menu.Item
  3. */
  4. /**
  5. * @var {color}
  6. * Menu Item text color
  7. */
  8. $menuitem-color: dynamic($color);
  9. /**
  10. * @var {color}
  11. * Menu Item text color when active
  12. */
  13. $menuitem-active-color: dynamic(null);
  14. /**
  15. * @var {color}
  16. * Menu Item text color when disabled
  17. */
  18. $menuitem-disabled-color: dynamic(null);
  19. /**
  20. * @var {color}
  21. * Menu Item background-color
  22. */
  23. $menuitem-background-color: dynamic(null);
  24. /**
  25. * @var {color}
  26. * Menu Item background-color when active
  27. */
  28. $menuitem-active-background-color: dynamic(mix(#fff, $base-light-color, 50%));
  29. /**
  30. * @var {color}
  31. * Menu Item background-color when disabled
  32. */
  33. $menuitem-disabled-background-color: dynamic(null);
  34. /**
  35. * @var {string/number}
  36. * Menu Item font-weight
  37. */
  38. $menuitem-font-weight: dynamic($font-weight);
  39. /**
  40. * @var {number}
  41. * Menu Item font-size
  42. */
  43. $menuitem-font-size: dynamic($font-size);
  44. /**
  45. * @var {number}
  46. * Menu Item font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  47. */
  48. $menuitem-font-size-big: dynamic($font-size-big);
  49. /**
  50. * @var {string}
  51. * Menu Item font-family
  52. */
  53. $menuitem-font-family: dynamic($font-family);
  54. /**
  55. * @var {number}
  56. * Menu Item height
  57. */
  58. $menuitem-height: dynamic(24px);
  59. /**
  60. * @var {number}
  61. * Menu Item height in the {@link Global_CSS#$enable-big big} sizing scheme
  62. */
  63. $menuitem-height-big: dynamic(32px);
  64. /**
  65. * @var {string}
  66. * Menu Item cursor
  67. */
  68. $menuitem-cursor: dynamic(pointer);
  69. /**
  70. * @var {string}
  71. * Menu Item cursor when disabled
  72. */
  73. $menuitem-disabled-cursor: dynamic(default);
  74. /**
  75. * @var {number}
  76. * Menu item outline-width when focused
  77. */
  78. $menuitem-focused-outline-width: dynamic(1px);
  79. /**
  80. * @var {string}
  81. * Menu item outline-style when focused
  82. */
  83. $menuitem-focused-outline-style: dynamic(solid);
  84. /**
  85. * @var {color}
  86. * Menu item outline-color when focused
  87. */
  88. $menuitem-focused-outline-color: dynamic($base-color);
  89. /**
  90. * @var {color}
  91. * Menu item outline-offset when focused
  92. */
  93. $menuitem-focused-outline-offset: dynamic(-$menuitem-focused-outline-width);
  94. /**
  95. * @var {number}
  96. * The opacity of disabled {@link Ext.menu.Item Menu Items}
  97. */
  98. $menuitem-disabled-opacity: dynamic(.5);
  99. /**
  100. * @var {color}
  101. * Menu Item icon color
  102. */
  103. $menuitem-icon-color: dynamic(#808080);
  104. /**
  105. * @var {color}
  106. * Menu Item icon color when active
  107. */
  108. $menuitem-active-icon-color: dynamic($menuitem-active-color);
  109. /**
  110. * @var {color}
  111. * Menu Item icon color when disabled
  112. */
  113. $menuitem-disabled-icon-color: dynamic(null);
  114. /**
  115. * @var {number}
  116. * Menu Item icon size
  117. */
  118. $menuitem-icon-size: dynamic(16px);
  119. /**
  120. * @var {number}
  121. * Menu Item icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  122. */
  123. $menuitem-icon-size-big: dynamic(20px);
  124. /**
  125. * @var {number}
  126. * Menu Item icon font-size
  127. */
  128. $menuitem-icon-font-size: dynamic(null);
  129. /**
  130. * @var {number}
  131. * Menu Item icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  132. */
  133. $menuitem-icon-font-size-big: dynamic(null);
  134. /**
  135. * @var {string}
  136. * Menu Item arrow icon
  137. */
  138. $menuitem-arrow-icon: dynamic($fa-var-caret-right);
  139. /**
  140. * @var {color}
  141. * Menu Item arrow icon color
  142. */
  143. $menuitem-arrow-icon-color: dynamic($menuitem-icon-color);
  144. /**
  145. * @var {color}
  146. * Menu Item arrow icon color when active
  147. */
  148. $menuitem-active-arrow-icon-color: dynamic($menuitem-active-icon-color);
  149. /**
  150. * @var {color}
  151. * Menu Item arrow icon color when disabled
  152. */
  153. $menuitem-disabled-arrow-icon-color: dynamic($menuitem-disabled-icon-color);
  154. /**
  155. * @var {number}
  156. * Menu Item arrow icon size
  157. */
  158. $menuitem-arrow-icon-size: dynamic($menuitem-icon-size);
  159. /**
  160. * @var {number}
  161. * Menu Item arrow icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  162. */
  163. $menuitem-arrow-icon-size-big: dynamic($menuitem-icon-size-big);
  164. /**
  165. * @var {number}
  166. * Menu Item arrow icon font-size
  167. */
  168. $menuitem-arrow-icon-font-size: dynamic(null);
  169. /**
  170. * @var {number}
  171. * Menu Item arrow icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  172. */
  173. $menuitem-arrow-icon-font-size-big: dynamic(null);
  174. /**
  175. * @var {number/list}
  176. * Menu Item arrow icon margin
  177. */
  178. $menuitem-arrow-icon-margin: dynamic(0 7px);
  179. /**
  180. * @var {number/list}
  181. * Menu Item arrow icon margin in the {@link Global_CSS#$enable-big big} sizing scheme
  182. */
  183. $menuitem-arrow-icon-margin-big: dynamic(0 10px);
  184. /**
  185. * Creates a visual theme for a Menu Item.
  186. *
  187. * @param {string} $ui
  188. * The name of the UI being created. Can not included spaces or special punctuation
  189. * (used in CSS class names).
  190. *
  191. * @param {String} [$xtype=menuitem] (protected) The {@link Ext.Class#xtype} to use
  192. * in CSS selectors. For use by UI mixins of derived classes.
  193. *
  194. * @param {color} $color
  195. * Menu Item text color
  196. *
  197. * @param {color} $active-color
  198. * Menu Item text color when active
  199. *
  200. * @param {color} $disabled-color
  201. * Menu Item text color when disabled
  202. *
  203. * @param {color} $background-color
  204. * Menu Item background-color
  205. *
  206. * @param {color} $active-background-color
  207. * Menu Item background-color when active
  208. *
  209. * @param {color} $disabled-background-color
  210. * Menu Item background-color when disabled
  211. *
  212. * @param {string/number} $font-weight
  213. * Menu Item font-weight
  214. *
  215. * @param {number} $font-size
  216. * Menu Item font-size
  217. *
  218. * @param {number} $font-size-big
  219. * Menu Item font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  220. *
  221. * @param {string} $font-family
  222. * Menu Item font-family
  223. *
  224. * @param {number} $height
  225. * Menu Item height
  226. *
  227. * @param {number} $height-big
  228. * Menu Item height in the {@link Global_CSS#$enable-big big} sizing scheme
  229. *
  230. * @param {string} $cursor
  231. * Menu Item cursor
  232. *
  233. * @param {string} $disabled-cursor
  234. * Menu Item cursor when disabled
  235. *
  236. * @param {number} $focused-outline-width
  237. * Menu item outline-width when focused
  238. *
  239. * @param {string} $focused-outline-style
  240. * Menu item outline-style when focused
  241. *
  242. * @param {color} $focused-outline-color
  243. * Menu item outline-color when focused
  244. *
  245. * @param {color} $focused-outline-offset
  246. * Menu item outline-offset when focused
  247. *
  248. * @param {number} $disabled-opacity
  249. * The opacity of disabled {@link Ext.menu.Item Menu Items}
  250. *
  251. * @param {color} $icon-color
  252. * Menu Item icon color
  253. *
  254. * @param {color} $active-icon-color
  255. * Menu Item icon color when active
  256. *
  257. * @param {color} $disabled-icon-color
  258. * Menu Item icon color when disabled
  259. *
  260. * @param {number} $icon-size
  261. * Menu Item icon size
  262. *
  263. * @param {number} $icon-size-big
  264. * Menu Item icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  265. *
  266. * @param {number} $icon-font-size
  267. * Menu Item icon font-size
  268. *
  269. * @param {number} $icon-font-size-big
  270. * Menu Item icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  271. *
  272. * @param {string} $arrow-icon
  273. * Menu Item arrow icon
  274. *
  275. * @param {color} $arrow-icon-color
  276. * Menu Item arrow icon color
  277. *
  278. * @param {color} $active-arrow-icon-color
  279. * Menu Item arrow icon color when active
  280. *
  281. * @param {color} $disabled-arrow-icon-color
  282. * Menu Item arrow icon color when disabled
  283. *
  284. * @param {number} $arrow-icon-size
  285. * Menu Item arrow icon size
  286. *
  287. * @param {number} $arrow-icon-size-big
  288. * Menu Item arrow icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  289. *
  290. * @param {number} $arrow-icon-font-size
  291. * Menu Item arrow icon font-size
  292. *
  293. * @param {number} $arrow-icon-font-size-big
  294. * Menu Item arrow icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  295. *
  296. * @param {number/list} $arrow-icon-margin
  297. * Menu Item arrow icon margin
  298. *
  299. * @param {number/list} $arrow-icon-margin-big
  300. * Menu Item arrow icon margin in the {@link Global_CSS#$enable-big big} sizing scheme
  301. */
  302. @mixin menuitem-ui(
  303. $ui: null,
  304. $xtype: menuitem,
  305. $color: null,
  306. $active-color: null,
  307. $disabled-color: null,
  308. $background-color: null,
  309. $active-background-color: null,
  310. $disabled-background-color: null,
  311. $font-weight: null,
  312. $font-size: null,
  313. $font-size-big: null,
  314. $font-family: null,
  315. $height: null,
  316. $height-big: null,
  317. $cursor: null,
  318. $disabled-cursor: null,
  319. $focused-outline-width: null,
  320. $focused-outline-style: null,
  321. $focused-outline-color: null,
  322. $focused-outline-offset: null,
  323. $disabled-opacity: null,
  324. $icon-color: null,
  325. $active-icon-color: null,
  326. $disabled-icon-color: null,
  327. $icon-size: null,
  328. $icon-size-big: null,
  329. $icon-font-size: null,
  330. $icon-font-size-big: null,
  331. $arrow-icon: null,
  332. $arrow-icon-color: null,
  333. $active-arrow-icon-color: null,
  334. $disabled-arrow-icon-color: null,
  335. $arrow-icon-size: null,
  336. $arrow-icon-size-big: null,
  337. $arrow-icon-font-size: null,
  338. $arrow-icon-font-size-big: null,
  339. $arrow-icon-margin: null,
  340. $arrow-icon-margin-big: null
  341. ) {
  342. $ui-suffix: ui-suffix($ui);
  343. .#{$prefix}#{$xtype}#{$ui-suffix} {
  344. .#{$prefix}body-el {
  345. // These properties go on the body el so as to not affect the menu item's
  346. // "separator"
  347. color: $color;
  348. @include font($font-weight: $font-weight, $font-size: $font-size, $font-family: $font-family);
  349. background-color: $background-color;
  350. height: $height;
  351. cursor: $cursor;
  352. @if $enable-big {
  353. .#{$prefix}big & {
  354. font-size: $font-size-big;
  355. height: $height-big;
  356. }
  357. }
  358. }
  359. .#{$prefix}icon-el {
  360. @include icon(
  361. $color: $icon-color,
  362. $size: $icon-size,
  363. $size-big: $icon-size-big,
  364. $font-size: $icon-font-size,
  365. $font-size-big: $icon-font-size-big
  366. );
  367. }
  368. .#{$prefix}arrow-el {
  369. margin: $arrow-icon-margin;
  370. @include icon(
  371. $icon: $arrow-icon,
  372. $color: $arrow-icon-color,
  373. $size: $arrow-icon-size,
  374. $size-big: $arrow-icon-size-big,
  375. $font-size: $arrow-icon-font-size,
  376. $font-size-big: $arrow-icon-font-size-big
  377. );
  378. @if $enable-big {
  379. .#{$prefix}big & {
  380. margin: $arrow-icon-margin-big;
  381. }
  382. }
  383. }
  384. &.#{$prefix}active {
  385. .#{$prefix}body-el {
  386. color: $active-color;
  387. background-color: $active-background-color;
  388. }
  389. .#{$prefix}icon-el {
  390. color: $active-icon-color;
  391. }
  392. .#{$prefix}arrow-el {
  393. color: $active-arrow-icon-color;
  394. }
  395. }
  396. &.#{$prefix}disabled {
  397. .#{$prefix}body-el {
  398. color: $disabled-color;
  399. background-color: $disabled-background-color;
  400. cursor: $disabled-cursor;
  401. }
  402. // disabled opacity is applied to the individual child els of the body to
  403. // avoid affecting the focus outline pseudo el
  404. .#{$prefix}text-el {
  405. opacity: $disabled-opacity;
  406. }
  407. .#{$prefix}icon-el {
  408. color: $disabled-icon-color;
  409. opacity: $disabled-opacity;
  410. }
  411. .#{$prefix}arrow-el {
  412. color: $disabled-arrow-icon-color;
  413. opacity: $disabled-opacity;
  414. }
  415. }
  416. &.#{$prefix}focused .#{$prefix}body-el {
  417. .#{$prefix}keyboard-mode & {
  418. @include outline($focused-outline-width, $focused-outline-style, $focused-outline-color, $focused-outline-offset);
  419. }
  420. }
  421. }
  422. }