Skip to content

Commit

Permalink
Always use secondary variant in ButtonGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Jul 4, 2024
1 parent d31230b commit c3fddbf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 62 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-taxis-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': minor
---

Always use the secondary Button variant for the second button in a ButtonGroup. Previously, it switched to the tertiary variant in narrow spaces.
61 changes: 0 additions & 61 deletions packages/circuit-ui/components/Button/base.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -249,67 +249,6 @@
}
}

@container cui-button-group (width > 370px) {
/* Keep in sync with the .secondary class above */
.tertiary {
color: var(--cui-fg-normal);
background-color: var(--cui-bg-normal);
border-color: var(--cui-border-normal);
}

.tertiary:hover {
color: var(--cui-fg-normal-hovered);
background-color: var(--cui-bg-subtle-hovered);
border-color: var(--cui-border-normal-hovered);
}

.tertiary:active,
.tertiary[aria-expanded="true"],
.tertiary[aria-pressed="true"] {
color: var(--cui-fg-normal-pressed);
background-color: var(--cui-bg-subtle-pressed);
border-color: var(--cui-border-normal-pressed);
}

.tertiary.destructive {
color: var(--cui-fg-danger);
}

.tertiary.destructive:hover {
color: var(--cui-fg-danger-hovered);
background-color: var(--cui-bg-danger-hovered);
border-color: var(--cui-border-danger-hovered);
}

.tertiary.destructive:active,
.tertiary.destructive[aria-expanded="true"],
.tertiary.destructive[aria-pressed="true"] {
color: var(--cui-fg-danger-pressed);
background-color: var(--cui-bg-danger-pressed);
border-color: var(--cui-border-danger-pressed);
}

.tertiary:disabled,
.tertiary[disabled],
.tertiary[aria-disabled="true"] {
color: var(--cui-fg-normal-disabled);
background-color: var(--cui-bg-normal);
border-color: var(--cui-border-normal-disabled);
}

.tertiary.destructive:disabled,
.tertiary.destructive[disabled],
.tertiary.destructive[aria-disabled="true"] {
color: var(--cui-fg-danger-disabled);
background-color: var(--cui-bg-normal);
border-color: var(--cui-border-normal-disabled);
}

.tertiary .label {
text-decoration: none;
}
}

/* Disabled */
.base:disabled,
.base[disabled],
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
{...actions.secondary}
size={size || actions.secondary.size}
className={clsx(styles.secondary, actions.secondary.className)}
variant="tertiary"
variant="secondary"
/>
)}
</div>
Expand Down

0 comments on commit c3fddbf

Please sign in to comment.