Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

[Button] Variant / Tone checks are overly complex #10983

@kyledurand

Description

@kyledurand

Button has variant and tone checks that look like this:

variant === 'primary' && styles.primary,
variant === 'plain' && styles.plain,
variant === 'tertiary' && styles.primary,
variant === 'tertiary' && styles.tertiary,
variant === 'monochromePlain' && styles.monochrome,
variant === 'monochromePlain' && styles.plain,
tone === 'critical' && styles.critical,
tone === 'success' && styles.success,

There are multiple checks for variants that apply different classes leading to code that's harder to maintain. We should be able to simplify this by using the variationName helper and cleaning up some css

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions