配置正则优化、按钮组优化

This commit is contained in:
rickcole 2020-04-08 11:04:37 +08:00
parent 0d355243a2
commit d654b025c7
2 changed files with 22 additions and 3 deletions

View File

@ -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,

View File

@ -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);