diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.razor.cs index cc5052f88e..31afdd39fd 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.razor.cs @@ -58,6 +58,12 @@ public partial class BitButton : BitComponentBase [Parameter, ResetClassBuilder] public BitColor? Color { get; set; } + /// + /// Preserves the foreground color of the button through hover and focus. + /// + [Parameter, ResetClassBuilder] + public bool FixedColor { get; set; } + /// /// The value of the href attribute of the link rendered by the button. If provided, the component will be rendered as an anchor tag instead of button. /// @@ -203,6 +209,8 @@ protected override void RegisterCssClasses() }); ClassBuilder.Register(() => ReversedIcon ? "bit-btn-rvi" : string.Empty); + + ClassBuilder.Register(() => FixedColor ? "bit-btn-ftc" : string.Empty); } protected override void RegisterCssStyles() diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.scss b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.scss index b7a9d66530..677347da00 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButton/BitButton.scss @@ -151,6 +151,10 @@ } } +.bit-btn-ftc { + color: var(--bit-btn-clr-txt); +} + .bit-btn-pri { --bit-btn-clr: #{$clr-pri}; diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitButtonDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitButtonDemo.razor.cs index 0e76e75803..3b8b054bd2 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitButtonDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitButtonDemo.razor.cs @@ -67,6 +67,13 @@ public partial class BitButtonDemo Href = "#color-enum", }, new() + { + Name = "FixedColor", + Type = "bool", + DefaultValue = "false", + Description = "Preserves the foreground color of the button through hover and focus.", + }, + new() { Name = "Href", Type = "string?",