Skip to content

Commit c9cdee7

Browse files
committed
add placeholder styling for input
1 parent c9a8de4 commit c9cdee7

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

client/packages/lowcoder/src/comps/comps/textInputComp/textInputConstants.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,23 @@ export function getStyle(style: InputLikeStyleType, labelStyle?: LabelStyleType)
315315
}
316316
317317
&::-webkit-input-placeholder {
318-
color: ${style.text};
319-
opacity: 0.4;
318+
color: ${style.placeholder};
319+
opacity: 1;
320+
}
321+
322+
&::-moz-placeholder {
323+
color: ${style.placeholder};
324+
opacity: 1;
325+
}
326+
327+
&:-ms-input-placeholder {
328+
color: ${style.placeholder};
329+
opacity: 1;
330+
}
331+
332+
&::placeholder {
333+
color: ${style.placeholder};
334+
opacity: 1;
320335
}
321336
322337
.ant-input-show-count-suffix,

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,14 @@ export type DepColorConfig = CommonColorConfig & {
244244
transformer: (color: string, ...rest: string[]) => string;
245245
};
246246

247+
export type PlaceholderConfig = CommonColorConfig & {
248+
readonly placeholder?: string;
249+
};
250+
247251
export type SingleColorConfig =
248252
| SimpleColorConfig
249253
| DepColorConfig
254+
| PlaceholderConfig
250255
| RadiusConfig
251256
| BorderWidthConfig
252257
| RotationConfig
@@ -1309,11 +1314,19 @@ export const DisabledSliderStyle = [
13091314
...DISABLED_SLIDER_STYLE_FIELDS,
13101315
] as const;
13111316

1317+
const PLACEHOLDER = {
1318+
name: "placeholder",
1319+
label: "Placeholder",
1320+
depName: "text",
1321+
transformer: (color: string) => lightenColor(color, 0.4),
1322+
} as const;
1323+
13121324
export const InputLikeStyle = [
13131325
getStaticBackground(SURFACE_COLOR),
13141326
BOXSHADOW,
13151327
BOXSHADOWCOLOR,
13161328
...STYLING_FIELDS_SEQUENCE.filter((style)=>style.name!=='rotation' && style.name!=='lineHeight'),
1329+
PLACEHOLDER,
13171330
...ACCENT_VALIDATE,
13181331
] as const;
13191332

@@ -2536,3 +2549,4 @@ export function marginCalculator(margin: string) {
25362549
}
25372550

25382551
export type {ThemeDetail};
2552+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy