Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/BootstrapBlazor/Components/Radio/RadioList.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public partial class RadioList<TValue>
.Build();

private string? GetButtonItemClassString(SelectedItem item) => CssBuilder.Default("btn")
.AddClass($"active bg-{Color.ToDescriptionString()}", CurrentValueAsString == item.Value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: The removal of the bg-{Color} class may affect background coloring for active buttons.

If you still want a background color for active buttons, consider adding the appropriate styling, as only the 'active' class is now applied.

.AddClass($"btn-outline-{Color.ToDescriptionString()}")
.AddClass("active", CurrentValueAsString == item.Value)
.Build();

/// <summary>
Expand Down
9 changes: 7 additions & 2 deletions src/BootstrapBlazor/Components/Radio/RadioList.razor.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.radio-list {
.radio-list {
--bb-radio-item-width: #{$bb-radio-item-width};
--bb-radio-item-padding: #{$bb-radio-item-padding};
--bb-radio-group-item-active-color: #{$bb-radio-group-item-active-color};
Expand All @@ -24,7 +24,6 @@
}

&.btn-group {
border: var(--bs-border-width) solid var(--bs-border-color);
display: inline-flex;
flex: 0 !important;
flex-wrap: nowrap;
Expand All @@ -39,12 +38,18 @@
}

&.disabled > span {
--bs-btn-hover-color: var(--bs-btn-color);
--bs-btn-active-color: var(--bs-btn-color);
opacity: var(--bs-btn-disabled-opacity);

&:not(.active) {
background-color: var(--bs-secondary-bg);
}
}

.btn-outline-info {
--bs-btn-active-color: var(--bb-radio-group-item-active-color);
}
}

&.btn-group-vertical {
Expand Down
Loading