!3545 feat(#I61ZP8): reuse border style in PulseButton

* test: 更新单元测试
* fix: 修复网站主题按钮心跳不居中问题
* refactor: 精简 PluseButton 样式
This commit is contained in:
Argo 2022-11-18 16:48:59 +00:00
parent 17ee0fe721
commit 58ab24cd06
5 changed files with 9 additions and 63 deletions

View File

@ -27,13 +27,13 @@
margin-bottom: 1rem;
}
btn-close {
.btn-close {
transition: opacity .3s linear;
}
.btn-close:hover {
opacity: 1;
}
.btn-close:hover {
opacity: 1;
}
.theme-item {
cursor: pointer;
@ -65,20 +65,3 @@ btn-close {
top: 10px;
left: 11px;
}
::deep .pulse {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
}
::deep .pulse-ring {
width: 46px;
height: 46px;
border-radius: 46px;
}

View File

@ -1,42 +1,6 @@
.btn-pulse {
--bs-border-width: 3px;
position: relative;
--bb-pulse-button-border-color: var(--bs-warning);
}
.pulse-white {
--bb-pulse-button-border-color: var(--bs-white);
}
.pulse-light {
--bb-pulse-button-border-color: var(--bs-light);
}
.pulse-primary {
--bb-pulse-button-border-color: var(--bs-primary);
}
.pulse-secondary {
--bb-pulse-button-border-color: var(--bs-secondary);
}
.pulse-success {
--bb-pulse-button-border-color: var(--bs-success);
}
.pulse-info {
--bb-pulse-button-border-color: var(--bs-info);
}
.pulse-warning {
--bb-pulse-button-border-color: var(--bs-warning);
}
.pulse-danger {
--bb-pulse-button-border-color: var(--bs-danger);
}
.pulse-dark {
--bb-pulse-button-border-color: var(--bs-dark);
}
.pulse-ring {
@ -45,7 +9,6 @@
animation: animation-pulse 3.5s ease-out;
animation-iteration-count: infinite;
opacity: 0;
border: 3px solid var(--bb-pulse-button-border-color);
position: absolute;
top: 0;
left: 0;

View File

@ -27,8 +27,8 @@ public partial class PulseButton
.AddClass("btn-pulse")
.Build();
private string? PulseColorString => CssBuilder.Default("pulse-ring")
.AddClass($"pulse-{PulseColor.ToDescriptionString()}", PulseColor != Color.None)
private string? PulseColorString => CssBuilder.Default("pulse-ring border")
.AddClass($"border-{PulseColor.ToDescriptionString()}", PulseColor != Color.None)
.Build();
/// <summary>

File diff suppressed because one or more lines are too long

View File

@ -44,6 +44,6 @@ public class PulseButtonTest : BootstrapBlazorTestBase
pb.Add(a => a.Text, "button-text");
pb.Add(a => a.PulseColor, Color.Warning);
});
cut.Contains("pulse-warning");
cut.Contains("border-warning");
}
}