Skip to content

Commit 1ac115f

Browse files
authored
fix: 🐛 修复input、textarea组件placeholder样式在微信小程序无效的问题 (#944)
Closes: #943
1 parent f9d8523 commit 1ac115f

6 files changed

Lines changed: 49 additions & 27 deletions

File tree

src/uni_modules/wot-design-uni/components/wd-input/index.scss

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
}
2727
}
2828

29-
@include e(placeholder) {
30-
color: $-dark-color3;
31-
}
32-
3329
@include e(count) {
3430
color: $-dark-color3;
3531
background: transparent;
@@ -321,17 +317,8 @@
321317
}
322318
}
323319

324-
325-
@include e(placeholder) {
326-
color: $-input-placeholder-color;
327-
328-
&.is-error {
329-
color: $-input-error-color;
330-
}
331-
}
332-
333320
.wd-input__count,
334321
.wd-input__count-current {
335322
display: inline-flex;
336323
}
337-
}
324+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@import "../common/abstracts/variable";
2+
@import "../common/abstracts/mixin";
3+
4+
.wot-theme-dark {
5+
@include b(input) {
6+
@include e(placeholder) {
7+
color: $-dark-color3;
8+
}
9+
}
10+
}
11+
12+
13+
@include b(input) {
14+
@include e(placeholder) {
15+
color: $-input-placeholder-color;
16+
17+
&.is-error {
18+
color: $-input-error-color;
19+
}
20+
}
21+
}

src/uni_modules/wot-design-uni/components/wd-input/wd-input.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,6 @@ function isValueEqual(value1: number | string, value2: number | string) {
293293
<style lang="scss" scoped>
294294
@import './index.scss';
295295
</style>
296+
<style lang="scss">
297+
@import './placeholder.scss';
298+
</style>

src/uni_modules/wot-design-uni/components/wd-textarea/index.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
}
3030
}
3131

32-
@include e(placeholder) {
33-
color: $-dark-color3;
34-
}
35-
3632
@include e(count) {
3733
color: $-dark-color3;
3834
background: transparent;
@@ -218,15 +214,6 @@
218214
}
219215
}
220216

221-
@include e(placeholder) {
222-
color: $-input-placeholder-color;
223-
224-
&.is-error {
225-
color: $-input-error-color;
226-
}
227-
}
228-
229-
230217
@include e(readonly-mask) {
231218
position: absolute;
232219
top: 0;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@import "../common/abstracts/variable";
2+
@import "../common/abstracts/mixin";
3+
4+
.wot-theme-dark {
5+
@include b(textarea) {
6+
@include e(placeholder) {
7+
color: $-dark-color3;
8+
}
9+
}
10+
}
11+
12+
@include b(textarea) {
13+
@include e(placeholder) {
14+
color: $-input-placeholder-color;
15+
16+
&.is-error {
17+
color: $-input-error-color;
18+
}
19+
}
20+
}

src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,7 @@ function onClickPrefixIcon() {
287287
<style lang="scss" scoped>
288288
@import './index.scss';
289289
</style>
290+
291+
<style lang="scss">
292+
@import './placeholder.scss';
293+
</style>

0 commit comments

Comments
 (0)