Skip to content

The open alternative to Salesforce, designed for AI.

Restore banner button colors (#26135)

Raphaël Bosie2b54647b987
diff --git a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
index 95010fa6118..2e49a4e4284 100644
--- a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
@@ -62,7 +62,7 @@ export const InformationBanner = ({
);
const isPrimary = variant === 'primary';
- const buttonAccent = color === 'danger' ? 'danger' : 'blue';
+ const buttonColor = color === 'danger' ? 'danger' : 'accent';
return (
<InformationBannerComponentInstanceContext.Provider
@@ -88,7 +88,7 @@ export const InformationBanner = ({
onClick={buttonOnClick}
disabled={isButtonDisabled}
variant="outline"
- color={buttonAccent === 'blue' ? 'accent' : 'danger'}
+ color={isPrimary ? 'neutral' : buttonColor}
>
{buttonTitle}
</Button>
@@ -109,7 +109,7 @@ export const InformationBanner = ({
<IconButton
size="sm"
variant="ghost"
- color={buttonAccent === 'blue' ? 'accent' : 'danger'}
+ color={buttonColor}
onClick={onClose}
aria-label={t`Close banner`}
>
diff --git a/packages/twenty-front/src/modules/ui/input/styles/ButtonInvertedClassName.ts b/packages/twenty-front/src/modules/ui/input/styles/ButtonInvertedClassName.ts
index 41316bd463a..c58685783a1 100644
--- a/packages/twenty-front/src/modules/ui/input/styles/ButtonInvertedClassName.ts
+++ b/packages/twenty-front/src/modules/ui/input/styles/ButtonInvertedClassName.ts
@@ -2,5 +2,15 @@ import { css } from '@linaria/core';
import { themeCssVariables } from 'twenty-ui/theme-constants';
export const BUTTON_INVERTED_CLASS_NAME = css`
- color: ${themeCssVariables.font.color.inverted};
+ &[data-variant='outline'],
+ &[data-variant='ghost'] {
+ --tw-button-active: ${themeCssVariables.background.transparent.medium};
+ --tw-button-background: transparent;
+ --tw-button-color: ${themeCssVariables.font.color.inverted};
+ --tw-button-hover: ${themeCssVariables.background.transparent.light};
+ }
+
+ &[data-variant='outline'] {
+ --tw-button-border: ${themeCssVariables.background.transparent.primary};
+ }
`;
diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss
index 3459b395ad6..5139ef71d16 100644
--- a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss
+++ b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss
@@ -10,6 +10,14 @@
width: 100%;
}
+.invertedButton[data-variant='outline'] {
+ --tw-button-active: var(--t-background-transparent-medium);
+ --tw-button-background: transparent;
+ --tw-button-border: var(--t-background-transparent-primary);
+ --tw-button-color: var(--t-font-color-inverted);
+ --tw-button-hover: var(--t-background-transparent-light);
+}
+
.invertedIconButton {
color: var(--t-font-color-inverted) !important;
}
diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss.d.ts b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss.d.ts
index ec6d7fac3e2..b9dfd981df7 100644
--- a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss.d.ts
+++ b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.module.scss.d.ts
@@ -1,6 +1,7 @@
declare const classNames: {
readonly bannerContent: 'bannerContent';
readonly container: 'container';
+ readonly invertedButton: 'invertedButton';
readonly invertedIconButton: 'invertedIconButton';
};
export default classNames;
diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx
index 672662dfbaf..9371acecb83 100644
--- a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx
+++ b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx
@@ -78,13 +78,14 @@ export const Default: Story = {
<Button
size="sm"
variant="outline"
- color={args.color === 'danger' ? 'danger' : 'accent'}
- style={{
- color:
- args.variant === 'primary'
- ? 'var(--t-font-color-inverted)'
- : undefined,
- }}
+ color={
+ args.variant === 'primary'
+ ? 'neutral'
+ : getButtonColor(args.color)
+ }
+ className={
+ args.variant === 'primary' ? styles.invertedButton : undefined
+ }
>
{'Reconnect'}
</Button>
@@ -109,13 +110,12 @@ export const Catalog: CatalogStory<Story, typeof Banner> = {
<Button
size="sm"
variant="outline"
- color={args.color === 'danger' ? 'danger' : 'accent'}
- style={{
- color:
- args.variant === 'primary'
- ? 'var(--t-font-color-inverted)'
- : undefined,
- }}
+ color={
+ args.variant === 'primary' ? 'neutral' : getButtonColor(args.color)
+ }
+ className={
+ args.variant === 'primary' ? styles.invertedButton : undefined
+ }
>
{'Reconnect'}
</Button>