blob: 6d13caf6ebad867720e51aaf3a5397008bf53609 [file] [edit]
// Copyright (C) 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
@use "../assets/theme" as *;
.pf-tabs {
display: flex;
flex-direction: column;
height: 100%;
&__tabs {
display: flex;
background-color: var(--pf-color-background-secondary);
border-bottom: 1px solid var(--pf-color-border);
padding-inline: 3px;
align-items: baseline;
}
&__tab {
display: flex;
align-items: baseline;
gap: 2px;
font-family: var(--pf-font-compact);
padding: 5px 7px;
margin-top: 2px;
margin-bottom: -1px; // Overlap the border
cursor: pointer;
border-radius: 3px 3px 0 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
border-style: solid;
border-color: transparent;
border-width: 1px 1px 0 1px;
color: var(--pf-color-text-muted);
&:hover {
background: color_hover(transparent);
color: var(--pf-color-text);
}
&-icon {
align-self: center;
}
&--active {
cursor: default;
background-color: var(--pf-color-background);
border-color: var(--pf-color-border);
color: var(--pf-color-text);
z-index: 1;
// Don't change background on hover for active tab
&:hover {
background-color: var(--pf-color-background);
}
}
}
&__tab-menu-btn {
visibility: hidden;
&.pf-active {
visibility: visible;
}
}
&__tab:hover &__tab-menu-btn {
visibility: visible;
}
&__tab-title {
margin: 0px 4px;
overflow: hidden;
user-select: none;
}
&__tab-rename-input {
border: none;
outline: none;
background: transparent;
font: inherit;
color: inherit;
padding: 0;
margin: 0 4px;
width: 100%;
}
&__tab-wrapper {
display: contents;
&--dragging > .pf-tabs__tab {
opacity: 0.5;
}
&--drop-before > .pf-tabs__tab {
box-shadow: -2px 0 0 0 var(--pf-color-primary);
}
&--drop-after > .pf-tabs__tab {
box-shadow: 2px 0 0 0 var(--pf-color-primary);
}
}
&__new-tab-btn {
margin-left: 2px;
}
&__right-content {
margin-left: auto;
display: flex;
align-items: baseline;
}
&__content {
flex: 1;
overflow: auto;
}
// The 'underline' variant: flat text tabs on a transparent bar with a
// primary underline on the active tab, matching the look of the
// (deprecated) TabStrip component.
&--underline {
.pf-tabs__tabs {
background-color: transparent;
border-bottom: none;
padding-inline: 0;
}
.pf-tabs__tab {
margin-top: 0;
margin-bottom: 0;
// A bit more padding than the card variant's 5px 7px: without the box
// border to delineate the handle, the tabs need more breathing room
// (and a bigger click target).
padding: 5px 10px;
border: none;
border-bottom: 2px solid transparent;
border-radius: 0;
&--active {
background-color: transparent;
border-bottom-color: var(--pf-color-primary);
color: var(--pf-color-primary);
// The boxed variant suppresses the hover background on the active
// tab; the flat one keeps it, as TabStrip does.
&:hover {
background-color: color_hover(transparent);
}
}
}
}
}