_tab.scss 18 KB

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