tabs.less 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. @tab-radius: 3px;
  2. @modified-icon-width: 8px;
  3. @tab-skew: 30deg;
  4. @tab-top-padding: 5px;
  5. @tab-bottom-border-height: 5px;
  6. @tab-border: 1px solid @tab-border-color;
  7. @tab-bar-bottom-border-color: #111;
  8. @tab-max-width: 160px;
  9. .tab-bar {
  10. height: (@tab-height + @tab-top-padding + @tab-bottom-border-height);
  11. background: @tab-bar-background-color;
  12. box-shadow: inset 0 -8px 8px -4px rgba(0,0,0, .15);
  13. padding: 0 10px 0 25px;
  14. overflow-x: auto;
  15. overflow-y: hidden;
  16. &::-webkit-scrollbar {
  17. display: none;
  18. }
  19. .tab {
  20. position: relative;
  21. top: @tab-top-padding;
  22. max-width: @tab-max-width;
  23. height: @tab-height;
  24. line-height: @tab-height;
  25. padding: 0;
  26. margin: 0 20px 0 5px;
  27. color: @text-color;
  28. transition: color .1s ease-in;
  29. border: none;
  30. &, &:before, &:after {
  31. background-image: -webkit-linear-gradient(top, lighten(#333, 7%), #333);
  32. height: @tab-height;
  33. }
  34. &:before, &:after {
  35. content: '';
  36. position: absolute;
  37. top: 0px;
  38. width: 25px;
  39. height: @tab-height;
  40. }
  41. // left angled edge
  42. &:before {
  43. left: -14px;
  44. border-top-left-radius: @tab-radius;
  45. box-shadow: inset 1px 1px 0 @tab-border-color, -4px 0px 4px rgba(0,0,0,.1);
  46. -webkit-transform: skewX(-@tab-skew);
  47. }
  48. // right angled edge
  49. &:after {
  50. right: -14px;
  51. border-top-right-radius: @tab-radius;
  52. box-shadow: inset -1px 1px 0 @tab-border-color, 4px 0px 4px rgba(0,0,0,.1);
  53. -webkit-transform: skewX(@tab-skew);
  54. }
  55. .close-icon {
  56. right: 0;
  57. z-index: 3;
  58. text-align: right;
  59. line-height: @tab-height;
  60. color: @text-color;
  61. &:hover {
  62. color: inherit;
  63. }
  64. }
  65. &.modified:not(:hover) .close-icon {
  66. right: 0;
  67. top: (@tab-height/2 - @modified-icon-width/2 + 1px);
  68. width: @modified-icon-width;
  69. height: @modified-icon-width;
  70. }
  71. &.modified:hover .close-icon:hover {
  72. color: @text-color-highlight;
  73. }
  74. .title {
  75. position: relative;
  76. z-index: 1;
  77. margin-top: -@tab-top-padding;
  78. padding-top: @tab-top-padding;
  79. padding-right: 10px;
  80. }
  81. }
  82. .tab.active {
  83. z-index: 1;
  84. color: @text-color-highlight;
  85. box-shadow: inset -1px 1px 0 @tab-border-color, 4px -4px 4px rgba(0,0,0,.1);
  86. .close-icon {
  87. line-height: (@tab-height - 1px);
  88. color: @text-color;
  89. }
  90. &, &:before, &:after {
  91. background-image: -webkit-linear-gradient(top, lighten(@tab-background-color-active, 7%), @tab-background-color-active);
  92. height: (@tab-height + 1px);
  93. }
  94. &:before {
  95. box-shadow: inset 1px 1px 0 @tab-border-color, -4px -4px 4px rgba(0,0,0,.1);
  96. }
  97. &:after {
  98. box-shadow: inset -1px 1px 0 @tab-border-color, 4px -4px 4px rgba(0,0,0,.1);
  99. }
  100. }
  101. .tab:hover {
  102. color: @text-color-highlight;
  103. }
  104. .tab.active:hover .close-icon {
  105. color: @text-color;
  106. &:hover {
  107. color: inherit;
  108. }
  109. }
  110. .placeholder {
  111. height: (@tab-height + @tab-top-padding + @tab-bottom-border-height);
  112. pointer-events: none;
  113. &:before {
  114. margin-left: -9px; // center between tabs
  115. }
  116. &:after {
  117. top: (@tab-height + @tab-top-padding + @tab-bottom-border-height - 2px);
  118. margin-left: -10px; // center between tabs
  119. }
  120. }
  121. }
  122. // border
  123. .tab-bar + .item-views::before {
  124. content: "";
  125. position: absolute;
  126. top: -5px;
  127. height: @tab-bottom-border-height;
  128. left: 0;
  129. right: 0;
  130. background-color: @tab-background-color-active;
  131. border-top: 1px solid @tab-border-color;
  132. border-bottom: 1px solid @tab-bar-bottom-border-color;
  133. pointer-events: none;
  134. }