IndexBar.scss 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /**
  2. * @class Ext.dataview.IndexBar
  3. */
  4. //# fashion replaces $index-bar-width
  5. /**
  6. * @var {number}
  7. * Index bar width
  8. */
  9. $indexbar-width: dynamic(15px);
  10. /**
  11. * @var {number}
  12. * Index bar width in the {@link Global_CSS#$enable-big big} sizing scheme
  13. */
  14. $indexbar-width-big: dynamic(null);
  15. /**
  16. * @var {color}
  17. * Index bar color.
  18. */
  19. $indexbar-color: dynamic($base-dark-color);
  20. /**
  21. * @var {color}
  22. * Index bar color when pressed
  23. */
  24. $indexbar-pressed-color: dynamic(null);
  25. //# fashion replaces $index-bar-bg-color
  26. /**
  27. * @var {color}
  28. * Index bar background-color
  29. */
  30. $indexbar-background-color: dynamic(null);
  31. /**
  32. * @var {color}
  33. * Index bar background-color when pressed
  34. */
  35. $indexbar-pressed-background-color: dynamic($neutral-color);
  36. /**
  37. * @var {number/list}
  38. * Index bar border-radius
  39. */
  40. $indexbar-border-radius: dynamic($indexbar-width);
  41. /**
  42. * @var {number/list}
  43. * Index bar border-radius in the {@link Global_CSS#$enable-big big} sizing scheme
  44. */
  45. $indexbar-border-radius-big: dynamic(null);
  46. /**
  47. * @var {number}
  48. * Index bar opacity
  49. */
  50. $indexbar-opacity: dynamic(null);
  51. /**
  52. * @var {number}
  53. * Index bar opacity when pressed
  54. */
  55. $indexbar-pressed-opacity: dynamic(null);
  56. /**
  57. * @var {string/number}
  58. * Index bar font-weight
  59. */
  60. $indexbar-font-weight: dynamic($font-weight-bold);
  61. /**
  62. * @var {number}
  63. * Index bar font-size
  64. */
  65. $indexbar-font-size: dynamic(10px);
  66. /**
  67. * @var {number}
  68. * Index bar font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  69. */
  70. $indexbar-font-size-big: dynamic(12px);
  71. /**
  72. * @var {string}
  73. * Index bar font-family
  74. */
  75. $indexbar-font-family: dynamic($font-family);
  76. /**
  77. * @var {number/list}
  78. * Index bar padding
  79. */
  80. $indexbar-padding: dynamic(5px 0);
  81. /**
  82. * @var {number/list}
  83. * Index bar padding in the {@link Global_CSS#$enable-big big} sizing scheme
  84. */
  85. $indexbar-padding-big: dynamic(7px 0);
  86. /**
  87. * @var {number/list}
  88. * Index bar margin
  89. */
  90. $indexbar-margin: dynamic(0 8px 0 0);
  91. /**
  92. * @var {number/list}
  93. * Index bar margin in the {@link Global_CSS#$enable-big big} sizing scheme
  94. */
  95. $indexbar-margin-big: dynamic(null);
  96. /**
  97. * @var {number}
  98. * Index bar width when {@link #direction horizontally} oriented
  99. */
  100. $indexbar-horizontal-width: dynamic(312px);
  101. /**
  102. * @var {number}
  103. * Index bar width when {@link #direction horizontally} oriented in the
  104. * {@link Global_CSS#$enable-big big} sizing scheme
  105. */
  106. $indexbar-horizontal-width-big: dynamic($indexbar-horizontal-width);
  107. /**
  108. * @var {number/list}
  109. * Index bar padding when {@link #direction horizontally} oriented
  110. */
  111. $indexbar-horizontal-padding: dynamic(rotate90($indexbar-padding));
  112. /**
  113. * @var {number/list}
  114. * Index bar padding when {@link #direction horizontally} oriented in the
  115. * {@link Global_CSS#$enable-big big} sizing scheme
  116. */
  117. $indexbar-horizontal-padding-big: dynamic(rotate90($indexbar-padding-big));
  118. /**
  119. * @var {number/list}
  120. * Index bar margin when {@link #direction horizontally} oriented
  121. */
  122. $indexbar-horizontal-margin: dynamic(rotate90($indexbar-margin));
  123. /**
  124. * @var {number/list}
  125. * Index bar margin when {@link #direction horizontally} oriented in the
  126. * {@link Global_CSS#$enable-big big} sizing scheme
  127. */
  128. $indexbar-horizontal-margin-big: dynamic(rotate90($indexbar-margin-big));
  129. /**
  130. *
  131. * @var {Boolean} $indexbar-justify-items
  132. * Determines the justify-content type for index bar items
  133. */
  134. $indexbar-justify-items: dynamic(center);
  135. /**
  136. * @var {number}
  137. * Index bar indicator width
  138. */
  139. $indexbar-indicator-width: dynamic(32px);
  140. /**
  141. * @var {number}
  142. * Index bar indicator width
  143. * {@link Global_CSS#$enable-big big} sizing scheme
  144. */
  145. $indexbar-indicator-width-big: dynamic(32px);
  146. /**
  147. * @var {number}
  148. * Index bar indicator height
  149. */
  150. $indexbar-indicator-height: dynamic($indexbar-indicator-width);
  151. /**
  152. * @var {number}
  153. * Index bar indicator height
  154. * {@link Global_CSS#$enable-big big} sizing scheme
  155. */
  156. $indexbar-indicator-height-big: dynamic($indexbar-indicator-width-big);
  157. /**
  158. * @var {number/list}
  159. * Index bar indicator margin
  160. */
  161. $indexbar-indicator-margin: dynamic(null);
  162. /**
  163. * @var {number}
  164. * Index bar indicator spacing between the bar and indicator
  165. */
  166. $indexbar-indicator-spacing: dynamic(4px);
  167. /**
  168. * @var {color}
  169. * Index bar indicator background color
  170. */
  171. $indexbar-indicator-background-color: dynamic($indexbar-pressed-background-color);
  172. /**
  173. * @var {number/list}
  174. * Index bar indicator border radius
  175. */
  176. $indexbar-indicator-border-radius: dynamic(3px);
  177. /**
  178. * @var {color}
  179. * Index bar indicator color
  180. */
  181. $indexbar-indicator-color: dynamic(null);
  182. /**
  183. * @var {number}
  184. * Index bar indicator font size
  185. */
  186. $indexbar-indicator-font-size: dynamic(12px);
  187. /**
  188. * @var {number}
  189. * Index bar indicator font size
  190. * {@link Global_CSS#$enable-big big} sizing scheme
  191. */
  192. $indexbar-indicator-font-size-big: dynamic(14px);
  193. /**
  194. * @var {number}
  195. * Index bar indicator line height
  196. */
  197. $indexbar-indicator-line-height: dynamic(null);
  198. /**
  199. * @var {number}
  200. * Index bar indicator line height
  201. * {@link Global_CSS#$enable-big big} sizing scheme
  202. */
  203. $indexbar-indicator-line-height-big: dynamic(null);
  204. /**
  205. * @var {number}
  206. * Index bar indicator font weight
  207. */
  208. $indexbar-indicator-font-weight: dynamic(bold);
  209. /**
  210. * @var {number}
  211. * Index bar indicator font weight
  212. * {@link Global_CSS#$enable-big big} sizing scheme
  213. */
  214. $indexbar-indicator-font-weight-big: dynamic(null);
  215. /**
  216. * @var {boolean}
  217. * Determines is the index bar indicator should have an arrow
  218. */
  219. $indexbar-indicator-enable-arrow: dynamic(true);
  220. /**
  221. * Creates a visual theme for an IndexBar.
  222. *
  223. * @param {string} $ui
  224. * The name of the UI being created. Can not included spaces or special punctuation
  225. * (used in CSS class names).
  226. *
  227. * @param {number} $width
  228. * Index bar width
  229. *
  230. * @param {number} $width-big
  231. * Index bar width in the {@link Global_CSS#$enable-big big} sizing scheme
  232. *
  233. * @param {color} $color
  234. * Index bar color.
  235. *
  236. * @param {color} $pressed-color
  237. * Index bar color when pressed
  238. *
  239. * @param {color} $background-color
  240. * Index bar background-color
  241. *
  242. * @param {color} $pressed-background-color
  243. * Index bar background-color when pressed
  244. *
  245. * @param {number/list} $border-radius
  246. * Index bar border-radius
  247. *
  248. * @param {number/list} $border-radius-big
  249. * Index bar border-radius in the {@link Global_CSS#$enable-big big} sizing scheme
  250. *
  251. * @param {number} $opacity
  252. * Index bar opacity
  253. *
  254. * @param {number} $pressed-opacity
  255. * Index bar opacity when pressed
  256. *
  257. * @param {string/number} $font-weight
  258. * Index bar font-weight
  259. *
  260. * @param {number} $font-size
  261. * Index bar font-size
  262. *
  263. * @param {number} $font-size-big
  264. * Index bar font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  265. *
  266. * @param {string} $font-family
  267. * Index bar font-family
  268. *
  269. * @param {number/list} $padding
  270. * Index bar padding
  271. *
  272. * @param {number/list} $padding-big
  273. * Index bar padding in the {@link Global_CSS#$enable-big big} sizing scheme
  274. *
  275. * @param {number/list} $margin
  276. * Index bar margin
  277. *
  278. * @param {number/list} $margin-big
  279. * Index bar margin in the {@link Global_CSS#$enable-big big} sizing scheme
  280. *
  281. * @param {number} $horizontal-width
  282. * Index bar width when {@link #direction horizontally} oriented
  283. *
  284. * @param {number} $horizontal-width-big
  285. * Index bar width when {@link #direction horizontally} oriented in the
  286. * {@link Global_CSS#$enable-big big} sizing scheme
  287. *
  288. * @param {number/list} $horizontal-padding
  289. * Index bar padding when {@link #direction horizontally} oriented
  290. *
  291. * @param {number/list} $horizontal-padding-big
  292. * Index bar padding when {@link #direction horizontally} oriented in the
  293. * {@link Global_CSS#$enable-big big} sizing scheme
  294. *
  295. * @param {number/list} $horizontal-margin
  296. * Index bar margin when {@link #direction horizontally} oriented
  297. *
  298. * @param {number/list} $horizontal-margin-big
  299. * Index bar margin when {@link #direction horizontally} oriented in the
  300. * {@link Global_CSS#$enable-big big} sizing scheme
  301. *
  302. * @param {Boolean} $justify-items
  303. * Determines the justify-content type for index bar items
  304. *
  305. * @param {number} $indicator-width
  306. * Index bar indicator width
  307. *
  308. * @param {number} $indicator-width-big
  309. * Index bar indicator width
  310. * {@link Global_CSS#$enable-big big} sizing scheme
  311. *
  312. * @param {number} $indicator-height
  313. * Index bar indicator height
  314. *
  315. * @param {number} $indicator-height-big
  316. * Index bar indicator height
  317. * {@link Global_CSS#$enable-big big} sizing scheme
  318. *
  319. * @param {number/list} $indicator-margin
  320. * Index bar indicator margin
  321. *
  322. * @param {number/list} $indicator-spacing
  323. * Index bar indicator spacing between the bar and indicator
  324. *
  325. * @param {color} $indicator-background-color
  326. * Index bar indicator background color
  327. *
  328. * @param {number/list} $indicator-border-radius
  329. * Index bar indicator border radius
  330. *
  331. * @param {color} $indicator-color
  332. * Index bar indicator color
  333. *
  334. * @param {number} $indicator-font-size
  335. * Index bar indicator font size
  336. *
  337. * @param {number} $indicator-font-size-big
  338. * Index bar indicator font size
  339. * {@link Global_CSS#$enable-big big} sizing scheme
  340. *
  341. * @param {number} $indicator-line-height
  342. * Index bar indicator line height
  343. *
  344. * @param {number} $indicator-line-height-big
  345. * Index bar indicator line height
  346. * {@link Global_CSS#$enable-big big} sizing scheme
  347. *
  348. * @param {number} $indicator-font-weight
  349. * Index bar indicator font weight
  350. *
  351. * @param {number} $indicator-font-weight-big
  352. * Index bar indicator font weight
  353. * {@link Global_CSS#$enable-big big} sizing scheme
  354. *
  355. * @param {Boolean} $indicator-enable-arrow
  356. * Determines if the index bar indicator should have an arrow
  357. */
  358. @mixin indexbar-ui(
  359. $ui: null,
  360. $width: null,
  361. $width-big: null,
  362. $color: null,
  363. $pressed-color: null,
  364. $background-color: null,
  365. $pressed-background-color: null,
  366. $border-radius: null,
  367. $border-radius-big: null,
  368. $opacity: null,
  369. $pressed-opacity: null,
  370. $font-weight: null,
  371. $font-size: null,
  372. $font-size-big: null,
  373. $font-family: null,
  374. $padding: null,
  375. $padding-big: null,
  376. $margin: null,
  377. $margin-big: null,
  378. $horizontal-width: null,
  379. $horizontal-width-big: null,
  380. $horizontal-padding: null,
  381. $horizontal-padding-big: null,
  382. $horizontal-margin: null,
  383. $horizontal-margin-big: null,
  384. $justify-items: null,
  385. $indicator-width: null,
  386. $indicator-width-big: null,
  387. $indicator-height: null,
  388. $indicator-height-big: null,
  389. $indicator-margin: null,
  390. $indicator-spacing: null,
  391. $indicator-background-color: null,
  392. $indicator-border-radius: null,
  393. $indicator-color: null,
  394. $indicator-font-size: null,
  395. $indicator-font-size-big: null,
  396. $indicator-line-height: null,
  397. $indicator-line-height-big: null,
  398. $indicator-font-weight: null,
  399. $indicator-font-weight-big: null,
  400. $indicator-enable-arrow: null
  401. ) {
  402. $ui-suffix: ui-suffix($ui);
  403. // Create this variable to de-reference CSS variables for Edge
  404. // Odd bug where before pseudo is not being rendered if in a rule
  405. // with a CSS variable background-color
  406. $edge-indicator-background-color: mix(#fff, $indicator-background-color, 0%);
  407. .#{$prefix}indexbar#{$ui-suffix} .#{$prefix}body-el {
  408. color: $color;
  409. justify-content: $justify-items;
  410. border-radius: $border-radius;
  411. opacity: $opacity;
  412. // This changes the element that will be used for the background color
  413. // For index bars that span the whole height/width we use the indexbar element
  414. // for collapsed indexbars we will use the individual elements for background color
  415. @if $justify-items == space-between or $justify-items == space-around {
  416. background-color: $background-color;
  417. &.#{$prefix}pressed {
  418. background-color: $pressed-background-color;
  419. }
  420. } @else {
  421. .#{$prefix}indexbar-item {
  422. background-color: $background-color;
  423. }
  424. &.#{$prefix}pressed .#{$prefix}indexbar-item{
  425. background-color: $pressed-background-color;
  426. }
  427. }
  428. @if $enable-big {
  429. .#{$prefix}big & {
  430. border-radius: $border-radius-big;
  431. font-size: $font-size-big;
  432. }
  433. }
  434. &.#{$prefix}pressed {
  435. opacity: $pressed-opacity;
  436. }
  437. &.#{$prefix}vertical {
  438. width: $width;
  439. padding: $padding;
  440. margin: top($margin) right($margin) bottom($margin) $indicator-spacing;
  441. @if $enable-big {
  442. .#{$prefix}big & {
  443. width: $width-big;
  444. padding: $padding-big;
  445. margin: $margin-big;
  446. }
  447. }
  448. }
  449. .#{$prefix}indexbar-item {
  450. // font must be on the item so that it does not affect the size/padding/margin
  451. // of the indexbar when size is specified in ems
  452. @include font($font-weight: $font-weight, $font-size: $font-size, $font-family: $font-family);
  453. }
  454. &.#{$prefix}horizontal {
  455. width: $horizontal-width;
  456. padding: $horizontal-padding;
  457. margin: $indicator-spacing right($margin) bottom($margin) left($margin);
  458. @if $enable-big {
  459. .#{$prefix}big & {
  460. width: $horizontal-width-big;
  461. padding: $horizontal-padding-big;
  462. margin: $horizontal-margin-big;
  463. }
  464. }
  465. }
  466. }
  467. .#{$prefix}list.#{$prefix}indexed-vertical.#{$prefix}indexed-no-autohide.#{$prefix}indexed#{$ui-suffix} {
  468. $item-spacing: calc-sum($width, horizontal($margin));
  469. $item-spacing-big: calc-sum($width-big, horizontal($margin-big));
  470. .#{$prefix}itemheader-body-el > :last-child,
  471. .#{$prefix}listitem-inner-el > :last-child,
  472. .#{$prefix}listswiperitem-body-el {
  473. margin-right: $item-spacing;
  474. @if $enable-big {
  475. .#{$prefix}big & {
  476. margin-right: $item-spacing-big;
  477. }
  478. }
  479. }
  480. .#{$prefix}listitem-tool-dock {
  481. > .#{$prefix}listitem-inner-el > :last-child {
  482. @if $item-spacing != null {
  483. margin-right: 0;
  484. }
  485. @if $enable-big and ($item-spacing-big != null) {
  486. .#{$prefix}big & {
  487. margin-right: 0;
  488. }
  489. }
  490. }
  491. > :last-child {
  492. margin-right: $item-spacing;
  493. @if $enable-big {
  494. .#{$prefix}big & {
  495. margin-right: $item-spacing-big;
  496. }
  497. }
  498. }
  499. }
  500. }
  501. .#{$prefix}indexbar#{$ui-suffix} {
  502. .#{$prefix}indexbar-indicator {
  503. .#{$prefix}edge & {
  504. background-color: $edge-indicator-background-color;
  505. }
  506. }
  507. .#{$prefix}indexbar-indicator {
  508. width: $indicator-width;
  509. height: $indicator-height;
  510. margin: $indicator-margin;
  511. color: $indicator-color;
  512. font-size: $indicator-font-size;
  513. line-height: $indicator-line-height;
  514. font-weight: $indicator-font-weight;
  515. background-color: $indicator-background-color;
  516. border-radius: $indicator-border-radius;
  517. .#{$prefix}big & {
  518. width: $indicator-width-big;
  519. height: $indicator-height-big;
  520. font-size: $indicator-font-size-big;
  521. line-height: $indicator-line-height-big;
  522. font-weight: $indicator-font-weight-big;
  523. }
  524. }
  525. @if $indicator-enable-arrow {
  526. $indicator-arrow-size: floor($indexbar-indicator-width * .4);
  527. .#{$prefix}indexbar-indicator::before {
  528. .#{$prefix}edge & {
  529. background-color: $edge-indicator-background-color;
  530. }
  531. }
  532. .#{$prefix}indexbar-indicator::before {
  533. content: "";
  534. width: $indicator-arrow-size;
  535. height: $indicator-arrow-size;
  536. transform: rotate(45deg);
  537. top: ($indicator-height/2) - ($indicator-arrow-size/2);
  538. position: absolute;
  539. background-color: $indicator-background-color;
  540. }
  541. &.#{$prefix}horizontal > .#{$prefix}indexbar-indicator::before {
  542. bottom: floor($indicator-arrow-size * -.25);
  543. }
  544. &.#{$prefix}vertical > .#{$prefix}indexbar-indicator::before {
  545. right: floor($indicator-arrow-size * -.25);
  546. }
  547. }
  548. }
  549. }