From 22e12d7f778099c68a265da5f9f0309c9a2683d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 4 Sep 2019 20:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B1=9E=E6=80=A7=E7=9B=91?= =?UTF-8?q?=E5=90=AC;=E4=BF=AE=E5=A4=8D=E7=A7=BB=E9=99=A4=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=AF=BC=E8=87=B4=E5=86=85=E5=AD=98=E6=BA=A2=E5=87=BA?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.dev.js | 10 +++++++++- build.prod.js | 10 +++++++++- src/form/button.wc | 10 +++++++--- src/form/input.wc | 4 ++-- src/form/select.wc | 4 ++-- src/icon/index.wc | 2 +- src/layer/index.wc | 2 +- src/picker/date.wc | 4 ++-- 8 files changed, 33 insertions(+), 13 deletions(-) diff --git a/build.dev.js b/build.dev.js index 4a90832..a1ab213 100644 --- a/build.dev.js +++ b/build.dev.js @@ -29,6 +29,14 @@ $cd: #62778d #526273 #425064; transition:$c $t $m; } +@mixin focus1(){ + box-shadow: 0 0 2px #88f7df; +} + +@mixin focus2(){ + box-shadow: 0 0 2px #f3be4d; +} + * { box-sizing: border-box; margin: 0;padding: 0; @@ -114,7 +122,7 @@ function mkWCFile({ style, html, js }) { .replace('unmount()', 'disconnectedCallback()') .replace( 'watch() {', - 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}' + 'attributeChangedCallback(name, old, val) {\nif (val === null || old === val) {return}' ) .replace('adopted()', 'adoptedCallback()') diff --git a/build.prod.js b/build.prod.js index 4d2a8da..d9a0193 100644 --- a/build.prod.js +++ b/build.prod.js @@ -29,6 +29,14 @@ $cd: #62778d #526273 #425064; transition:$c $t $m; } +@mixin focus1(){ + box-shadow: 0 0 2px #88f7df; +} + +@mixin focus2(){ + box-shadow: 0 0 2px #f3be4d; +} + * { box-sizing: border-box; margin: 0;padding: 0; @@ -121,7 +129,7 @@ function mkWCFile({ style, html, js }) { .replace('unmount()', 'disconnectedCallback()') .replace( 'watch() {', - 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}' + 'attributeChangedCallback(name, old, val) {\nif (val === null || old === val) {return}' ) .replace('adopted()', 'adoptedCallback()') diff --git a/src/form/button.wc b/src/form/button.wc index 36d10a1..ead699f 100644 --- a/src/form/button.wc +++ b/src/form/button.wc @@ -108,6 +108,9 @@ } button { background: #fff; + // &:active { + border-color: nth($cp, 3); + // } } } @@ -234,10 +237,11 @@ } :host(:focus-within) { - box-shadow: 0 0 3px nth($ct, 1); + @include focus1; } -:host(:focus-within[disabled]) { - box-shadow: 0 0 3px nth($co, 1); +:host(:focus-within[disabled]), +:host(:focus-within[loading]) { + box-shadow: none; } diff --git a/src/form/input.wc b/src/form/input.wc index 0ff8cf0..fe6096c 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -152,10 +152,10 @@ li { opacity: 0.6; } :host(:focus-within) { - box-shadow: 0 0 3px nth($ct, 1); + @include focus1; } :host(:focus-within[readonly]) { - box-shadow: 0 0 3px nth($co, 1); + @include focus2; } :host([type='textarea']) { diff --git a/src/form/select.wc b/src/form/select.wc index f9e109e..eb1121a 100644 --- a/src/form/select.wc +++ b/src/form/select.wc @@ -166,10 +166,10 @@ opacity: 0.6; } :host(:focus-within) { - box-shadow: 0 0 3px nth($ct, 1); + @include focus1; } :host(:focus-within[readonly]) { - box-shadow: 0 0 3px nth($co, 1); + @include focus2; } /* 额外样式 */ diff --git a/src/icon/index.wc b/src/icon/index.wc index 767c03b..80a3fd7 100644 --- a/src/icon/index.wc +++ b/src/icon/index.wc @@ -124,8 +124,8 @@ export default class Icon { watch() { switch (name) { case 'is': + this.props.is = val if (val) { - this.props.is = val this.drawPath() } else { this.removeAttribute('is') diff --git a/src/layer/index.wc b/src/layer/index.wc index 0e53d09..8882e85 100644 --- a/src/layer/index.wc +++ b/src/layer/index.wc @@ -163,7 +163,7 @@ } &:focus { - box-shadow: 0 0 3px nth($ct, 1); + @include focus1; } &:last-child { diff --git a/src/picker/date.wc b/src/picker/date.wc index 57643c0..be089e6 100644 --- a/src/picker/date.wc +++ b/src/picker/date.wc @@ -208,10 +208,10 @@ } :host(:focus-within) { - box-shadow: 0 0 3px nth($ct, 1); + @include focus1; } :host(:focus-within[readonly]) { - box-shadow: 0 0 3px nth($co, 1); + @include focus2; } :host([disabled]) { opacity: 0.6;