tabs.scss 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. :root {
  2. --editor-tab-max-path-length: 250px;
  3. --editor-tab-divider-color: var(--neutral-70);
  4. --editor-tab-row-height: var(--review-panel-header-height, 36px);
  5. --editor-tab-drop-indicator-width: 5px;
  6. --editor-tab-divider-width: 1px;
  7. }
  8. @include theme('light') {
  9. --editor-tab-divider-color: var(--border-divider);
  10. }
  11. .editor-tabs-container {
  12. display: flex;
  13. flex-direction: row;
  14. align-items: center;
  15. flex: 0 0 auto;
  16. min-height: var(--editor-tab-row-height);
  17. background: var(--bg-secondary-themed);
  18. justify-content: space-between;
  19. .review-panel-header-slot {
  20. display: contents;
  21. }
  22. .editor-tabs-labs-icon {
  23. flex: 0 0 auto;
  24. padding: 0 var(--spacing-02);
  25. .material-symbols {
  26. font-size: 16px;
  27. }
  28. }
  29. }
  30. .editor-tabs-row {
  31. display: flex;
  32. flex-direction: row;
  33. height: var(--editor-tab-row-height);
  34. list-style: none;
  35. padding: 0;
  36. margin: 0;
  37. flex: 1;
  38. background: var(--bg-secondary-themed);
  39. overflow-x: auto;
  40. scrollbar-width: thin;
  41. }
  42. .editor-file-tab {
  43. --tab-bg-color: var(--bg-secondary-themed);
  44. --tab-text-color: var(--content-secondary-themed);
  45. display: flex;
  46. position: relative;
  47. border-right: var(--editor-tab-divider-width) solid
  48. var(--editor-tab-divider-color);
  49. padding: var(--spacing-01) var(--spacing-02) 0 var(--spacing-02);
  50. &:first-child {
  51. padding-left: 0;
  52. }
  53. &:last-child {
  54. padding-right: 0;
  55. }
  56. &.tab-selected,
  57. &:has(+ .tab-selected) {
  58. border-right-color: transparent;
  59. }
  60. .editor-file-tab-content {
  61. display: inline-flex;
  62. align-items: center;
  63. gap: var(--spacing-02);
  64. justify-content: center;
  65. box-sizing: border-box;
  66. padding: var(--spacing-02) var(--spacing-03);
  67. background: var(--tab-bg-color);
  68. color: var(--tab-text-color);
  69. font-size: var(--font-size-02);
  70. flex-direction: row;
  71. cursor: pointer;
  72. user-select: none;
  73. border: 1px solid transparent;
  74. border-bottom-width: 0;
  75. }
  76. &.tab-selected {
  77. --tab-bg-color: var(--bg-primary-themed);
  78. --tab-text-color: var(--content-primary-themed);
  79. .editor-file-tab-content {
  80. border-top-left-radius: var(--border-radius-medium);
  81. border-top-right-radius: var(--border-radius-medium);
  82. border-color: var(--editor-tab-divider-color);
  83. }
  84. }
  85. &:not(.tab-selected) .editor-file-tab-content:hover {
  86. background-color: var(--bg-tertiary-themed);
  87. border-radius: var(--border-radius-medium);
  88. }
  89. .material-symbols {
  90. vertical-align: middle;
  91. font-size: var(--font-size-03);
  92. }
  93. .file-tree-icon,
  94. .linked-file-highlight {
  95. color: var(--tab-text-color);
  96. }
  97. .editor-file-tab-icon {
  98. position: relative;
  99. display: inline-flex;
  100. align-items: center;
  101. flex: 0 0 auto;
  102. }
  103. .file-tree-icon {
  104. margin-right: var(--spacing-01);
  105. }
  106. .linked-file-icon {
  107. position: relative;
  108. left: -2px;
  109. }
  110. .linked-file-highlight {
  111. position: absolute;
  112. top: 6px;
  113. left: 6px !important;
  114. font-size: var(--font-size-01);
  115. }
  116. &.tab-drop-left::after,
  117. &.tab-drop-right::after,
  118. .editor-tabs-row-hovered &:last-child::after {
  119. content: '';
  120. position: absolute;
  121. top: 0;
  122. bottom: 0;
  123. width: var(--editor-tab-drop-indicator-width);
  124. background-color: var(--border-primary-themed);
  125. }
  126. &.tab-drop-right::after,
  127. .editor-tabs-row-hovered &:last-child::after {
  128. right: calc(
  129. var(--editor-tab-drop-indicator-width) /
  130. -2 - var(--editor-tab-divider-width)
  131. );
  132. }
  133. &.tab-drop-left::after {
  134. left: calc(var(--editor-tab-drop-indicator-width) / -2);
  135. }
  136. &.tab-temporary {
  137. font-style: italic;
  138. }
  139. .editor-file-tab-action {
  140. display: flex;
  141. align-items: center;
  142. }
  143. .editor-file-tab-close-action {
  144. background: transparent;
  145. opacity: 0;
  146. border: none;
  147. color: var(--tab-text-color);
  148. cursor: pointer;
  149. margin: 0;
  150. padding: 0;
  151. display: flex;
  152. align-items: center;
  153. &:hover {
  154. color: var(--content-primary-themed);
  155. }
  156. }
  157. &:hover,
  158. &:focus-within,
  159. &.tab-selected {
  160. .editor-file-tab-close-action {
  161. opacity: 1;
  162. }
  163. }
  164. }
  165. .editor-file-tab-path {
  166. text-wrap: nowrap;
  167. max-width: var(--editor-tab-max-path-length);
  168. text-overflow: ellipsis;
  169. white-space: nowrap;
  170. direction: rtl;
  171. overflow: hidden;
  172. }