Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-ghost-buttons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/kumo": patch
---

Remove the inherited resting background from ghost buttons so translucent parent surfaces do not appear darker beneath them.
7 changes: 7 additions & 0 deletions packages/kumo/src/components/button/button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ describe("Button", () => {
expect(button.classList.contains("select-text")).toBe(false);
});

it("does not paint a resting background for ghost buttons", () => {
const className = buttonVariants({ variant: "ghost" });

expect(className).toContain("hover:bg-kumo-tint");
expect(className).not.toContain("bg-inherit");
});

it("forwards ref to the <button> DOM node", () => {
const ref = React.createRef<HTMLButtonElement>();
render(<Button ref={ref}>Click</Button>);
Expand Down
2 changes: 1 addition & 1 deletion packages/kumo/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const KUMO_BUTTON_VARIANTS = {
description: "Default button style for most actions",
},
ghost: {
classes: "text-kumo-default hover:bg-kumo-tint shadow-none bg-inherit",
classes: "text-kumo-default hover:bg-kumo-tint shadow-none",
description: "Minimal button with no background",
},
destructive: {
Expand Down