Browse Source

fix(ui): scope filetree pill tabs styling

David Hill 1 month ago
parent
commit
0dcb850a7a
2 changed files with 28 additions and 1 deletions
  1. 7 1
      packages/app/src/pages/session.tsx
  2. 21 0
      packages/ui/src/components/tabs.css

+ 7 - 1
packages/app/src/pages/session.tsx

@@ -2627,7 +2627,13 @@ export default function Page() {
             <Show when={layout.fileTree.opened()}>
             <Show when={layout.fileTree.opened()}>
               <div class="relative shrink-0 h-full" style={{ width: `${layout.fileTree.width()}px` }}>
               <div class="relative shrink-0 h-full" style={{ width: `${layout.fileTree.width()}px` }}>
                 <div class="h-full border-l border-border-weak-base flex flex-col overflow-hidden">
                 <div class="h-full border-l border-border-weak-base flex flex-col overflow-hidden">
-                  <Tabs variant="pill" value={fileTreeTab()} onChange={setFileTreeTabValue} class="h-full">
+                  <Tabs
+                    variant="pill"
+                    value={fileTreeTab()}
+                    onChange={setFileTreeTabValue}
+                    class="h-full"
+                    data-scope="filetree"
+                  >
                     <Tabs.List>
                     <Tabs.List>
                       <Tabs.Trigger value="changes" class="flex-1" classes={{ button: "w-full" }}>
                       <Tabs.Trigger value="changes" class="flex-1" classes={{ button: "w-full" }}>
                         {reviewCount()}{" "}
                         {reviewCount()}{" "}

+ 21 - 0
packages/ui/src/components/tabs.css

@@ -264,6 +264,27 @@
     }
     }
   }
   }
 
 
+  &[data-variant="pill"][data-orientation="horizontal"][data-scope="filetree"] {
+    [data-slot="tabs-list"] {
+      padding: 12px;
+      gap: 8px;
+    }
+
+    [data-slot="tabs-trigger-wrapper"] {
+      height: 26px;
+      border-radius: 6px;
+      color: var(--text-weak);
+
+      &:not(:has([data-selected])):hover:not(:disabled) {
+        color: var(--text-base);
+      }
+
+      &:has([data-selected]) {
+        color: var(--text-strong);
+      }
+    }
+  }
+
   &[data-orientation="vertical"] {
   &[data-orientation="vertical"] {
     flex-direction: row;
     flex-direction: row;