| 67 | * no `current` key, so it compiles to nothing at all. |
| 68 | */ |
| 69 | const dividerFor = (variant: ButtonVariant): string | false => { |
| 70 | // Sits on a solid fill, where only the label colour is guaranteed to read. |
| 71 | if (variant === ButtonVariant.Primary) { |
| 72 | return classNames( |
| 73 | DIVIDER_BASE, |
| 74 | 'before:inset-y-0 before:bg-[color-mix(in_srgb,var(--button-color,var(--button-default-color)),transparent_80%)]', |
| 75 | ); |
| 76 | } |
| 77 | |
| 78 | // A bare ghost button: a full-height rule would float with nothing to anchor |
| 79 | // it, so it gets a shorter one in the colour `tailwind/buttons.ts` gives the |
| 80 | // Subtle variant's border. |
| 81 | if (variant === ButtonVariant.Tertiary) { |
| 82 | return classNames( |
| 83 | DIVIDER_BASE, |
| 84 | 'before:inset-y-1.5 before:bg-[color-mix(in_srgb,var(--theme-border-subtlest-primary),transparent_70%)]', |
| 85 | ); |
| 86 | } |
| 87 | |
| 88 | return false; |
| 89 | }; |
| 90 | |
| 91 | /** |
| 92 | * Two real buttons that read as one control: the left half runs the primary |