tabstitlecontrol.css 18.7 KB
Newer Older
B
wip  
Benjamin Pasero 已提交
1 2 3 4 5
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/*
	################################### z-index explainer ###################################

	Tabs have various levels of z-index depending on state, typically:
	- scrollbar should be above all
	- sticky (compact, shrink) tabs need to be above non-sticky tabs for scroll under effect
	including non-sticky tabs-top borders, otherwise these borders would not scroll under
	(https://github.com/microsoft/vscode/issues/111641)
	- bottom-border needs to be above tabs bottom border to win but also support sticky tabs
	(https://github.com/microsoft/vscode/issues/99084) <- this currently cannot be done and
	is still broken. putting sticky-tabs above tabs bottom border would not render this
	border at all for sticky tabs.

	On top of that there is 2 borders with a z-index for a general border below tabs
	- tabs bottom border
	- editor title bottom border (when breadcrumbs are disabled, this border will appear
	same as tabs bottom border)

	The following tabls shows the current stacking order:

	[z-index] 	[kind]
			7 	scrollbar
			6	active-tab border-bottom
			5	tabs, title border bottom
			4	sticky-tab
			2  	active/dirty-tab border top
			0   tab

	##########################################################################################
*/

37
/* Title Container */
38

39
.monaco-workbench .part.editor > .content .editor-group-container > .title.tabs > .tabs-and-actions-container {
40 41 42
	display: flex;
}

43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
.monaco-workbench .part.editor > .content .editor-group-container > .title.tabs > .tabs-and-actions-container.tabs-border-bottom {
	position: relative;
}

.monaco-workbench .part.editor > .content .editor-group-container > .title.tabs > .tabs-and-actions-container.tabs-border-bottom::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	z-index: 5;
	pointer-events: none;
	background-color: var(--tabs-border-bottom-color);
	width: 100%;
	height: 1px;
}

59
.monaco-workbench .part.editor > .content .editor-group-container > .title.tabs > .tabs-and-actions-container > .monaco-scrollable-element {
60
	flex: 1;
61 62
}

63
.monaco-workbench .part.editor > .content .editor-group-container > .title.tabs > .tabs-and-actions-container > .monaco-scrollable-element .scrollbar {
64
	z-index: 7;
65
	cursor: default;
B
Benjamin Pasero 已提交
66 67
}

68 69
/* Tabs Container */

70
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container {
B
Benjamin Pasero 已提交
71
	display: flex;
B
Benjamin Pasero 已提交
72
	height: 35px;
B
Benjamin Pasero 已提交
73
	scrollbar-width: none; /* Firefox: hide scrollbar */
B
Benjamin Pasero 已提交
74 75
}

76
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container.scroll {
B
Benjamin Pasero 已提交
77 78 79
	overflow: scroll !important;
}

80
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container::-webkit-scrollbar {
B
Benjamin Pasero 已提交
81
	display: none; /* Chrome + Safari: hide scrollbar */
B
Benjamin Pasero 已提交
82 83 84 85
}

/* Tab */

86
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab {
B
Benjamin Pasero 已提交
87
	position: relative;
B
Benjamin Pasero 已提交
88 89 90
	display: flex;
	white-space: nowrap;
	cursor: pointer;
91
	height: 35px;
B
Benjamin Pasero 已提交
92 93 94 95
	box-sizing: border-box;
	padding-left: 10px;
}

96 97 98
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.has-icon.tab-actions-right,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.has-icon.tab-actions-off:not(.sticky-compact) {
	padding-left: 5px; /* reduce padding when we show icons and are in shrinking mode and tab actions is not left (unless sticky-compact) */
B
Benjamin Pasero 已提交
99 100
}

101
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit {
102 103
	width: 120px;
	min-width: fit-content;
104
	min-width: -moz-fit-content;
M
Miguel Solorio 已提交
105
	flex-shrink: 0;
106 107
}

108
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink {
109
	min-width: 80px;
110 111 112
	flex-basis: 0; /* all tabs are even */
	flex-grow: 1; /* all tabs grow even */
	max-width: fit-content;
113
	max-width: -moz-fit-content;
114 115
}

116 117 118 119
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit.sticky-compact,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.sticky-compact,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit.sticky-shrink,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.sticky-shrink {
120

121
	/** Sticky compact/shrink tabs do not scroll in case of overflow and are always above unsticky tabs which scroll under */
122
	position: sticky;
123
	z-index: 4;
124

125
	/** Sticky compact/shrink tabs are even and never grow */
126 127
	flex-basis: 0;
	flex-grow: 0;
128 129 130 131
}

.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit.sticky-compact,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.sticky-compact {
132

133
	/** Sticky compact tabs have a fixed width of 38px */
134 135 136 137 138
	width: 38px;
	min-width: 38px;
	max-width: 38px;
}

139 140 141 142 143 144 145 146 147 148 149 150 151
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit.sticky-shrink,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.sticky-shrink {

	/** Sticky shrink tabs have a fixed width of 80px */
	width: 80px;
	min-width: 80px;
	max-width: 80px;
}

.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container.disable-sticky-tabs > .tab.sizing-fit.sticky-compact,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container.disable-sticky-tabs > .tab.sizing-shrink.sticky-compact,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container.disable-sticky-tabs > .tab.sizing-fit.sticky-shrink,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container.disable-sticky-tabs > .tab.sizing-shrink.sticky-shrink {
152

153
	/** Disable sticky positions for sticky compact/shrink tabs if the available space is too little */
154 155 156
	position: static;
}

157
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-left .action-label {
M
Miguel Solorio 已提交
158 159 160
	margin-right: 4px !important;
}

161 162
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.tab-actions-left::after,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.tab-actions-off::after {
B
Benjamin Pasero 已提交
163
	content: '';
164 165
	display: flex;
	flex: 0;
C
ChaseKnowlden 已提交
166
	width: 5px; /* Reserve space to hide tab fade when close button is left or off (fixes https://github.com/microsoft/vscode/issues/45728) */
167 168
}

169
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.tab-actions-left {
170
	min-width: 80px; /* make more room for close button when it shows to the left */
171
	padding-right: 5px; /* we need less room when sizing is shrink */
172 173
}

174
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dragged {
C
ChaseKnowlden 已提交
175
	transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (fixes https://github.com/microsoft/vscode/issues/18733) */
176 177
}

178
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dragged-over div {
C
ChaseKnowlden 已提交
179
	pointer-events: none; /* prevents cursor flickering (fixes https://github.com/microsoft/vscode/issues/38753) */
180 181
}

182
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-left {
183
	flex-direction: row-reverse;
184
	padding-left: 0;
185
	padding-right: 10px;
186 187
}

B
Benjamin Pasero 已提交
188 189
/* Tab border top/bottom */

190 191
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab > .tab-border-top-container,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab > .tab-border-bottom-container {
B
Benjamin Pasero 已提交
192 193 194
	display: none; /* hidden by default until a color is provided (see below) */
}

195 196 197
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active.tab-border-top > .tab-border-top-container,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active.tab-border-bottom > .tab-border-bottom-container,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty-border-top > .tab-border-top-container {
B
Benjamin Pasero 已提交
198 199 200 201 202
	display: block;
	position: absolute;
	left: 0;
	pointer-events: none;
	width: 100%;
A
Alexander 已提交
203 204
}

205
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active.tab-border-top > .tab-border-top-container {
206
	z-index: 2;
A
Alexander 已提交
207
	top: 0;
B
Benjamin Pasero 已提交
208
	height: 1px;
A
Alexander 已提交
209
	background-color: var(--tab-border-top-color);
B
Benjamin Pasero 已提交
210 211
}

212
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active.tab-border-bottom > .tab-border-bottom-container {
213
	z-index: 6;
B
Benjamin Pasero 已提交
214 215
	bottom: 0;
	height: 1px;
A
Alexander 已提交
216 217 218
	background-color: var(--tab-border-bottom-color);
}

219
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty-border-top > .tab-border-top-container {
220
	z-index: 2;
A
Alexander 已提交
221 222 223
	top: 0;
	height: 2px;
	background-color: var(--tab-dirty-border-top-color);
B
Benjamin Pasero 已提交
224 225
}

226 227
/* Tab Label */

228
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab .tab-label {
229 230
	margin-top: auto;
	margin-bottom: auto;
231
	line-height: 35px; /* aligns icon and label vertically centered in the tab */
232 233
}

234
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink .tab-label {
235 236 237
	position: relative;
}

238
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container >  .tab.sizing-shrink > .tab-label::after {
B
Benjamin Pasero 已提交
239
	content: '';
240 241 242
	position: absolute;
	right: 0;
	height: 100%;
243
	width: 5px;
244 245 246 247
	opacity: 1;
	padding: 0;
}

248
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container >  .tab.sizing-shrink:focus > .tab-label::after {
C
ChaseKnowlden 已提交
249
	opacity: 0; /* when tab has the focus this shade breaks the tab border (fixes https://github.com/microsoft/vscode/issues/57819) */
250 251
}

252 253
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sticky-compact:not(.has-icon) .monaco-icon-label {
	text-align: center; /* ensure that sticky-compact tabs without icon have label centered */
254 255
}

256
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit .monaco-icon-label,
257
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit .monaco-icon-label > .monaco-icon-label-container {
C
ChaseKnowlden 已提交
258
	overflow: visible; /* fixes https://github.com/microsoft/vscode/issues/20182 */
259 260
}

261
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink > .monaco-icon-label > .monaco-icon-label-container {
262 263 264
	text-overflow: clip;
}

265
.monaco-workbench.hc-black .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink > .monaco-icon-label > .monaco-icon-label-container {
266 267 268
	text-overflow: ellipsis;
}

269
/* Tab Actions */
B
Benjamin Pasero 已提交
270

271
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab > .tab-actions {
B
Benjamin Pasero 已提交
272 273 274
	margin-top: auto;
	margin-bottom: auto;
	width: 28px;
B
Benjamin Pasero 已提交
275 276
}

277
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-right.sizing-shrink > .tab-actions {
278
	flex: 0;
279
	overflow: hidden; /* let the tab actions be pushed out of view when sizing is set to shrink to make more room... */
280 281
}

282
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty.tab-actions-right.sizing-shrink > .tab-actions,
283
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sticky.tab-actions-right.sizing-shrink > .tab-actions,
284 285
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-right.sizing-shrink:hover > .tab-actions,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-right.sizing-shrink > .tab-actions:focus-within {
286
	overflow: visible; /* ...but still show the tab actions on hover, focus and when dirty or sticky */
287 288
}

289
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-off:not(.dirty):not(.sticky) > .tab-actions,
290
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-off.sticky-compact > .tab-actions {
291
	display: none; /* hide the tab actions when we are configured to hide it (unless dirty or sticky, but always when sticky-compact) */
292 293
}

294 295 296 297
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active > .tab-actions .action-label,		/* always show tab actions for active tab */
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab > .tab-actions .action-label:focus,		/* always show tab actions on focus */
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab:hover > .tab-actions .action-label,		/* always show tab actions on hover */
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active:hover > .tab-actions .action-label,	/* always show tab actions on hover */
298
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.sticky > .tab-actions .action-label,		/* always show tab actions for sticky tabs */
299
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.dirty > .tab-actions .action-label {		/* always show tab actions for dirty tabs */
B
Benjamin Pasero 已提交
300 301 302
	opacity: 1;
}

303
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab > .tab-actions .action-label.codicon {
M
Miguel Solorio 已提交
304
	color: inherit;
M
Miguel Solorio 已提交
305
	font-size: 16px;
M
Miguel Solorio 已提交
306 307
}

308 309 310 311 312
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.sticky.dirty > .tab-actions .action-label:not(:hover)::before,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sticky.dirty > .tab-actions .action-label:not(:hover)::before {
	content: "\ebb2"; /* use `pinned-dirty` icon unicode for sticky-dirty indication */
}

313 314
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.dirty > .tab-actions .action-label:not(:hover)::before,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty > .tab-actions .action-label:not(:hover)::before {
315
	content: "\ea71"; /* use `circle-filled` icon unicode for dirty indication */
316 317
}

318 319 320 321 322 323
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active > .tab-actions .action-label,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active:hover > .tab-actions .action-label,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty > .tab-actions .action-label,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sticky > .tab-actions .action-label,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab:hover > .tab-actions .action-label {
	opacity: 0.5; /* show tab actions dimmed for inactive group */
B
Benjamin Pasero 已提交
324 325
}

326
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab > .tab-actions .action-label {
B
Benjamin Pasero 已提交
327 328 329 330 331 332 333 334
	opacity: 0;
	display: block;
	height: 16px;
	width: 16px;
	background-size: 16px;
	background-position: center center;
	background-repeat: no-repeat;
	margin-right: 0.5em;
335 336
}

337
/* No Tab Actions */
B
Benjamin Pasero 已提交
338

339 340
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-off {
	padding-right: 10px; /* give a little bit more room if tab actions is off */
B
Benjamin Pasero 已提交
341 342
}

343
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.tab-actions-off:not(.sticky-compact) {
344
	padding-right: 5px; /* we need less room when sizing is shrink (unless tab is sticky-compact) */
345 346
}

347 348
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-off.dirty-border-top > .tab-actions {
	display: none; /* hide dirty state when highlightModifiedTabs is enabled and when running without tab actions */
M
Miguel Solorio 已提交
349 350
}

351 352
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-off.dirty:not(.dirty-border-top):not(.sticky-compact),
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-off.sticky:not(.sticky-compact) {
353
	padding-right: 0; /* remove extra padding when we are running without tab actions (unless tab is sticky-compact) */
B
Benjamin Pasero 已提交
354 355
}

356 357
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.tab-actions-off > .tab-actions {
	pointer-events: none; /* don't allow tab actions to be clicked when running without tab actions */
358 359
}

360
/* Editor Actions */
361

362
.monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions {
B
Benjamin Pasero 已提交
363
	cursor: default;
B
wip  
Benjamin Pasero 已提交
364
	flex: initial;
M
Miguel Solorio 已提交
365
	padding: 0 8px 0 4px;
366 367 368 369 370
	height: 35px;
}

/* Breadcrumbs */

371
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control {
372
	flex: 1 100%;
373
	height: 22px;
J
Johannes Rieken 已提交
374
	cursor: default;
375
}
376

377
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control .monaco-icon-label {
378 379 380 381
	height: 22px;
	line-height: 22px;
}

382
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control .monaco-icon-label::before {
383
	height: 22px; /* tweak the icon size of the editor labels when icons are enabled */
384
}
J
Johannes Rieken 已提交
385

B
Benjamin Pasero 已提交
386
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item {
387
	max-width: 80%;
388 389
}

B
Benjamin Pasero 已提交
390
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item::before {
391
	width: 16px;
392
	height: 22px;
393 394 395
	display: flex;
	align-items: center;
	justify-content: center;
J
Johannes Rieken 已提交
396 397
}

B
Benjamin Pasero 已提交
398
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item:last-child {
399 400
	padding-right: 8px;
}