Skip to content

Commit ffcdea0

Browse files
authored
feat(input): enable --td-input-placeholder-text-font-size (Tencent#3018)
1 parent 32a3846 commit ffcdea0

File tree

3 files changed

+57
-50
lines changed

3 files changed

+57
-50
lines changed

src/input/README.en-US.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ safe-password-time-stamp | Number | - | \- | N
4949
safe-password-nonce | String | - | \- | N
5050
safe-password-salt | String | - | \- | N
5151
safe-password-custom-hash | String | - | \- | N
52+
5253
### Input Events
5354

5455
name | params | description
@@ -60,30 +61,31 @@ enter | `(value: InputValue)` | \-
6061
focus | `(value: InputValue)` | \-
6162
keyboardheightchange | `(height: number, duration: number)` | \-
6263

63-
6464
### CSS Variables
65+
6566
The component provides the following CSS variables, which can be used to customize styles.
66-
Name | Default Value | Description
67+
Name | Default Value | Description
6768
-- | -- | --
68-
--td-input-bg-color | @bg-color-container | -
69-
--td-input-border-color | @component-stroke | -
70-
--td-input-border-left-space | 32rpx | -
71-
--td-input-border-radius | @radius-default | -
72-
--td-input-border-right-space | 0 | -
73-
--td-input-default-text-color | @font-gray-1 | -
74-
--td-input-default-tips-color | @font-gray-3 | -
75-
--td-input-disabled-text-color | @text-color-disabled | -
76-
--td-input-error-text-color | @error-color | -
77-
--td-input-error-tips-color | @error-color | -
78-
--td-input-label-max-width | 5em | -
79-
--td-input-label-min-width | 2em | -
80-
--td-input-label-text-color | @font-gray-1 | -
81-
--td-input-placeholder-text-color | @text-color-placeholder | -
82-
--td-input-prefix-icon-color | @font-gray-1 | -
83-
--td-input-success-text-color | @success-color | -
84-
--td-input-success-tips-color | @success-color | -
85-
--td-input-suffix-icon-color | @font-gray-3 | -
86-
--td-input-suffix-text-color | @font-gray-1 | -
87-
--td-input-vertical-padding | 32rpx | -
88-
--td-input-warning-text-color | @warning-color | -
89-
--td-input-warning-tips-color | @warning-color | -
69+
--td-input-bg-color | @bg-color-container | -
70+
--td-input-border-color | @component-stroke | -
71+
--td-input-border-left-space | 32rpx | -
72+
--td-input-border-radius | @radius-default | -
73+
--td-input-border-right-space | 0 | -
74+
--td-input-default-text-color | @font-gray-1 | -
75+
--td-input-default-tips-color | @font-gray-3 | -
76+
--td-input-disabled-text-color | @text-color-disabled | -
77+
--td-input-error-text-color | @error-color | -
78+
--td-input-error-tips-color | @error-color | -
79+
--td-input-label-max-width | 5em | -
80+
--td-input-label-min-width | 2em | -
81+
--td-input-label-text-color | @font-gray-1 | -
82+
--td-input-placeholder-text-color | @text-color-placeholder | -
83+
--td-input-placeholder-text-font-size | @font-size-m | -
84+
--td-input-prefix-icon-color | @font-gray-1 | -
85+
--td-input-success-text-color | @success-color | -
86+
--td-input-success-tips-color | @success-color | -
87+
--td-input-suffix-icon-color | @font-gray-3 | -
88+
--td-input-suffix-text-color | @font-gray-1 | -
89+
--td-input-vertical-padding | 32rpx | -
90+
--td-input-warning-text-color | @warning-color | -
91+
--td-input-warning-tips-color | @warning-color | -

src/input/README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ isComponent: true
66
---
77

88
<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-97%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-88%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-97%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-92%25-blue" /></span>
9+
910
## 引入
1011

1112
全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
@@ -78,8 +79,8 @@ isComponent: true
7879

7980
{{ custom }}
8081

81-
8282
## API
83+
8384
### Input Props
8485

8586
名称 | 类型 | 默认值 | 说明 | 必传
@@ -141,8 +142,9 @@ nicknamereview | `(pass: boolean, timeout: boolean)`| 用户昵称审核完毕
141142
click `v0.32.0`| `(trigger: InputTrigger)` | 点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts)。<br/>`type InputTrigger = 'suffix' \| 'suffix-icon';`<br/>
142143

143144
### CellGroup 外部样式类
145+
144146
类名 | 说明
145-
-- | --
147+
-- | --
146148
t-class | 根节点样式类
147149
t-class-prefix-icon | 前置图标样式类
148150
t-class-label | 标题样式类
@@ -153,28 +155,30 @@ t-class-suffix-icon | 后置图标样式类
153155
t-class-tips | 提示样式类
154156

155157
### CSS 变量
158+
156159
组件提供了下列 CSS 变量,可用于自定义样式。
157-
名称 | 默认值 | 描述
160+
名称 | 默认值 | 描述
158161
-- | -- | --
159-
--td-input-bg-color | @bg-color-container | -
160-
--td-input-border-color | @component-stroke | -
161-
--td-input-border-left-space | 32rpx | -
162-
--td-input-border-radius | @radius-default | -
163-
--td-input-border-right-space | 0 | -
164-
--td-input-default-text-color | @font-gray-1 | -
165-
--td-input-default-tips-color | @font-gray-3 | -
166-
--td-input-disabled-text-color | @text-color-disabled | -
167-
--td-input-error-text-color | @error-color | -
168-
--td-input-error-tips-color | @error-color | -
169-
--td-input-label-max-width | 5em | -
170-
--td-input-label-min-width | 2em | -
171-
--td-input-label-text-color | @font-gray-1 | -
172-
--td-input-placeholder-text-color | @text-color-placeholder | -
173-
--td-input-prefix-icon-color | @font-gray-1 | -
174-
--td-input-success-text-color | @success-color | -
175-
--td-input-success-tips-color | @success-color | -
176-
--td-input-suffix-icon-color | @font-gray-3 | -
177-
--td-input-suffix-text-color | @font-gray-1 | -
178-
--td-input-vertical-padding | 32rpx | -
179-
--td-input-warning-text-color | @warning-color | -
180-
--td-input-warning-tips-color | @warning-color | -
162+
--td-input-bg-color | @bg-color-container | -
163+
--td-input-border-color | @component-stroke | -
164+
--td-input-border-left-space | 32rpx | -
165+
--td-input-border-radius | @radius-default | -
166+
--td-input-border-right-space | 0 | -
167+
--td-input-default-text-color | @font-gray-1 | -
168+
--td-input-default-tips-color | @font-gray-3 | -
169+
--td-input-disabled-text-color | @text-color-disabled | -
170+
--td-input-error-text-color | @error-color | -
171+
--td-input-error-tips-color | @error-color | -
172+
--td-input-label-max-width | 5em | -
173+
--td-input-label-min-width | 2em | -
174+
--td-input-label-text-color | @font-gray-1 | -
175+
--td-input-placeholder-text-color | @text-color-placeholder | -
176+
--td-input-placeholder-text-font-size | @font-size-m | -
177+
--td-input-prefix-icon-color | @font-gray-1 | -
178+
--td-input-success-text-color | @success-color | -
179+
--td-input-success-tips-color | @success-color | -
180+
--td-input-suffix-icon-color | @font-gray-3 | -
181+
--td-input-suffix-text-color | @font-gray-1 | -
182+
--td-input-vertical-padding | 32rpx | -
183+
--td-input-warning-text-color | @warning-color | -
184+
--td-input-warning-tips-color | @warning-color | -

src/input/input.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
@input-border-left-space: var(--td-input-border-left-space, 32rpx);
1818
@input-border-right-space: var(--td-input-border-right-space, 0);
1919
@input-placeholder-text-color: var(--td-input-placeholder-text-color, @text-color-placeholder); // 输入框占位符文本颜色
20+
@input-placeholder-text-font-size: var(--td-input-placeholder-text-font-size, @font-size-m); // 输入框占位符文本字体大小
2021
@input-prefix-icon-color: var(--td-input-prefix-icon-color, @text-color-primary); // // 输入框前缀图标颜色
2122
@input-suffix-icon-color: var(--td-input-suffix-icon-color, @text-color-placeholder); // 输入框后缀图标颜色
2223
@input-label-text-color: var(--td-input-label-text-color, @text-color-primary); // 左侧文本颜色
@@ -174,7 +175,7 @@
174175

175176
&__placeholder {
176177
color: @input-placeholder-text-color;
177-
font-size: @font-size-m;
178+
font-size: @input-placeholder-text-font-size;
178179

179180
&--disabled {
180181
color: @input-disabled-text-color;

0 commit comments

Comments
 (0)