Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

style(button): add scuffed color logic for cta theme (#3470)

Seamus06b1f12bd1fb
diff --git a/js/app/packages/ui/components/Button.tsx b/js/app/packages/ui/components/Button.tsx
index 66364bf6d7..9c2a9c0078 100644
--- a/js/app/packages/ui/components/Button.tsx
+++ b/js/app/packages/ui/components/Button.tsx
@@ -4,6 +4,7 @@ import { Tooltip } from './Tooltip';
import type { HotkeyToken } from '@core/hotkey/tokens';
import type { Placement } from '@floating-ui/dom';
import { cn } from '../utils/classname';
+import { themeReactive } from '@theme/signals/themeReactive';
import { useButtonGroupContext } from './ButtonGroup';
import { Layer } from './Layer';
@@ -33,7 +34,7 @@ const variantStyles: Record<ButtonVariant, string> = {
base: 'bg-transparent text-ink-muted border border-edge-muted not-disabled:hover:bg-hover not-disabled:hover:text-ink active:bg-active disabled:opacity-30 ',
active: 'bg-accent-bg text-accent border border-accent disabled:opacity-30 ',
ghost: 'bg-transparent text-ink-muted not-disabled:hover:bg-hover not-disabled:hover:text-ink active:bg-active disabled:opacity-30 ',
- 'cta': 'bg-accent text-surface border border-transparent not-disabled:hover:bg-accent/90 active:bg-accent/80 disabled:opacity-30 ',
+ 'cta': 'bg-accent text-surface border border-transparent not-disabled:hover:bg-accent/90 active:bg-accent/80 disabled:opacity-30 ',
};
const sizeStyles: Record<ButtonSize, string> = {
@@ -77,9 +78,12 @@ export const Button = (props: ButtonProps) => {
const variantStyle = (): JSX.CSSProperties | string | undefined => {
const variant = local.variant ?? group?.variant;
if (variant === 'cta') {
+ // TODO (seamus): this is scuffed but better than what we had.
+ const textL = themeReactive.a0.l[0]() < 0.72 ? 0.97 : 0.2;
return {
- '--color-edge': 'var(--color-surface)',
- '--color-edge-muted': 'oklch(from var(--color-surface) l c h / 0.5)',
+ 'color': `oklch(${textL} var(--c0c) var(--c0h))`,
+ '--color-edge': `oklch(${textL} var(--c0c) var(--c0h) / 0.7)`,
+ '--color-edge-muted': `oklch(${textL} var(--c0c) var(--c0h) / 0.7)`,
};
}
return others.style;
diff --git a/js/app/packages/ui/components/SendButton.tsx b/js/app/packages/ui/components/SendButton.tsx
index ef62f845f0..b9afd22f65 100644
--- a/js/app/packages/ui/components/SendButton.tsx
+++ b/js/app/packages/ui/components/SendButton.tsx
@@ -31,10 +31,9 @@ export function SendButton(props: SendButtonProps) {
aria-label={local['aria-label'] ?? 'Send'}
tooltip={local.tooltip ?? 'Send'}
class={cn(
- 'rounded-[11px] size-7.5 text-ink-extra-muted [&_svg]:stroke-[4px]',
+ 'rounded-[11px] size-7.5 [&_svg]:stroke-[4px]',
'transition-transform ease duration-150',
- 'not-disabled:bg-accent not-disabled:text-surface not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface',
- 'data-disabled:opacity-100 data-disabled:text-ink-extra-muted data-disabled:bg-ink-muted/5',
+ 'data-disabled:opacity-100 data-disabled:text-ink-extra-muted! data-disabled:bg-ink-muted/5',
'active:not-disabled:scale-95',
local.hidden && 'opacity-0!',
local.class