mirror of
https://gitee.com/blazorcomponent/MASA.Blazor.git
synced 2025-12-06 18:29:29 +08:00
🐛 fix(Theme): missing the 'surface-container' css class (#2329)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
namespace Masa.Blazor;
|
||||
using BemIt.Extensions;
|
||||
|
||||
namespace Masa.Blazor;
|
||||
|
||||
public static class ThemeCssBuilder
|
||||
{
|
||||
@@ -66,7 +68,8 @@ public static class ThemeCssBuilder
|
||||
Build(combinePrefix, nameof(options.Warning).ToLowerInvariant(), hasOnColor: true),
|
||||
Build(combinePrefix, nameof(options.Error).ToLowerInvariant(), hasOnColor: true),
|
||||
Build(combinePrefix, nameof(options.Surface).ToLowerInvariant(), hasOnColor: true),
|
||||
Build(combinePrefix, options.UserDefined)
|
||||
Build(combinePrefix, options.UserDefined),
|
||||
BuildBgCssClass(combinePrefix, nameof(options.SurfaceContainer).ToKebab())
|
||||
};
|
||||
|
||||
return string.Concat(lstCss);
|
||||
@@ -121,4 +124,15 @@ public static class ThemeCssBuilder
|
||||
{
|
||||
return string.Join("", userDefined.Select(x => Build(combinePrefix, x.Key.ToLowerInvariant())));
|
||||
}
|
||||
|
||||
private static string BuildBgCssClass(string combinePrefix, string className)
|
||||
{
|
||||
return $$"""
|
||||
|
||||
{{combinePrefix}}.{{className}} {
|
||||
background-color: var(--m-theme-{{className}}) !important;
|
||||
border-color: var(--m-theme-{{className}}) !important;
|
||||
}
|
||||
""";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user