Skip to content

Commit

Permalink
feat(input): add font-weight theme variable (#6419)
Browse files Browse the repository at this point in the history
Co-authored-by: 07akioni <07akioni2@gmail.com>
  • Loading branch information
jahnli and 07akioni authored Oct 7, 2024
1 parent 28c7ec6 commit ad8e0fb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- `n-date-picker` adds `date-format` prop.
- `n-progress`'s `color` prop supports gradient config.
- `n-select` adds `font-weight` theme variable

- `n-input` adds `font-weight` theme variable

## 2.40.1

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- `n-date-picker` 新增 `date-format` 属性
- `n-progress``color` 属性支持渐变色配置
- `n-select` 新增 `font-weight` 主题变量
- `n-input` 新增 `font-weight` 主题变量

## 2.40.1

Expand Down
3 changes: 2 additions & 1 deletion src/input/src/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ export default defineComponent({
const cssVarsRef = computed(() => {
const { value: size } = mergedSizeRef
const {
common: { cubicBezierEaseInOut },
common: { cubicBezierEaseInOut, fontWeight },
self: {
color,
borderRadius,
Expand Down Expand Up @@ -961,6 +961,7 @@ export default defineComponent({
'--n-count-text-color-disabled': countTextColorDisabled,
'--n-color': color,
'--n-font-size': fontSize,
'--n-font-weight': fontWeight,
'--n-border-radius': borderRadius,
'--n-height': height,
'--n-padding-left': paddingLeft,
Expand Down
1 change: 1 addition & 0 deletions src/input/src/styles/input.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default cB('input', `
background-color: var(--n-color);
transition: background-color .3s var(--n-bezier);
font-size: var(--n-font-size);
font-weight: var(--n-font-weight);
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
`, [
// common
Expand Down

0 comments on commit ad8e0fb

Please sign in to comment.