_tab.scss 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. /**
  2. * @class Ext.Tab
  3. */
  4. @mixin extjs-tab {
  5. // @include x-frame(
  6. // $cls: 'tab',
  7. // $ui: 'default-top',
  8. // $border-radius: $tab-top-border-radius,
  9. // $border-width: $tab-top-border-width,
  10. // $background-color: $tab-base-color,
  11. // $background-gradient: $tab-background-gradient,
  12. // $background-direction: top,
  13. // $table: true
  14. // );
  15. // @include x-frame(
  16. // $cls: 'tab',
  17. // $ui: 'default-bottom',
  18. // $border-radius: $tab-bottom-border-radius,
  19. // $border-width: $tab-bottom-border-width,
  20. // $background-color: $tab-base-color,
  21. // $background-gradient: $tab-background-gradient,
  22. // $background-direction: bottom,
  23. // $table: true
  24. // );
  25. .#{$prefix}tab {
  26. z-index: 1;
  27. margin: 0 $tab-spacing 0 0;
  28. display: inline-block;
  29. // @tag iezoomhack
  30. *display: inline;
  31. // height: $tab-height;
  32. // border-color: $tab-border-color;
  33. @extend .mr-white-glove;
  34. em {
  35. display: block;
  36. padding: 7px 22px 8px 22px;
  37. line-height: 1px;
  38. }
  39. button {
  40. background: none;
  41. border: 0;
  42. padding: 0;
  43. margin: 0;
  44. -webkit-appearance: none;
  45. color: $tab-color;
  46. @extend .outline-none;
  47. @extend .ellipsis;
  48. &::-moz-focus-inner {
  49. border: 0;
  50. padding: 0;
  51. }
  52. .#{$prefix}tab-inner {
  53. font-size: $tab-font-size;
  54. @if $tab-font-weight {
  55. font-weight: $tab-font-weight;
  56. }
  57. @if $tab-font-family {
  58. font-family: $tab-font-family;
  59. }
  60. background-color: transparent;
  61. background-repeat: no-repeat;
  62. background-position: 0 -2px;
  63. display: block;
  64. text-align: center;
  65. white-space: nowrap;
  66. text-overflow: ellipsis;
  67. -o-text-overflow: ellipsis;
  68. overflow: hidden;
  69. }
  70. }
  71. img {
  72. display: none;
  73. }
  74. }
  75. .#{$prefix}tab-close-btn {
  76. @include pictos('*', $size: 12px, $include-states: false);
  77. display: block;
  78. position: absolute !important;
  79. top: 5px;
  80. right: 2px;
  81. width: 13px;
  82. height: 13px;
  83. text-decoration: none;
  84. @include opacity(.6);
  85. }
  86. .#{$prefix}tab-close-btn:hover {
  87. @include opacity(1);
  88. }
  89. .x-panel-default-framed .x-tab-default-top {
  90. @include border-radius($tab-top-border-radius);
  91. }
  92. .x-panel-default-framed .x-tab-default-bottom {
  93. @include border-radius($tab-bottom-border-radius);
  94. }
  95. .#{$prefix}tab-disabled {
  96. @include opacity(1);
  97. }
  98. .#{$prefix}border-box {
  99. .#{$prefix}tab-default-top {
  100. // height: $tab-height + top($tabbar-top-strip-border-width);
  101. }
  102. .#{$prefix}tab-default-bottom {
  103. // height: $tab-height + bottom($tabbar-bottom-strip-border-width);
  104. }
  105. }
  106. @if $include-ie {
  107. * html .#{$prefix}ie {
  108. .#{$prefix}tab button {
  109. width: 1px;
  110. }
  111. }
  112. .#{$prefix}strict .#{$prefix}ie6,
  113. .#{$prefix}strict .#{$prefix}ie7 {
  114. .#{$prefix}tab .#{$prefix}frame-mc {
  115. height: 100%;
  116. }
  117. }
  118. .#{$prefix}ie .#{$prefix}tab-active button:active {
  119. position: relative;
  120. top: -1px;
  121. left: -1px;
  122. }
  123. }
  124. $framepad: max(top($tab-top-border-radius), right($tab-top-border-radius)) - top($tab-top-border-width);
  125. .#{$prefix}tab-default-top {
  126. @if $tab-inner-border {
  127. @include inner-border(
  128. $width: $tab-top-inner-border-width,
  129. $color: $tab-inner-border-color
  130. );
  131. }
  132. // border-bottom: 1px solid $tabbar-strip-border-color !important;
  133. // em {
  134. // padding-bottom: $framepad;
  135. // }
  136. button,
  137. .#{$prefix}tab-inner {
  138. // height: $tab-height - $framepad * 2 - top($tab-top-border-width);
  139. // line-height: $tab-height - $framepad * 2 - top($tab-top-border-width);
  140. }
  141. }
  142. .#{$prefix}nbr .#{$prefix}tab-default-top {
  143. // border-bottom-width: 1px !important;
  144. }
  145. .#{$prefix}tab-default-top-active {
  146. // border-bottom-color: $tabbar-strip-background-color !important;
  147. }
  148. $framepad: max(bottom($tab-bottom-border-radius), left($tab-bottom-border-radius)) - bottom($tab-bottom-border-width);
  149. .#{$prefix}tab-default-bottom {
  150. // @if $tab-inner-border {
  151. // @include inner-border(
  152. // $width: $tab-bottom-inner-border-width,
  153. // $color: $tab-inner-border-color
  154. // );
  155. // }
  156. // border-top: 1px solid $tabbar-strip-border-color !important;
  157. // @include inner-border(
  158. // $width: $tab-bottom-inner-border-width,
  159. // $color: $tab-inner-border-color
  160. // );
  161. em {
  162. // padding-top: $framepad;
  163. }
  164. button,
  165. .#{$prefix}tab-inner {
  166. // height: $tab-height - $framepad * 2 - bottom($tab-bottom-border-width);
  167. // line-height: $tab-height - $framepad * 2 - bottom($tab-bottom-border-width);
  168. }
  169. }
  170. .#{$prefix}nbr .#{$prefix}tab-default-bottom {
  171. // border-top-width: 1px !important;
  172. }
  173. .#{$prefix}tab-default-bottom-active {
  174. // border-top-color: $tabbar-strip-background-color !important;
  175. }
  176. .#{$prefix}tab-default-disabled {
  177. &, & * {
  178. cursor: default;
  179. }
  180. border-color: $tab-border-color-disabled;
  181. @include background-gradient($tab-base-color-disabled, $tab-background-gradient-disabled);
  182. button {
  183. color: $tab-color-disabled !important;
  184. }
  185. }
  186. .#{$prefix}tab-icon-text-left {
  187. .#{$prefix}tab-inner {
  188. padding-left: 24px;
  189. }
  190. }
  191. .#{$prefix}tab {
  192. background: rgba(255,255,255,.2);
  193. button, a {
  194. position: relative;
  195. .#{$prefix}tab-icon {
  196. position: absolute;
  197. background-repeat: no-repeat;
  198. top: 0;
  199. left: 0;
  200. right: auto;
  201. bottom: 0;
  202. width: $tab-icon-size;
  203. height: $tab-icon-size;
  204. }
  205. }
  206. &.x-icon {
  207. em {
  208. // padding: 7px 10px 8px;
  209. }
  210. button {
  211. width: $tab-icon-size;
  212. height: $tab-icon-size;
  213. }
  214. }
  215. &.x-icon-text-left {
  216. em {
  217. // padding-left: 10px;
  218. }
  219. }
  220. }
  221. .#{$prefix}tab-default-plain {
  222. background: transparent
  223. }
  224. //over
  225. .#{$prefix}tab-over {
  226. @if $tab-border-color-over != $tab-border-color {
  227. border-color: $tab-border-color-over;
  228. }
  229. button {
  230. @if $tab-color-over != $tab-color {
  231. color: $tab-color-over;
  232. }
  233. @if $tab-font-weight-over != $tab-font-weight {
  234. font-weight: $tab-font-weight-over;
  235. }
  236. @if $tab-font-size-over != $tab-font-size {
  237. font-size: $tab-font-size-over;
  238. }
  239. @if $tab-font-family-over != $tab-font-family {
  240. font-family: $tab-font-family-over;
  241. }
  242. }
  243. }
  244. // @tag question: Tabs not getting these classes properly?
  245. .#{$prefix}tab-top-over, .#{$prefix}tab-over {
  246. @include background-gradient($tab-base-color-over, $tab-background-gradient-over, top);
  247. }
  248. .#{$prefix}tab-bottom-over {
  249. @include background-gradient($tab-base-color-over, $tab-background-gradient-over, bottom);
  250. }
  251. //active
  252. .#{$prefix}tab-active {
  253. z-index: 3;
  254. @if $tab-border-color-active != $tab-border-color {
  255. border-color: $tab-border-color-active;
  256. }
  257. button {
  258. @if $tab-color-active != $tab-color {
  259. color: $tab-color-active;
  260. }
  261. @if $tab-font-weight-active != $tab-font-weight {
  262. font-weight: $tab-font-weight-active;
  263. }
  264. @if $tab-font-size-active != $tab-font-size {
  265. font-size: $tab-font-size-active;
  266. }
  267. @if $tab-font-family-active != $tab-font-family {
  268. font-family: $tab-font-family-active;
  269. }
  270. }
  271. .#{$prefix}tab-close-btn {
  272. &:after {
  273. @include background-gradient(#CCCCCC, null);
  274. }
  275. }
  276. .#{$prefix}tab-icon {
  277. &:after {
  278. color: $tab-color-active;
  279. }
  280. }
  281. }
  282. .#{$prefix}tab-top-active {
  283. @include background-gradient($tab-base-color-active, $tab-background-gradient-active, top);
  284. }
  285. .#{$prefix}tab-bottom-active {
  286. @include background-gradient($tab-base-color-active, $tab-background-gradient-active, bottom);
  287. }
  288. //disabled
  289. .#{$prefix}tab-disabled {
  290. @if $tab-border-color-disabled != $tab-border-color {
  291. border-color: $tab-border-color-disabled;
  292. }
  293. button {
  294. @if $tab-color-disabled != $tab-color {
  295. color: $tab-color-disabled;
  296. }
  297. @if $tab-font-weight-disabled != $tab-font-weight {
  298. font-weight: $tab-font-weight-disabled;
  299. }
  300. @if $tab-font-size-disabled != $tab-font-size {
  301. font-size: $tab-font-size-disabled;
  302. }
  303. @if $tab-font-family-disabled != $tab-font-family {
  304. font-family: $tab-font-family-disabled;
  305. }
  306. }
  307. .#{$prefix}tab-icon {
  308. &:after {
  309. opacity: .5;
  310. }
  311. }
  312. }
  313. .#{$prefix}tab-top-disabled {
  314. // @include background-gradient($tab-base-color-disabled, $tab-background-gradient-disabled, top);
  315. }
  316. .#{$prefix}tab-bottom-disabled {
  317. // @include background-gradient($tab-base-color-disabled, $tab-background-gradient-disabled, bottom);
  318. }
  319. @if not $supports-gradients or $compile-all {
  320. .#{$prefix}nlg {
  321. @if $tab-background-gradient != null {
  322. .#{$prefix}tab-top { background-image: theme-background-image($theme-name, 'tab/tab-default-top-bg.gif'); }
  323. .#{$prefix}tab-bottom { background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-bg.gif'); }
  324. }
  325. @if $tab-background-gradient-over != null {
  326. .#{$prefix}tab-top-over { background-image: theme-background-image($theme-name, 'tab/tab-default-top-over-bg.gif'); }
  327. .#{$prefix}tab-bottom-over { background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-over-bg.gif'); }
  328. }
  329. @if $tab-background-gradient-active != null {
  330. .#{$prefix}tab-top-active { background-image: theme-background-image($theme-name, 'tab/tab-default-top-active-bg.gif'); }
  331. .#{$prefix}tab-bottom-active { background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-active-bg.gif'); }
  332. }
  333. @if $tab-background-gradient-disabled != null {
  334. .#{$prefix}tab-top-disabled { background-image: theme-background-image($theme-name, 'tab/tab-default-top-disabled-bg.gif') !important; }
  335. .#{$prefix}tab-bottom-disabled { background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-disabled-bg.gif') !important; }
  336. }
  337. }
  338. }
  339. .#{$prefix}tab-closable em {
  340. // padding-right: $tab-closable-icon-width + 3;
  341. }
  342. @if not $supports-border-radius or $compile-all {
  343. .#{$prefix}nbr {
  344. .#{$prefix}tab-top-over {
  345. .#{$prefix}frame-tl,
  346. .#{$prefix}frame-bl,
  347. .#{$prefix}frame-tr,
  348. .#{$prefix}frame-br,
  349. .#{$prefix}frame-tc,
  350. .#{$prefix}frame-bc {
  351. background-image: theme-background-image($theme-name, 'tab/tab-default-top-over-corners.gif');
  352. }
  353. .#{$prefix}frame-ml,
  354. .#{$prefix}frame-mr {
  355. background-image: theme-background-image($theme-name, 'tab/tab-default-top-over-sides.gif');
  356. }
  357. @if $tab-background-gradient-over != null {
  358. .#{$prefix}frame-mc {
  359. background-color: $tab-base-color-over;
  360. background-repeat: repeat-x;
  361. background-image: theme-background-image($theme-name, 'tab/tab-default-top-over-bg.gif');
  362. }
  363. }
  364. }
  365. .#{$prefix}tab-bottom-over {
  366. .#{$prefix}frame-tl,
  367. .#{$prefix}frame-bl,
  368. .#{$prefix}frame-tr,
  369. .#{$prefix}frame-br,
  370. .#{$prefix}frame-tc,
  371. .#{$prefix}frame-bc {
  372. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-over-corners.gif');
  373. }
  374. .#{$prefix}frame-ml,
  375. .#{$prefix}frame-mr {
  376. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-over-sides.gif');
  377. }
  378. @if $tab-background-gradient-over != null {
  379. .#{$prefix}frame-mc {
  380. background-color: $tab-base-color-over;
  381. background-repeat: repeat-x;
  382. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-over-bg.gif');
  383. }
  384. }
  385. }
  386. .#{$prefix}tab-top-active {
  387. .#{$prefix}frame-tl,
  388. .#{$prefix}frame-bl,
  389. .#{$prefix}frame-tr,
  390. .#{$prefix}frame-br,
  391. .#{$prefix}frame-tc,
  392. .#{$prefix}frame-bc {
  393. background-image: theme-background-image($theme-name, 'tab/tab-default-top-active-corners.gif');
  394. }
  395. .#{$prefix}frame-ml,
  396. .#{$prefix}frame-mr {
  397. background-image: theme-background-image($theme-name, 'tab/tab-default-top-active-sides.gif');
  398. }
  399. @if $tab-background-gradient-active != null {
  400. .#{$prefix}frame-mc {
  401. background-color: $tab-base-color-active;
  402. background-repeat: repeat-x;
  403. background-image: theme-background-image($theme-name, 'tab/tab-default-top-active-bg.gif');
  404. }
  405. }
  406. }
  407. .#{$prefix}tab-bottom-active {
  408. .#{$prefix}frame-tl,
  409. .#{$prefix}frame-bl,
  410. .#{$prefix}frame-tr,
  411. .#{$prefix}frame-br,
  412. .#{$prefix}frame-tc,
  413. .#{$prefix}frame-bc {
  414. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-active-corners.gif');
  415. }
  416. .#{$prefix}frame-ml,
  417. .#{$prefix}frame-mr {
  418. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-active-sides.gif');
  419. }
  420. @if $tab-background-gradient-active != null {
  421. .#{$prefix}frame-mc {
  422. background-color: $tab-base-color-active;
  423. background-repeat: repeat-x;
  424. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-active-bg.gif');
  425. }
  426. }
  427. }
  428. .#{$prefix}tab-top-disabled {
  429. .#{$prefix}frame-tl,
  430. .#{$prefix}frame-bl,
  431. .#{$prefix}frame-tr,
  432. .#{$prefix}frame-br,
  433. .#{$prefix}frame-tc,
  434. .#{$prefix}frame-bc {
  435. background-image: theme-background-image($theme-name, 'tab/tab-default-top-disabled-corners.gif');
  436. }
  437. .#{$prefix}frame-ml,
  438. .#{$prefix}frame-mr {
  439. background-image: theme-background-image($theme-name, 'tab/tab-default-top-disabled-sides.gif');
  440. }
  441. @if $tab-background-gradient-disabled != null {
  442. .#{$prefix}frame-mc {
  443. background-repeat: repeat-x;
  444. background-image: theme-background-image($theme-name, 'tab/tab-default-top-disabled-bg.gif');
  445. }
  446. }
  447. }
  448. .#{$prefix}tab-bottom-disabled {
  449. .#{$prefix}frame-tl,
  450. .#{$prefix}frame-bl,
  451. .#{$prefix}frame-tr,
  452. .#{$prefix}frame-br,
  453. .#{$prefix}frame-tc,
  454. .#{$prefix}frame-bc {
  455. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-disabled-corners.gif');
  456. }
  457. .#{$prefix}frame-ml,
  458. .#{$prefix}frame-mr {
  459. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-disabled-sides.gif');
  460. }
  461. @if $tab-background-gradient-disabled != null {
  462. .#{$prefix}frame-mc {
  463. background-repeat: repeat-x;
  464. background-image: theme-background-image($theme-name, 'tab/tab-default-bottom-disabled-bg.gif');
  465. }
  466. }
  467. }
  468. }
  469. }
  470. }