Skip to content

Commit e19877c

Browse files
refactor(web): ghost-muted icons follow the text; add ghost-destructive
Twelve icon buttons set [--control-icon-color:currentColor] so the glyph followed the label color instead of the variant's fixed muted tint, and then coloured the label per site. The fixed tint was the drift: a muted ghost button's icon should already read as the label does. ghost-muted now uses currentColor, and the delete affordances that turned red on hover become variant="ghost-destructive". The three state indicators (favorite star, setting-inheritance marker, update advisory) carried their state colour on the button; it now sits on the icon, where it belongs, and the button is a plain ghost-muted. Visible effect: the favorite star is tinted with the warning token instead of text-yellow-500 and reads muted at rest like its neighbours; the inheritance marker's "environment" and "default" states share the muted tone. Lowers the no-restyle ceiling from 999 to 965. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent b9fe12d commit e19877c

11 files changed

Lines changed: 24 additions & 51 deletions

‎apps/web/src/components/LegacySidebar.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3038,7 +3038,6 @@ const SidebarProjectsContent = memo(function SidebarProjectsContent(
30383038
variant="ghost-muted"
30393039
aria-label="Add project"
30403040
data-testid="sidebar-add-project-trigger"
3041-
className="[--control-icon-color:currentColor] text-icon-muted"
30423041
onClick={openAddProject}
30433042
/>
30443043
}

‎apps/web/src/components/RightPanelTabs.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ function RightPanelEmptyState(props: {
559559
render={
560560
<Button
561561
aria-label="Open browser in a profile"
562-
className="absolute top-1/2 right-8 -translate-y-1/2 [--control-icon-color:currentColor]"
562+
className="absolute top-1/2 right-8 -translate-y-1/2"
563563
size="icon-xs"
564564
variant="ghost-muted"
565565
/>

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4517,7 +4517,7 @@ export default function Sidebar() {
45174517
tabIndex={-1}
45184518
aria-hidden="true"
45194519
title={`Project settings for ${project.displayName}`}
4520-
className="ml-auto [--control-icon-color:currentColor] text-icon-muted focus-visible:bg-accent focus-visible:text-foreground"
4520+
className="ml-auto focus-visible:bg-accent focus-visible:text-foreground"
45214521
onPointerDown={(event) => event.stopPropagation()}
45224522
onClick={(event) => {
45234523
void handleProjectSettings(event, project);

‎apps/web/src/components/chat/SnapShotAttachmentDetails.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function SnapShotContentsButton({
150150
aria-label={
151151
includesAccessibility ? "View accessibility data" : "No accessibility data"
152152
}
153-
className={cn("[--control-icon-color:currentColor]", className)}
153+
className={className}
154154
onClick={(event) => event.stopPropagation()}
155155
size="icon-micro"
156156
variant="ghost-muted"

‎apps/web/src/components/pullRequest/PullRequestListFilters.tsx‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -500,14 +500,7 @@ export function PullRequestFiltersMenu({
500500
];
501501
return (
502502
<Menu onOpenChange={onOpenChange}>
503-
<MenuTrigger
504-
render={
505-
<Button
506-
className={filterCount > 0 ? "[--control-icon-color:currentColor]" : undefined}
507-
variant="outline"
508-
/>
509-
}
510-
>
503+
<MenuTrigger render={<Button variant="outline" />}>
511504
<ListFilterIcon className="size-4" />
512505
<span>Filters</span>
513506
{filterCount > 0 ? (

‎apps/web/src/components/settings/ProviderInstanceCard.tsx‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,6 @@ function ProviderEnvironmentSection(props: {
300300
type="button"
301301
size="icon-micro"
302302
variant="ghost-muted"
303-
className={cn(
304-
"[--control-icon-color:currentColor]",
305-
variable.sensitive && "text-foreground",
306-
)}
307303
onClick={() => {
308304
const sensitive = !variable.sensitive;
309305
updateVariable(variable.id, {
@@ -331,8 +327,7 @@ function ProviderEnvironmentSection(props: {
331327
<Button
332328
type="button"
333329
size="icon-micro"
334-
variant="ghost-muted"
335-
className="[--control-icon-color:currentColor] hover:text-destructive"
330+
variant="ghost-destructive"
336331
onClick={() => removeVariable(variable.id)}
337332
aria-label={`Remove environment variable ${variable.name || index + 1}`}
338333
>
@@ -704,16 +699,12 @@ export function ProviderInstanceCard({
704699
<Button
705700
type="button"
706701
size="icon-xs"
707-
variant="ghost"
708-
className={cn(
709-
"[--control-icon-color:currentColor]",
710-
versionAdvisory.emphasis === "strong"
711-
? "text-warning hover:text-warning"
712-
: "text-muted-foreground hover:text-foreground",
713-
)}
702+
variant="ghost-muted"
714703
aria-label="Update available — view details"
715704
>
716-
<ArrowUpCircleIcon />
705+
<ArrowUpCircleIcon
706+
className={cn(versionAdvisory.emphasis === "strong" && "text-warning")}
707+
/>
717708
</Button>
718709
}
719710
/>
@@ -793,9 +784,8 @@ export function ProviderInstanceCard({
793784
<Button
794785
type="button"
795786
size="icon-xs"
796-
variant="ghost-muted"
787+
variant="ghost-destructive"
797788
disabled={readOnly}
798-
className="[--control-icon-color:currentColor] hover:text-destructive"
799789
onClick={onDelete}
800790
aria-label={`Delete instance ${instanceId}`}
801791
>

‎apps/web/src/components/settings/ProviderModelsSection.tsx‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,21 +312,15 @@ export function ProviderModelsSection({
312312
render={
313313
<Button
314314
size="icon-micro"
315-
variant="ghost"
316-
className={cn(
317-
"[--control-icon-color:currentColor]",
318-
isFavorite
319-
? "text-yellow-500 hover:text-yellow-600"
320-
: "text-muted-foreground/40 hover:text-muted-foreground",
321-
)}
315+
variant="ghost-muted"
322316
onClick={() => handleToggleFavorite(model.slug)}
323317
aria-label={`${isFavorite ? "Remove" : "Add"} ${model.name} ${
324318
isFavorite ? "from" : "to"
325319
} favorites`}
326320
/>
327321
}
328322
>
329-
<StarIcon className={cn("size-3", isFavorite && "fill-current")} />
323+
<StarIcon className={cn("size-3", isFavorite && "fill-current text-warning")} />
330324
</TooltipTrigger>
331325
<TooltipPopup side="top">
332326
{isFavorite ? "Remove from favorites" : "Add to favorites"}

‎apps/web/src/components/settings/SettingInheritance.tsx‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,18 @@ export function SettingInheritance({
208208
size="icon-micro"
209209
variant="ghost-muted"
210210
aria-label={`${overrideSummary}. Show where this value comes from`}
211-
className={cn(
212-
"[--control-icon-color:currentColor]",
213-
state === "overridden"
214-
? "text-primary hover:text-primary"
215-
: state === "mixed"
216-
? "text-warning hover:text-warning"
217-
: state === "environment"
218-
? "text-foreground/70 hover:text-foreground"
219-
: "text-muted-foreground/60 hover:text-foreground",
220-
)}
221211
/>
222212
}
223213
/>
224214
}
225215
>
226-
<LayersIcon className="size-3" />
216+
<LayersIcon
217+
className={cn(
218+
"size-3",
219+
state === "overridden" && "text-primary",
220+
state === "mixed" && "text-warning",
221+
)}
222+
/>
227223
</TooltipTrigger>
228224
<TooltipPopup side="top">{overrideSummary}</TooltipPopup>
229225
</Tooltip>

‎apps/web/src/components/settings/ThemeSettings.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ function ThemeLibraryCard({
387387
: `Remove ${theme.label}`
388388
}
389389
size="icon-xs"
390-
variant="ghost"
391-
className="text-muted-foreground hover:text-destructive"
390+
variant="ghost-destructive"
392391
onClick={(event) => {
393392
event.stopPropagation();
394393
onRemove();

‎apps/web/src/components/ui/button.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ const buttonVariants = cva(
4949
ghost:
5050
"[--control-icon-color:var(--contrast-muted-foreground)] border-transparent text-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent",
5151
"ghost-muted":
52-
"[--control-icon-color:var(--contrast-muted-foreground)] border-transparent text-muted-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-foreground",
52+
"[--control-icon-color:currentColor] border-transparent text-muted-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-foreground",
53+
"ghost-destructive":
54+
"[--control-icon-color:currentColor] border-transparent text-muted-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-destructive",
5355
glass:
5456
"surface-glass [--control-icon-color:var(--contrast-muted-foreground)] border-border/60 text-foreground shadow-sm [:hover,[data-pressed]]:border-border",
5557
link: "border-transparent underline-offset-4 [:hover,[data-pressed]]:underline",

0 commit comments

Comments
 (0)