Skip to content

Commit

Permalink
feat(blazorui): add missing Root property from the BitToggleButtonCla…
Browse files Browse the repository at this point in the history
…ssStyles #5387 (#5494)
  • Loading branch information
Hanieh-Sadeghi authored Oct 9, 2023
1 parent 2a8984e commit 1d893e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,19 @@ public bool IsChecked

protected override void RegisterCssClasses()
{
ClassBuilder.Register(() => Classes?.Root);

ClassBuilder.Register(() => ButtonStyle == BitButtonStyle.Primary
? $"{RootElementClass}-pri"
: $"{RootElementClass}-std");

ClassBuilder.Register(() => IsChecked ? $"{RootElementClass}-chk" : string.Empty);
}

protected override void RegisterCssStyles()
{
StyleBuilder.Register(() => Styles?.Root);
}

protected override async Task OnInitializedAsync()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
public class BitToggleButtonClassStyles
{
/// <summary>
/// Custom CSS classes/styles for the icon element.
/// Custom CSS classes/styles for the root element of the BitToggleButton.
/// </summary>
public string? Root { get; set; }

/// <summary>
/// Custom CSS classes/styles for the icon element of the BitToggleButton.
/// </summary>
public string? Icon { get; set; }

/// <summary>
/// Custom CSS classes/styles for the label and icon container.
/// Custom CSS classes/styles for the label and icon container of the BitToggleButton.
/// </summary>
public string? Container { get; set; }

/// <summary>
/// Custom CSS classes/styles for the text element.
/// Custom CSS classes/styles for the text element of the BitToggleButton.
/// </summary>
public string? Text { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,33 @@ public partial class BitToggleButtonDemo
Title = "BitToggleButtonClassStyles",
Parameters = new()
{
new()
{
Name = "Root",
Type = "string?",
DefaultValue = "null",
Description = "Custom CSS classes/styles for the root element of the BitToggleButton.",
},
new()
{
Name = "Icon",
Type = "string?",
DefaultValue = "null",
Description = "Custom CSS classes/styles for the icon element.",
Description = "Custom CSS classes/styles for the icon element of the BitToggleButton.",
},
new()
{
Name = "Container",
Type = "string?",
DefaultValue = "null",
Description = "Custom CSS classes/styles for the icon and label container.",
Description = "Custom CSS classes/styles for the icon and label container of the BitToggleButton.",
},
new()
{
Name = "Text",
Type = "string?",
DefaultValue = "null",
Description = "Custom CSS classes/styles for the text element.",
Description = "Custom CSS classes/styles for the text element of the BitToggleButton.",
}
}
}
Expand Down

0 comments on commit 1d893e1

Please sign in to comment.