Skip to content

Commit

Permalink
feat(input): enable --td-input-placeholder-text-font-size (#3018)
Browse files Browse the repository at this point in the history
  • Loading branch information
betavs authored Jul 29, 2024
1 parent 32a3846 commit ffcdea0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 50 deletions.
50 changes: 26 additions & 24 deletions src/input/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ safe-password-time-stamp | Number | - | \- | N
safe-password-nonce | String | - | \- | N
safe-password-salt | String | - | \- | N
safe-password-custom-hash | String | - | \- | N

### Input Events

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


### CSS Variables

The component provides the following CSS variables, which can be used to customize styles.
Name | Default Value | Description
Name | Default Value | Description
-- | -- | --
--td-input-bg-color | @bg-color-container | -
--td-input-border-color | @component-stroke | -
--td-input-border-left-space | 32rpx | -
--td-input-border-radius | @radius-default | -
--td-input-border-right-space | 0 | -
--td-input-default-text-color | @font-gray-1 | -
--td-input-default-tips-color | @font-gray-3 | -
--td-input-disabled-text-color | @text-color-disabled | -
--td-input-error-text-color | @error-color | -
--td-input-error-tips-color | @error-color | -
--td-input-label-max-width | 5em | -
--td-input-label-min-width | 2em | -
--td-input-label-text-color | @font-gray-1 | -
--td-input-placeholder-text-color | @text-color-placeholder | -
--td-input-prefix-icon-color | @font-gray-1 | -
--td-input-success-text-color | @success-color | -
--td-input-success-tips-color | @success-color | -
--td-input-suffix-icon-color | @font-gray-3 | -
--td-input-suffix-text-color | @font-gray-1 | -
--td-input-vertical-padding | 32rpx | -
--td-input-warning-text-color | @warning-color | -
--td-input-warning-tips-color | @warning-color | -
--td-input-bg-color | @bg-color-container | -
--td-input-border-color | @component-stroke | -
--td-input-border-left-space | 32rpx | -
--td-input-border-radius | @radius-default | -
--td-input-border-right-space | 0 | -
--td-input-default-text-color | @font-gray-1 | -
--td-input-default-tips-color | @font-gray-3 | -
--td-input-disabled-text-color | @text-color-disabled | -
--td-input-error-text-color | @error-color | -
--td-input-error-tips-color | @error-color | -
--td-input-label-max-width | 5em | -
--td-input-label-min-width | 2em | -
--td-input-label-text-color | @font-gray-1 | -
--td-input-placeholder-text-color | @text-color-placeholder | -
--td-input-placeholder-text-font-size | @font-size-m | -
--td-input-prefix-icon-color | @font-gray-1 | -
--td-input-success-text-color | @success-color | -
--td-input-success-tips-color | @success-color | -
--td-input-suffix-icon-color | @font-gray-3 | -
--td-input-suffix-text-color | @font-gray-1 | -
--td-input-vertical-padding | 32rpx | -
--td-input-warning-text-color | @warning-color | -
--td-input-warning-tips-color | @warning-color | -
54 changes: 29 additions & 25 deletions src/input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ isComponent: true
---

<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>

## 引入

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

{{ custom }}


## API

### Input Props

名称 | 类型 | 默认值 | 说明 | 必传
Expand Down Expand Up @@ -141,8 +142,9 @@ nicknamereview | `(pass: boolean, timeout: boolean)`| 用户昵称审核完毕
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/>

### CellGroup 外部样式类

类名 | 说明
-- | --
-- | --
t-class | 根节点样式类
t-class-prefix-icon | 前置图标样式类
t-class-label | 标题样式类
Expand All @@ -153,28 +155,30 @@ t-class-suffix-icon | 后置图标样式类
t-class-tips | 提示样式类

### CSS 变量

组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
名称 | 默认值 | 描述
-- | -- | --
--td-input-bg-color | @bg-color-container | -
--td-input-border-color | @component-stroke | -
--td-input-border-left-space | 32rpx | -
--td-input-border-radius | @radius-default | -
--td-input-border-right-space | 0 | -
--td-input-default-text-color | @font-gray-1 | -
--td-input-default-tips-color | @font-gray-3 | -
--td-input-disabled-text-color | @text-color-disabled | -
--td-input-error-text-color | @error-color | -
--td-input-error-tips-color | @error-color | -
--td-input-label-max-width | 5em | -
--td-input-label-min-width | 2em | -
--td-input-label-text-color | @font-gray-1 | -
--td-input-placeholder-text-color | @text-color-placeholder | -
--td-input-prefix-icon-color | @font-gray-1 | -
--td-input-success-text-color | @success-color | -
--td-input-success-tips-color | @success-color | -
--td-input-suffix-icon-color | @font-gray-3 | -
--td-input-suffix-text-color | @font-gray-1 | -
--td-input-vertical-padding | 32rpx | -
--td-input-warning-text-color | @warning-color | -
--td-input-warning-tips-color | @warning-color | -
--td-input-bg-color | @bg-color-container | -
--td-input-border-color | @component-stroke | -
--td-input-border-left-space | 32rpx | -
--td-input-border-radius | @radius-default | -
--td-input-border-right-space | 0 | -
--td-input-default-text-color | @font-gray-1 | -
--td-input-default-tips-color | @font-gray-3 | -
--td-input-disabled-text-color | @text-color-disabled | -
--td-input-error-text-color | @error-color | -
--td-input-error-tips-color | @error-color | -
--td-input-label-max-width | 5em | -
--td-input-label-min-width | 2em | -
--td-input-label-text-color | @font-gray-1 | -
--td-input-placeholder-text-color | @text-color-placeholder | -
--td-input-placeholder-text-font-size | @font-size-m | -
--td-input-prefix-icon-color | @font-gray-1 | -
--td-input-success-text-color | @success-color | -
--td-input-success-tips-color | @success-color | -
--td-input-suffix-icon-color | @font-gray-3 | -
--td-input-suffix-text-color | @font-gray-1 | -
--td-input-vertical-padding | 32rpx | -
--td-input-warning-text-color | @warning-color | -
--td-input-warning-tips-color | @warning-color | -
3 changes: 2 additions & 1 deletion src/input/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@input-border-left-space: var(--td-input-border-left-space, 32rpx);
@input-border-right-space: var(--td-input-border-right-space, 0);
@input-placeholder-text-color: var(--td-input-placeholder-text-color, @text-color-placeholder); // 输入框占位符文本颜色
@input-placeholder-text-font-size: var(--td-input-placeholder-text-font-size, @font-size-m); // 输入框占位符文本字体大小
@input-prefix-icon-color: var(--td-input-prefix-icon-color, @text-color-primary); // // 输入框前缀图标颜色
@input-suffix-icon-color: var(--td-input-suffix-icon-color, @text-color-placeholder); // 输入框后缀图标颜色
@input-label-text-color: var(--td-input-label-text-color, @text-color-primary); // 左侧文本颜色
Expand Down Expand Up @@ -174,7 +175,7 @@

&__placeholder {
color: @input-placeholder-text-color;
font-size: @font-size-m;
font-size: @input-placeholder-text-font-size;

&--disabled {
color: @input-disabled-text-color;
Expand Down

0 comments on commit ffcdea0

Please sign in to comment.