Skip to content

[Feat]: #1466 Add disabled/placeholder styles for the main components #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Prev Previous commit
Next Next commit
add placeholder styling for input
  • Loading branch information
iamfaran committed Jun 26, 2025
commit c9cdee73836193e1d2519654bfe7e0099d462c95
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,23 @@ export function getStyle(style: InputLikeStyleType, labelStyle?: LabelStyleType)
}

&::-webkit-input-placeholder {
color: ${style.text};
opacity: 0.4;
color: ${style.placeholder};
opacity: 1;
}

&::-moz-placeholder {
color: ${style.placeholder};
opacity: 1;
}

&:-ms-input-placeholder {
color: ${style.placeholder};
opacity: 1;
}

&::placeholder {
color: ${style.placeholder};
opacity: 1;
}

.ant-input-show-count-suffix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,14 @@ export type DepColorConfig = CommonColorConfig & {
transformer: (color: string, ...rest: string[]) => string;
};

export type PlaceholderConfig = CommonColorConfig & {
readonly placeholder?: string;
};

export type SingleColorConfig =
| SimpleColorConfig
| DepColorConfig
| PlaceholderConfig
| RadiusConfig
| BorderWidthConfig
| RotationConfig
Expand Down Expand Up @@ -1309,11 +1314,19 @@ export const DisabledSliderStyle = [
...DISABLED_SLIDER_STYLE_FIELDS,
] as const;

const PLACEHOLDER = {
name: "placeholder",
label: "Placeholder",
depName: "text",
transformer: (color: string) => lightenColor(color, 0.4),
} as const;

export const InputLikeStyle = [
getStaticBackground(SURFACE_COLOR),
BOXSHADOW,
BOXSHADOWCOLOR,
...STYLING_FIELDS_SEQUENCE.filter((style)=>style.name!=='rotation' && style.name!=='lineHeight'),
PLACEHOLDER,
...ACCENT_VALIDATE,
] as const;

Expand Down Expand Up @@ -2536,3 +2549,4 @@ export function marginCalculator(margin: string) {
}

export type {ThemeDetail};