Fix styling inconsistency for FormSingleRecordFieldChip placeholder (#12795)

## Before

![CleanShot 2025-06-23 at 17 01
16@2x](https://github.com/user-attachments/assets/8fb40b91-a17a-48dc-8d5e-6657bdcf8434)



## After


![CleanShot 2025-06-23 at 17 01
01@2x](https://github.com/user-attachments/assets/a9781e13-200c-4aa2-9907-a0c8f4a1dd67)
This commit is contained in:
Baptiste Devessier
2025-06-23 17:32:51 +02:00
committed by GitHub
parent 4c94fc2803
commit d99bff983e
6 changed files with 26 additions and 11 deletions

View File

@ -0,0 +1,8 @@
import { FORM_FIELD_PLACEHOLDER_STYLES } from '@/object-record/record-field/form-types/constants/FormFieldPlaceholderStyles';
import styled from '@emotion/styled';
const StyledPlaceholder = styled.div`
${FORM_FIELD_PLACEHOLDER_STYLES}
`;
export { StyledPlaceholder as FormFieldPlaceholder };

View File

@ -3,6 +3,7 @@ import styled from '@emotion/styled';
import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer'; import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';
import { FormFieldInputInnerContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInnerContainer'; import { FormFieldInputInnerContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer'; import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer';
import { FormFieldPlaceholder } from '@/object-record/record-field/form-types/components/FormFieldPlaceholder';
import { VariableChipStandalone } from '@/object-record/record-field/form-types/components/VariableChipStandalone'; import { VariableChipStandalone } from '@/object-record/record-field/form-types/components/VariableChipStandalone';
import { FormMultiSelectFieldInputHotKeyScope } from '@/object-record/record-field/form-types/constants/FormMultiSelectFieldInputHotKeyScope'; import { FormMultiSelectFieldInputHotKeyScope } from '@/object-record/record-field/form-types/constants/FormMultiSelectFieldInputHotKeyScope';
import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent'; import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';
@ -59,9 +60,7 @@ const StyledSelectInputContainer = styled.div`
top: ${({ theme }) => theme.spacing(9)}; top: ${({ theme }) => theme.spacing(9)};
`; `;
const StyledPlaceholder = styled.div` const StyledPlaceholder = styled(FormFieldPlaceholder)`
color: ${({ theme }) => theme.font.color.light};
font-weight: ${({ theme }) => theme.font.weight.medium};
width: 100%; width: 100%;
`; `;

View File

@ -1,4 +1,5 @@
import { RecordChip } from '@/object-record/components/RecordChip'; import { RecordChip } from '@/object-record/components/RecordChip';
import { FormFieldPlaceholder } from '@/object-record/record-field/form-types/components/FormFieldPlaceholder';
import { import {
RecordId, RecordId,
Variable, Variable,
@ -12,9 +13,7 @@ const StyledRecordChip = styled(RecordChip)`
margin: ${({ theme }) => theme.spacing(2)}; margin: ${({ theme }) => theme.spacing(2)};
`; `;
const StyledPlaceholder = styled.div` const StyledPlaceholder = styled(FormFieldPlaceholder)`
color: ${({ theme }) => theme.font.color.tertiary};
font-size: ${({ theme }) => theme.font.size.md};
margin: ${({ theme }) => theme.spacing(2)}; margin: ${({ theme }) => theme.spacing(2)};
`; `;

View File

@ -1,3 +1,4 @@
import { FORM_FIELD_PLACEHOLDER_STYLES } from '@/object-record/record-field/form-types/constants/FormFieldPlaceholderStyles';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { Editor, EditorContent } from '@tiptap/react'; import { Editor, EditorContent } from '@tiptap/react';
@ -30,9 +31,8 @@ const StyledEditor = styled.div<{
white-space: ${({ multiline }) => (multiline ? 'pre' : 'nowrap')}; white-space: ${({ multiline }) => (multiline ? 'pre' : 'nowrap')};
p.is-editor-empty:first-of-type::before { p.is-editor-empty:first-of-type::before {
${FORM_FIELD_PLACEHOLDER_STYLES}
content: attr(data-placeholder); content: attr(data-placeholder);
color: ${({ theme }) => theme.font.color.light};
font-weight: ${({ theme }) => theme.font.weight.medium};
float: left; float: left;
height: 0; height: 0;
pointer-events: none; pointer-events: none;

View File

@ -0,0 +1,10 @@
import { css } from '@emotion/react';
import { ThemeType } from 'twenty-ui/theme';
export const FORM_FIELD_PLACEHOLDER_STYLES = (props: {
theme: ThemeType;
}) => css`
color: ${props.theme.font.color.light};
font-size: ${props.theme.font.size.md};
font-weight: ${props.theme.font.weight.medium};
`;

View File

@ -1,6 +1,7 @@
import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer'; import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';
import { FormFieldInputInnerContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInnerContainer'; import { FormFieldInputInnerContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer'; import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer';
import { FormFieldPlaceholder } from '@/object-record/record-field/form-types/components/FormFieldPlaceholder';
import { InputLabel } from '@/ui/input/components/InputLabel'; import { InputLabel } from '@/ui/input/components/InputLabel';
import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem'; import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem';
import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList'; import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList';
@ -111,9 +112,7 @@ const StyledFieldContainer = styled.div<{
`} `}
`; `;
const StyledPlaceholder = styled.div` const StyledPlaceholder = styled(FormFieldPlaceholder)`
color: ${({ theme }) => theme.font.color.light};
font-weight: ${({ theme }) => theme.font.weight.medium};
width: 100%; width: 100%;
`; `;