Skip to content

Commit 0bec006

Browse files
Rexarriordaniel-lxs
authored andcommitted
tailwind css for disabledTool swipper
1 parent 235312d commit 0bec006

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

webview-ui/src/components/mcp/McpToolRow.tsx

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,11 @@ const McpToolRow = ({ tool, serverName, serverSource, alwaysAllowMcp }: McpToolR
6060
role="switch"
6161
aria-checked={tool.enabledForPrompt}
6262
tabIndex={0}
63-
style={{
64-
width: "32px",
65-
height: "16px",
66-
backgroundColor: tool.enabledForPrompt
67-
? "var(--vscode-button-background)"
68-
: "var(--vscode-titleBar-inactiveForeground)",
69-
borderRadius: "8px",
70-
position: "relative",
71-
cursor: "pointer",
72-
transition: "background-color 0.2s",
73-
opacity: tool.enabledForPrompt ? 1 : 0.6,
74-
}}
63+
className={`relative h-4 w-8 cursor-pointer rounded-full transition-colors ${
64+
tool.enabledForPrompt
65+
? "bg-vscode-button-background"
66+
: "bg-vscode-titleBar-inactiveForeground"
67+
} ${tool.enabledForPrompt ? "opacity-100" : "opacity-60"}`}
7568
onClick={handleEnabledForPromptChange}
7669
onKeyDown={(e) => {
7770
if (e.key === "Enter" || e.key === " ") {
@@ -82,16 +75,9 @@ const McpToolRow = ({ tool, serverName, serverSource, alwaysAllowMcp }: McpToolR
8275
data-tool-prompt-toggle={tool.name}
8376
title={t("mcp:tool.togglePromptInclusion")}>
8477
<div
85-
style={{
86-
width: "12px",
87-
height: "12px",
88-
backgroundColor: "var(--vscode-titleBar-activeForeground)",
89-
borderRadius: "50%",
90-
position: "absolute",
91-
top: "2px",
92-
left: tool.enabledForPrompt ? "18px" : "2px",
93-
transition: "left 0.2s",
94-
}}
78+
className={`absolute top-0.5 h-3 w-3 rounded-full bg-vscode-titleBar-activeForeground transition-all ${
79+
tool.enabledForPrompt ? "left-[18px]" : "left-0.5"
80+
}`}
9581
/>
9682
</div>
9783
)}

webview-ui/src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
--color-vscode-sideBarSectionHeader-background: var(--vscode-sideBarSectionHeader-background);
119119
--color-vscode-sideBarSectionHeader-border: var(--vscode-sideBarSectionHeader-border);
120120

121+
--color-vscode-titleBar-activeForeground: var(--vscode-titleBar-activeForeground);
122+
--color-vscode-titleBar-inactiveForeground: var(--vscode-titleBar-inactiveForeground);
123+
121124
--color-vscode-charts-green: var(--vscode-charts-green);
122125
--color-vscode-charts-yellow: var(--vscode-charts-yellow);
123126

0 commit comments

Comments
 (0)