Skip to content

The open alternative to Salesforce, designed for AI.

fix(ui): restore content-box sizing for components broken by the global border-box reset (#21349)

Félix Malfait8a3e6e645ad7
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDraggableHeader.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDraggableHeader.tsx
index 09c0611b58d..6eb1e12d44b 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDraggableHeader.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDraggableHeader.tsx
@@ -9,6 +9,8 @@ import {
const StyledContainer = styled.div`
align-items: center;
+ /* Height below is sized against the content box. */
+ box-sizing: content-box;
cursor: grab;
display: flex;
gap: ${themeCssVariables.spacing[2]};
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuSearchInput.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuSearchInput.tsx
index 273ca7bd7b0..237bd858af8 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuSearchInput.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuSearchInput.tsx
@@ -8,6 +8,8 @@ import { themeCssVariables } from 'twenty-ui-deprecated/theme-constants';
const StyledDropdownMenuSearchInputContainer = styled.div`
--vertical-padding: ${themeCssVariables.spacing[2]};
align-items: center;
+ /* min-height below is sized against the content box. */
+ box-sizing: content-box;
display: flex;
flex-direction: row;
min-height: calc(36px - 2 * var(--vertical-padding));
diff --git a/packages/twenty-ui-deprecated/src/components/chip/Chip.tsx b/packages/twenty-ui-deprecated/src/components/chip/Chip.tsx
index 0e254918a77..9a103d4fd08 100644
--- a/packages/twenty-ui-deprecated/src/components/chip/Chip.tsx
+++ b/packages/twenty-ui-deprecated/src/components/chip/Chip.tsx
@@ -63,6 +63,8 @@ const StyledContainer = styled.div<
--chip-horizontal-padding: ${themeCssVariables.spacing[1]};
--chip-vertical-padding: ${themeCssVariables.spacing[1]};
+ /* Height and max-width are sized against the content box. */
+ box-sizing: content-box;
text-decoration: none;
align-items: center;
diff --git a/packages/twenty-ui-deprecated/src/navigation/link/components/RoundedLink.tsx b/packages/twenty-ui-deprecated/src/navigation/link/components/RoundedLink.tsx
index 34577d68794..2c04c69cf75 100644
--- a/packages/twenty-ui-deprecated/src/navigation/link/components/RoundedLink.tsx
+++ b/packages/twenty-ui-deprecated/src/navigation/link/components/RoundedLink.tsx
@@ -15,6 +15,8 @@ const StyledLink = styled.a`
background-color: ${themeCssVariables.background.transparent.lighter};
border: 1px solid ${themeCssVariables.border.color.strong};
border-radius: 50px;
+ /* Height and max-width are sized against the content box. */
+ box-sizing: content-box;
color: ${themeCssVariables.font.color.primary};
cursor: pointer;
display: inline-flex;
diff --git a/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSelect.tsx b/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSelect.tsx
index b15b1a59b77..bddf1f29b8c 100644
--- a/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSelect.tsx
+++ b/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSelect.tsx
@@ -24,6 +24,8 @@ export const StyledMenuItemSelect = styled.div<{
}>`
--horizontal-padding: ${themeCssVariables.spacing[1]};
--vertical-padding: ${themeCssVariables.spacing[2]};
+ /* Height and width below are sized against the content box. */
+ box-sizing: content-box;
align-items: center;
border-radius: ${themeCssVariables.border.radius.sm};
display: flex;
diff --git a/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSuggestion.tsx b/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSuggestion.tsx
index 357e775cc85..240ae90b1ef 100644
--- a/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSuggestion.tsx
+++ b/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/components/MenuItemSuggestion.tsx
@@ -23,6 +23,8 @@ const StyledSuggestionMenuItem = styled.li<{
--horizontal-padding: ${themeCssVariables.spacing[1]};
--vertical-padding: ${themeCssVariables.spacing[2]};
+ /* Height below is sized against the content box. */
+ box-sizing: content-box;
align-items: center;
border-radius: ${themeCssVariables.border.radius.sm};
diff --git a/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx b/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx
index 5fa412f0456..117b07b49c7 100644
--- a/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx
+++ b/packages/twenty-ui-deprecated/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx
@@ -16,6 +16,8 @@ export type MenuItemBaseProps = {
export const StyledMenuItemBase = styled.div<MenuItemBaseProps>`
--horizontal-padding: ${themeCssVariables.spacing[1]};
--vertical-padding: ${themeCssVariables.spacing[2]};
+ /* Height and width below are sized against the content box. */
+ box-sizing: content-box;
align-items: center;
border-radius: ${themeCssVariables.border.radius.sm};
@@ -148,6 +150,8 @@ type HoverableMenuItemBaseProps = {
export const StyledHoverableMenuItemBase = styled.div<HoverableMenuItemBaseProps>`
--horizontal-padding: ${themeCssVariables.spacing[1]};
--vertical-padding: ${themeCssVariables.spacing[2]};
+ /* Height and width below are sized against the content box. */
+ box-sizing: content-box;
align-items: center;
border-radius: ${themeCssVariables.border.radius.sm};
display: flex;