Skip to content

Commit 8993dd1

Browse files
authored
style: add font-weight variable for dropdown menu items (#135)
1 parent 568122e commit 8993dd1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/src/components/dropdown-menu.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,14 @@ outline: deep
5151
| ------ | -------- | ---------- |
5252
| `id` | `string` | 项唯一标识 |
5353
| `text` | `string` | 显示文本 |
54+
55+
### CSS Variables
56+
57+
| 变量名 | 说明 | 默认值 |
58+
| ---------------------------------------- | ------------------ | ------------------------------ |
59+
| `--tr-dropdown-menu-bg-color` | 下拉菜单背景色 | `#ffffff` |
60+
| `--tr-dropdown-menu-box-shadow` | 下拉菜单阴影 | `0 0 20px rgba(0, 0, 0, 0.08)` |
61+
| `--tr-dropdown-menu-min-width` | 下拉菜单最小宽度 | `130px` |
62+
| `--tr-dropdown-menu-item-color` | 菜单项文字颜色 | `rgb(25, 25, 25)` |
63+
| `--tr-dropdown-menu-item-hover-bg-color` | 菜单项悬停时背景色 | `#f5f5f5` |
64+
| `--tr-dropdown-menu-item-font-weight` | 菜单项字体粗细 | `normal` |

packages/components/src/dropdown-menu/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const handleItemClick = (item: DropdownMenuItem) => {
105105
--tr-dropdown-menu-min-width: 130px;
106106
--tr-dropdown-menu-item-color: rgb(25, 25, 25);
107107
--tr-dropdown-menu-item-hover-bg-color: #f5f5f5;
108+
--tr-dropdown-menu-item-font-weight: normal;
108109
}
109110
110111
.tr-dropdown-menu {
@@ -147,6 +148,7 @@ const handleItemClick = (item: DropdownMenuItem) => {
147148
color: var(--tr-dropdown-menu-item-color);
148149
font-size: 14px;
149150
line-height: 24px;
151+
font-weight: var(--tr-dropdown-menu-item-font-weight);
150152
padding: 4px 8px;
151153
cursor: pointer;
152154
border-radius: 4px;

0 commit comments

Comments
 (0)