Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻ refactor(Input): active color no longer distinguishes themes, defaults to primary #2087

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading