Skip to content

Commit

Permalink
♻ refactor(Input): active color no longer distinguishes themes, defau…
Browse files Browse the repository at this point in the history
…lts to primary
  • Loading branch information
capdiem committed Aug 9, 2024
1 parent 8ffc818 commit 22471af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Masa.Blazor/Components/Input/MInput.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class MInput<TValue> : MasaComponentBase, IThemeable, IFilterInpu

[CascadingParameter(Name = "AppIsDark")] protected bool AppIsDark { get; set; }

[Parameter] public virtual string? Color { get; set; }
[Parameter][MasaApiParameter("primary")] public string? Color { get; set; } = "primary";

[Parameter] public string? BackgroundColor { get; set; }

Expand Down Expand Up @@ -224,7 +224,7 @@ public void StateHasChangedForJsInvokable()

#endregion

public virtual string? ComputedColor => IsDisabled ? null : Color ?? (IsDark && !AppIsDark ? "white" : "black");
public virtual string? ComputedColor => IsDisabled ? null : Color;

public virtual bool HasColor => false;

Expand Down
2 changes: 0 additions & 2 deletions src/Masa.Blazor/Components/Slider/MSliderBase.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public partial class MSliderBase<TValue, TNumeric> : MInput<TValue>, IOutsideCli

[Parameter] [MasaApiParameter(false)] public StringBoolean Ticks { get; set; } = false;

[Parameter] [MasaApiParameter("primary")] public override string? Color { get; set; } = "primary";

[Parameter] public string? TrackColor { get; set; }

[Parameter] public string? TrackFillColor { get; set; }
Expand Down
13 changes: 1 addition & 12 deletions src/Masa.Blazor/Components/TextField/MTextField.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,7 @@ public virtual bool Outlined

public bool HasCounter => Counter != false && Counter != null;

public override string? ComputedColor
{
get
{
if (!SoloInverted || !IsFocused)
{
return base.ComputedColor;
}

return Color ?? "primary";
}
}
public override string? ComputedColor => !SoloInverted || !IsFocused ? base.ComputedColor : Color;

public override bool HasColor => IsFocused;

Expand Down

0 comments on commit 22471af

Please sign in to comment.