| <style> |
| :host { |
| --tabstrip-tab-title-height: 40px; |
| --tabstrip-tab-transition-duration: 250ms; |
| |
| cursor: pointer; |
| height: var(--tabstrip-tab-height); |
| position: relative; |
| width: var(--tabstrip-tab-width); |
| } |
| |
| #dragImage { |
| background: var(--tabstrip-tab-background-color); |
| border-radius: var(--tabstrip-tab-border-radius); |
| box-shadow: 0 0 0 1px var(--tabstrip-tab-separator-color); |
| color: var(--tabstrip-tab-text-color); |
| display: flex; |
| flex-direction: column; |
| height: 100%; |
| overflow: hidden; |
| width: 100%; |
| } |
| |
| :host([active]) #dragImage { |
| box-shadow: 0 0 0 2px var(--tabstrip-tab-active-border-color); |
| outline: none; |
| } |
| |
| #title { |
| align-items: center; |
| border-block-end: 1px solid var(--tabstrip-tab-separator-color); |
| box-sizing: border-box; |
| display: flex; |
| height: var(--tabstrip-tab-title-height); |
| justify-content: center; |
| margin: 0; |
| overflow: hidden; |
| } |
| |
| #faviconContainer { |
| --favicon-size: 16px; |
| flex-shrink: 0; |
| height: var(--favicon-size); |
| margin-inline-end: 8px; |
| margin-inline-start: 12px; |
| position: relative; |
| width: var(--favicon-size); |
| } |
| |
| #progressSpinner, |
| #favicon, |
| #crashedIcon { |
| height: var(--favicon-size); |
| left: 50%; |
| position: absolute; |
| top: 50%; |
| transform: translate(-50%, -50%); |
| width: var(--favicon-size); |
| } |
| |
| #progressSpinner { |
| -webkit-mask: |
| url(chrome://resources/images/throbber_small.svg) |
| center/contain no-repeat; |
| display: none; |
| } |
| |
| #favicon { |
| background-size: contain; |
| transition: border-radius var(--tabstrip-tab-transition-duration); |
| } |
| |
| #crashedIcon { |
| -webkit-mask: |
| url(chrome://theme/IDR_CRASH_SAD_FAVICON@2x) |
| center/contain no-repeat; |
| background-color: currentColor; |
| opacity: 0; |
| transform: translate(-50%, 100%); |
| } |
| |
| #blocked { |
| background: var(--tabstrip-tab-blocked-color); |
| border: solid 1px var(--tabstrip-tab-background-color); |
| border-radius: 50%; |
| bottom: 0; |
| display: none; |
| height: 6px; |
| position: absolute; |
| right: 0; |
| transform: translate(50%, 50%); |
| width: 6px; |
| } |
| |
| :host([waiting]) #progressSpinner, |
| :host([loading]) #progressSpinner { |
| display: block; |
| } |
| |
| :host([loading]) #favicon { |
| border-radius: 50%; |
| height: calc(var(--favicon-size) - 6px); |
| overflow: hidden; |
| width: calc(var(--favicon-size) - 6px); |
| } |
| |
| :host([waiting]) #progressSpinner { |
| background-color: var(--tabstrip-tab-waiting-spinning-color); |
| transform: /* Center first, then flip horizontally. */ |
| translate(-50%, -50%) scaleX(-1); |
| } |
| |
| :host([waiting]) #favicon { |
| display: none; |
| } |
| |
| :host([loading]) #progressSpinner { |
| background-color: var(--tabstrip-tab-loading-spinning-color); |
| } |
| |
| :host([crashed]) #favicon { |
| opacity: 0; |
| transform: translate(-50%, 100%); |
| transition: |
| opacity var(--tabstrip-tab-transition-duration), |
| transform var(--tabstrip-tab-transition-duration); |
| } |
| |
| :host([crashed]) #crashedIcon { |
| opacity: 1; |
| transform: translate(-50%, -50%); |
| transition: |
| opacity var(--tabstrip-tab-transition-duration), |
| transform var(--tabstrip-tab-transition-duration); |
| /* Wait until transition for #favicon finishes. */ |
| transition-delay: var(--tabstrip-tab-transition-duration); |
| } |
| |
| :host([blocked]) #blocked { |
| display: block; |
| } |
| |
| #titleText { |
| font-size: 100%; |
| font-weight: normal; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| white-space: nowrap; |
| } |
| |
| #close { |
| -webkit-appearance: none; |
| align-items: center; |
| background-color: transparent; |
| border: 0; |
| color: inherit; |
| cursor: pointer; |
| display: flex; |
| flex-shrink: 0; |
| height: 100%; |
| justify-content: center; |
| margin-inline-start: auto; |
| padding: 0; |
| position: relative; |
| width: 36px; |
| } |
| |
| #closeIcon { |
| -webkit-mask: |
| url(chrome://resources/images/icon_clear.svg)center/contain no-repeat; |
| background-color: currentColor; |
| display: block; |
| height: 18px; |
| position: relative; |
| width: 18px; |
| } |
| |
| #thumbnail { |
| align-items: center; |
| background: var(--tabstrip-tab-background-color); |
| display: flex; |
| flex: 1; |
| justify-content: center; |
| } |
| |
| #thumbnailImg { |
| height: calc(var(--tabstrip-tab-height) - var(--tabstrip-tab-title-height)); |
| object-fit: cover; |
| pointer-events: none; |
| width: var(--tabstrip-tab-width); |
| } |
| |
| #thumbnailImg:not([src]) { |
| display: none; |
| pointer-events: none; |
| width: 100%; |
| } |
| |
| /* Pinned tab styles */ |
| :host([pinned]) { |
| height: var(--tabstrip-pinned-tab-size); |
| width: var(--tabstrip-pinned-tab-size); |
| } |
| |
| :host([pinned]) #title { |
| border-block-end: 0; |
| height: 100%; |
| } |
| |
| :host([pinned]) #titleText, |
| :host([pinned]) #close, |
| :host([pinned]) #thumbnail { |
| display: none; |
| } |
| |
| :host([dragging]) #dragPlaceholder { |
| background: var(--tabstrip-tab-background-color); |
| border-radius: var(--tabstrip-tab-border-radius); |
| height: 100%; |
| opacity: 0.5; |
| width: 100%; |
| } |
| |
| /* When being dragged, the contents of the drag image needs to be off-screen |
| * with nothing else on top or below obscuring it. */ |
| :host([dragging]) #dragImage { |
| box-shadow: none; |
| position: absolute; |
| top: -999px; |
| } |
| </style> |
| |
| <div id="dragPlaceholder"></div> |
| |
| <div id="dragImage"> |
| <header id="title"> |
| <div id="faviconContainer"> |
| <div id="progressSpinner"></div> |
| <div id="favicon"></div> |
| <div id="crashedIcon"></div> |
| <div id="blocked"></div> |
| </div> |
| <h2 id="titleText"></h2> |
| <button id="close"> |
| <span id="closeIcon"></span> |
| </button> |
| </header> |
| |
| <div id="thumbnail"> |
| <img id="thumbnailImg"> |
| </div> |
| </div> |