Skip to content

Commit 3bfa151

Browse files
committed
fix: popover dark and maxwidth
1 parent cb2bf37 commit 3bfa151

File tree

6 files changed

+22
-12
lines changed

6 files changed

+22
-12
lines changed

src/packages/popover/doc.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,4 @@ The component provides the following CSS variables, which can be used to customi
165165
| \--nutui-popover-divider-color | The bottom border color of the options area | `$color-border` |
166166
| \--nutui-popover-disable-color | Option Disabled Colors | `$color-text-disabled` |
167167
| \--nutui-popover-menu-item-padding | The padding value of each item in the option area menu | `8px` |
168+
| \--nutui-popover-menu-item-width | The width value of each item in the options | `160px` |

src/packages/popover/doc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,4 @@ PopoverList 属性是一个由对象构成的数组,数组中的每个对象
167167
| \--nutui-popover-divider-color | 选项区的底部 border 颜色 | `$color-border` |
168168
| \--nutui-popover-disable-color | 选项禁用的颜色 | `$color-text-disabled` |
169169
| \--nutui-popover-menu-item-padding | 选项区菜单每一项的 padding 值 | `8px` |
170+
| \--nutui-popover-menu-item-width | 选项区菜单每一项宽度值,超过宽度值后,会折行展示,保障信息的完整性 | `160px` |

src/packages/popover/doc.taro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ PopoverList 属性是一个由对象构成的数组,数组中的每个对象
158158
| \--nutui-popover-divider-color | 选项区的底部 border 颜色 | `$color-border` |
159159
| \--nutui-popover-disable-color | 选项禁用的颜色 | `$color-text-disabled` |
160160
| \--nutui-popover-menu-item-padding | 选项区菜单每一项的 padding 值 | `8px` |
161+
| \--nutui-popover-menu-item-width | 选项区菜单每一项宽度值,超过宽度值后,会折行展示,保障信息的完整性 | `160px` |

src/packages/popover/doc.zh-TW.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,4 @@ PopoverList 屬性是一個由對象構成的數組,數組中的每個對象
167167
| \--nutui-popover-divider-color | 選項區的底部 border 顏色 | `$color-border` |
168168
| \--nutui-popover-disable-color | 選項禁用的顏色 | `$color-text-disabled` |
169169
| \--nutui-popover-menu-item-padding | 選項區菜單每一項的 padding 值 | `8px` |
170+
| \--nutui-popover-menu-item-width | 選項區菜單每一項寬度值,超過寬度值後,會折行展示,保障信息的完整性 | `160px` |

src/packages/popover/popover.scss

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,14 @@
9595
justify-content: center;
9696
padding: $popover-menu-item-padding;
9797
border-bottom: 1px solid $popover-divider-color;
98+
max-width: $popover-menu-item-width;
99+
word-wrap: break-word;
98100

99101
&:last-child {
100102
margin-bottom: 0px;
101103
border-bottom: none;
102104
}
103105

104-
// &:hover:not(:only-child) {
105-
// cursor: pointer;
106-
// color: $popover-hover-text-color;
107-
// background-color: $popover-hover-background-color;
108-
// }
109-
110106
&:hover:nth-of-type(2) {
111107
border-radius: 8px 8px 0px 0px;
112108
}
@@ -130,9 +126,10 @@
130126
}
131127

132128
&-name {
133-
width: 100%;
129+
width: calc(100% - 34px);
134130
word-break: keep-all;
135131
margin: 0 6px 0 4px;
132+
flex: 1;
136133
}
137134

138135
&-action-icon {
@@ -172,7 +169,6 @@
172169

173170
&-top-start {
174171
left: 0;
175-
176172
.nut-popover-arrow-top-start {
177173
left: 16px;
178174
transform: translateX(0%);
@@ -188,7 +184,6 @@
188184

189185
&-bottom-end {
190186
right: 0;
191-
192187
.nut-popover-arrow-bottom-end {
193188
right: 16px;
194189
transform: translateX(0%);
@@ -197,7 +192,6 @@
197192

198193
&-bottom-start {
199194
left: 0;
200-
201195
.nut-popover-arrow-bottom-start {
202196
left: 16px;
203197
transform: translateX(0%);
@@ -227,7 +221,18 @@
227221
color: $popover-content-background-color;
228222

229223
.nut-popover-arrow {
230-
border-bottom-color: $popover-text-color;
224+
&-top {
225+
border-top-color: $popover-text-color;
226+
}
227+
&-bottom {
228+
border-bottom-color: $popover-text-color;
229+
}
230+
&-left {
231+
border-left-color: $popover-text-color;
232+
}
233+
&-right {
234+
border-right-color: $popover-text-color;
235+
}
231236
}
232237

233238
.nut-popover-content {

src/styles/variables.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,8 +1625,8 @@ $badge-dot-border: var(--nutui-badge-dot-border, 0px solid $color-primary-text);
16251625

16261626
//popover(✅)
16271627
$popover-border-radius: var(--nutui-popover-border-radius, 8px) !default;
1628-
$popover-font-size: var(--nutui-popover-font-size, $font-size-s) !default;
16291628
$popover-border-color: var(--nutui-popover-border-color, #ffffff) !default;
1629+
$popover-font-size: var(--nutui-popover-font-size, $font-size-s) !default;
16301630
$popover-content-background-color: var(
16311631
--nutui-popover-content-background-color,
16321632
#ffffff
@@ -1652,6 +1652,7 @@ $popover-menu-item-padding: var(
16521652
--nutui-popover-menu-item-padding,
16531653
8px
16541654
) !default;
1655+
$popover-menu-item-width: var(--nutui-popover-menu-item-width, 160px) !default;
16551656

16561657
//progress(✅)
16571658
$progress-height: var(--nutui-progress-height, 10px) !default;

0 commit comments

Comments
 (0)