From d654b025c74be02fad5cc53da1437268cb952fdc Mon Sep 17 00:00:00 2001 From: rickcole Date: Wed, 8 Apr 2020 11:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=AD=A3=E5=88=99=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=81=E6=8C=89=E9=92=AE=E7=BB=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scss/_mixins.scss | 23 +++++++++++++++++++++-- src/utils/validations.ts | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/scss/_mixins.scss b/scss/_mixins.scss index bcc120298..da6f8713e 100644 --- a/scss/_mixins.scss +++ b/scss/_mixins.scss @@ -171,13 +171,18 @@ } } -@mixin hover-focus { - &:hover, +@mixin focus { &:focus { @content; } } +@mixin hover-focus { + &:hover:focus { + @content; + } +} + @mixin hover-active { &:hover:active { @content; @@ -226,10 +231,24 @@ border-color: $border; box-shadow: $Button-boxShadow; + @include hover { + color: $hover-color; + background-color: $hover-background; + border-color: $hover-border; + } + + @include focus { + color: $color; + background-color: $background; + border-color: $border; + box-shadow: $Button-boxShadow; + } + @include hover-focus { color: $hover-color; background-color: $hover-background; border-color: $hover-border; + box-shadow: $Button-boxShadow; } &.is-disabled, diff --git a/src/utils/validations.ts b/src/utils/validations.ts index a1b7fd9a7..11d68efbf 100644 --- a/src/utils/validations.ts +++ b/src/utils/validations.ts @@ -4,7 +4,7 @@ const isEmpty = (value: any) => value === ''; const makeRegexp = (reg: string | RegExp) => { if (reg instanceof RegExp) { return reg; - } else if (/\/(.+)\/([gimuy]*)/.test(reg)) { + } else if (/^\/(.+)\/([gimuy]*)$/.test(reg)) { return new RegExp(RegExp.$1, RegExp.$2 || ''); } else if (typeof reg === 'string') { return new RegExp(reg);