Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add FixedColor parameter to BitButton #8641
Browse files Browse the repository at this point in the history
msynk committed Sep 14, 2024
1 parent 592acb2 commit a96ae2b
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -58,6 +58,12 @@ public partial class BitButton : BitComponentBase
[Parameter, ResetClassBuilder]
public BitColor? Color { get; set; }

/// <summary>
/// Preserves the foreground color of the button through hover and focus.
/// </summary>
[Parameter, ResetClassBuilder]
public bool FixedColor { get; set; }

/// <summary>
/// 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.
/// </summary>
@@ -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()
Original file line number Diff line number Diff line change
@@ -151,6 +151,10 @@
}
}

.bit-btn-ftc {
color: var(--bit-btn-clr-txt);
}


.bit-btn-pri {
--bit-btn-clr: #{$clr-pri};
Original file line number Diff line number Diff line change
@@ -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?",

0 comments on commit a96ae2b

Please sign in to comment.