From a5d0c7ecd31c37172ab5e63bcfa1571765174436 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 20 Dec 2025 21:28:40 +0800 Subject: [PATCH 1/6] =?UTF-8?q?style:=20=E8=B0=83=E6=95=B4=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss | 4 ++++ src/BootstrapBlazor/wwwroot/scss/variables.scss | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss index a02e80c5d63..58da117b508 100644 --- a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss +++ b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss @@ -1,5 +1,9 @@ @use "../../wwwroot/scss/variables" as *; +[data-bs-theme='dark'] .calendar { + --bb-calendar-selected-bg: #{$bb-calendar-selected-bg-dark}; +} + .calendar { --bb-calendar-padding: #{$bb-calendar-padding}; --bb-calendar-header-border-bottom: #{$bb-calendar-header-border-bottom}; diff --git a/src/BootstrapBlazor/wwwroot/scss/variables.scss b/src/BootstrapBlazor/wwwroot/scss/variables.scss index 0666612141a..9caf1d681a0 100644 --- a/src/BootstrapBlazor/wwwroot/scss/variables.scss +++ b/src/BootstrapBlazor/wwwroot/scss/variables.scss @@ -114,8 +114,9 @@ $bb-calendar-cell-height: 85px; $bb-calendar-cell-hover-bg: rgba(var(--bs-body-color-rgb),.08); $bb-calendar-header-padding: 12px 0; $bb-calendar-today-color: #409eff; -$bb-calendar-selected-color: #409eff; -$bb-calendar-selected-bg: rgba(var(--bs-body-color-rgb),.12); +$bb-calendar-selected-color: #fff; +$bb-calendar-selected-bg: #409eff; +$bb-calendar-selected-bg-dark: #15325b; $bb-calendar-week-header-border-bottom: 2px solid var(--bs-border-color); $bb-calendar-week-header-min-width: 52px; $bb-calendar-week-header-padding: 4px; From a1a2d71ed8cc1ff5a03a028edb65d365ad57462d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 20 Dec 2025 21:29:07 +0800 Subject: [PATCH 2/6] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Calendar/Calendar.razor.cs | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs index 7a8a51a365f..c529f95a216 100644 --- a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs +++ b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs @@ -9,7 +9,7 @@ namespace BootstrapBlazor.Components; /// -/// +/// 日历框组件 /// public partial class Calendar { @@ -243,14 +243,7 @@ protected async Task OnChangeYear(int offset) /// protected async Task OnChangeMonth(int offset) { - if (offset == 0) - { - Value = DateTime.Today; - } - else - { - Value = Value.AddMonths(offset); - } + Value = offset == 0 ? DateTime.Today : Value.AddMonths(offset); if (ValueChanged.HasDelegate) { await ValueChanged.InvokeAsync(Value); @@ -267,14 +260,7 @@ protected async Task OnChangeMonth(int offset) /// protected async Task OnChangeWeek(int offset) { - if (offset == 0) - { - Value = DateTime.Today; - } - else - { - Value = Value.AddDays(offset); - } + Value = offset == 0 ? DateTime.Today : Value.AddDays(offset); WeekNumberText = Localizer[nameof(WeekNumberText), GetWeekCount()]; if (ValueChanged.HasDelegate) { From b728ee990a669e118212997f31b52050bed35a35 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 20 Dec 2025 21:29:19 +0800 Subject: [PATCH 3/6] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Calendar/Calendar.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/Calendar/Calendar.razor b/src/BootstrapBlazor/Components/Calendar/Calendar.razor index 3151fd1c0ca..66923ab8644 100644 --- a/src/BootstrapBlazor/Components/Calendar/Calendar.razor +++ b/src/BootstrapBlazor/Components/Calendar/Calendar.razor @@ -33,7 +33,7 @@
- +
@if (HeaderTemplate != null) { From 96e7556593a753c59cd4da3844325c4ff14512c6 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 20 Dec 2025 21:37:55 +0800 Subject: [PATCH 4/6] =?UTF-8?q?style:=20=E6=9B=B4=E6=96=B0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Calendar/Calendar.razor.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss index 58da117b508..0b5f822b7ed 100644 --- a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss +++ b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss @@ -115,6 +115,17 @@ &.is-today { color: var(--bb-calendar-today-color); + + span { + position: relative; + + &::after { + position: absolute; + inset: 0; + border-radius: 50%; + border: 1px solid var(--bb-calendar-today-border-color); + } + } } &.is-selected { From 66881aaf8ac6a602bdb37b00ad781312700082b8 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 20 Dec 2025 21:52:18 +0800 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E5=BD=93?= =?UTF-8?q?=E6=97=A5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Calendar/Calendar.razor.scss | 22 ++++++++++++++----- .../wwwroot/scss/variables.scss | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss index 0b5f822b7ed..7c4211492fb 100644 --- a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss +++ b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.scss @@ -1,7 +1,7 @@ -@use "../../wwwroot/scss/variables" as *; +@use "../../wwwroot/scss/variables" as *; [data-bs-theme='dark'] .calendar { - --bb-calendar-selected-bg: #{$bb-calendar-selected-bg-dark}; + --bb-calendar-selected-bg: #{$bb-calendar-selected-bg-dark}; } .calendar { @@ -25,6 +25,7 @@ --bb-calendar-cell-hover-bg: #{$bb-calendar-cell-hover-bg}; --bb-calendar-header-padding: #{$bb-calendar-header-padding}; --bb-calendar-today-color: #{$bb-calendar-today-color}; + --bb-calendar-today-border-color: #{$bb-calendar-today-border-color}; --bb-calendar-selected-color: #{$bb-calendar-selected-color}; --bb-calendar-selected-bg: #{$bb-calendar-selected-bg}; --bb-calendar-week-header-border-bottom: #{$bb-calendar-week-header-border-bottom}; @@ -120,10 +121,19 @@ position: relative; &::after { - position: absolute; - inset: 0; - border-radius: 50%; - border: 1px solid var(--bb-calendar-today-border-color); + position: absolute; + width: 2rem; + height: 2rem; + top: -6px; + left: -8px; + border-radius: 50%; + border: 1px solid var(--bb-calendar-today-border-color); + } + } + + &:not(.is-selected) { + span::after { + content: ""; } } } diff --git a/src/BootstrapBlazor/wwwroot/scss/variables.scss b/src/BootstrapBlazor/wwwroot/scss/variables.scss index 9caf1d681a0..69350e8dd6e 100644 --- a/src/BootstrapBlazor/wwwroot/scss/variables.scss +++ b/src/BootstrapBlazor/wwwroot/scss/variables.scss @@ -1,4 +1,4 @@ -// :root +// :root $bb-primary-color: #409eff; $bb-primary-color-rgb: 64, 158, 255; $bb-border-focus-color: #86b7fe; @@ -117,6 +117,7 @@ $bb-calendar-today-color: #409eff; $bb-calendar-selected-color: #fff; $bb-calendar-selected-bg: #409eff; $bb-calendar-selected-bg-dark: #15325b; +$bb-calendar-today-border-color: #0078d4; $bb-calendar-week-header-border-bottom: 2px solid var(--bs-border-color); $bb-calendar-week-header-min-width: 52px; $bb-calendar-week-header-padding: 4px; From 7d9d34b1961c67bafd0b94fa9e21040f1a82321d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 20 Dec 2025 22:31:03 +0800 Subject: [PATCH 6/6] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Calendar/Calendar.razor | 4 ++-- src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BootstrapBlazor/Components/Calendar/Calendar.razor b/src/BootstrapBlazor/Components/Calendar/Calendar.razor index 66923ab8644..3e760cc72ff 100644 --- a/src/BootstrapBlazor/Components/Calendar/Calendar.razor +++ b/src/BootstrapBlazor/Components/Calendar/Calendar.razor @@ -1,4 +1,4 @@ -@namespace BootstrapBlazor.Components +@namespace BootstrapBlazor.Components @inherits BootstrapComponentBase
@@ -97,7 +97,7 @@
-
+
@if (HeaderTemplate != null) { diff --git a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs index c529f95a216..a9ef687ba3b 100644 --- a/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs +++ b/src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License // See the LICENSE file in the project root for more information. // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone