Skip to content

Commit 938768f

Browse files
committed
refactor: 调整结构精简样式
1 parent 1a05a49 commit 938768f

File tree

3 files changed

+34
-29
lines changed

3 files changed

+34
-29
lines changed

src/BootstrapBlazor/Components/IntersectionObserver/LoadMore.razor

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33

44
<IntersectionObserver OnIntersecting="OnIntersecting" Threshold="1" AutoUnobserveWhenIntersection="false">
55
<IntersectionObserverItem>
6-
@if (CanLoading)
7-
{
8-
if (LoadingTemplate != null)
6+
<div class="bb-intersection-loading">
7+
@if (CanLoading)
98
{
10-
@LoadingTemplate
9+
if (LoadingTemplate != null)
10+
{
11+
@LoadingTemplate
12+
}
13+
else
14+
{
15+
<Spinner></Spinner>
16+
}
1117
}
12-
else
18+
else if (NoMoreTemplate != null)
1319
{
14-
<div class="bb-intersection-loading">
15-
<Spinner></Spinner>
16-
</div>
20+
@NoMoreTemplate
21+
}
22+
else if (!string.IsNullOrEmpty(NoMoreText))
23+
{
24+
@NoMoreText
1725
}
18-
}
19-
else if (NoMoreTemplate != null)
20-
{
21-
@NoMoreTemplate
22-
}
23-
else if (!string.IsNullOrEmpty(NoMoreText))
24-
{
25-
<div class="bb-intersection-stop-text">@NoMoreText</div>
26-
}
26+
</div>
2727
</IntersectionObserverItem>
2828
</IntersectionObserver>
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
.bb-intersection-loading {
2-
display: flex;
3-
justify-content: center;
4-
padding: .5rem .5rem 1rem;
5-
color: #aaa;
6-
}
1+
.bb-intersection-observer {
2+
--bb-intersection-observer-loading-bg: #{$bb-intersection-observer-loading-bg};
3+
--bb-intersection-observer-loading-color: #{$bb-intersection-observer-loading-color};
4+
--bb-intersection-observer-loading-padding: #{$bb-intersection-observer-loading-padding};
75

8-
.bb-intersection-stop-text {
9-
display: flex;
10-
justify-content: center;
11-
padding: .5rem .5rem 1rem;
12-
color: #aaa;
13-
font-size: .875rem;
6+
.bb-intersection-loading {
7+
display: flex;
8+
justify-content: center;
9+
align-items: center;
10+
background-color: var(--bb-intersection-observer-loading-bg);
11+
color: var(--bb-intersection-observer-loading-color);
12+
padding: var(--bb-intersection-observer-loading-padding)
13+
}
1414
}

src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ $bb-svg-icon-width: 12px;
311311
$bb-viewer-button-bg: #606266;
312312
$bb-viewer-border-radius: 50%;
313313

314+
// IntersectionObserver
315+
$bb-intersection-observer-loading-bg: var(--bs-body-bg);
316+
$bb-intersection-observer-loading-color: var(--bs-body-color);
317+
$bb-intersection-observer-loading-padding: 0.5rem;
318+
314319
// Ip Address
315320
$bb-ip-cell-max-width: 30px;
316321

0 commit comments

Comments
 (0)