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(Pagination): change shadow style to use elevation atomic css #2191

Merged
merged 1 commit into from
Oct 22, 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
17 changes: 9 additions & 8 deletions src/Masa.Blazor/Components/Pagination/MPagination.razor
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
}

<MElement Tag="@tag"
Class="@_navigationModifierBuilder.Add(disabled).Build()"
@onclick="@click"
@attributes="@attrs">
Class="@_navigationModifierBuilder.Add(disabled).AddElevation(Elevation).Build()"
@onclick="@click"
@attributes="@attrs">
<MIcon Icon="@icon"/>
</MElement>
};
Expand All @@ -92,12 +92,13 @@
}

var isActive = item.AsT1 == Value;

var elevation = isActive ? Elevation + 2 : Elevation;

<MElement Tag="@tag"
Class="@_itemModifierBuilder.Add("active", isActive).AddBackgroundColor(Color, isActive).Build()"
Style="@(StyleBuilder.Create().AddBackgroundColor(Color, isActive).ToString())"
@onclick="@(() => HandleItemClickAsync(item))"
@attributes="@attrs">
Class="@_itemModifierBuilder.Add("active", isActive).AddElevation(elevation).AddBackgroundColor(Color, isActive).Build()"
Style="@(StyleBuilder.Create().AddBackgroundColor(Color, isActive).ToString())"
@onclick="@(() => HandleItemClickAsync(item))"
@attributes="@attrs">
@item
</MElement>
};
Expand Down
3 changes: 3 additions & 0 deletions src/Masa.Blazor/Components/Pagination/MPagination.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public OneOf<Breakpoints, double> MobileBreakpoint
set => SetValue(value);
}

[Parameter, MasaApiParameter(2, ReleasedOn = "v1.8.0")]
public int Elevation { get; set; } = 2;

private bool _internalMiniVariant;

public bool IsDark
Expand Down
5 changes: 0 additions & 5 deletions src/Masa.Blazor/wwwroot/css/masa-blazor.css
Original file line number Diff line number Diff line change
Expand Up @@ -27216,13 +27216,8 @@ html.overflow-y-hidden {
text-decoration: none;
transition: 0.3s cubic-bezier(0, 0, 0.2, 1);
width: auto;
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}
.m-pagination__item--active {
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
}
.m-pagination__navigation {
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
border-radius: 4px;
display: inline-flex;
justify-content: center;
Expand Down
2 changes: 1 addition & 1 deletion src/Masa.Blazor/wwwroot/css/masa-blazor.min.css

Large diffs are not rendered by default.

Loading