ant-design-blazor/components/core/Helpers/StyleHelper.cs

11 lines
303 B
C#
Raw Normal View History

namespace AntDesign
2019-12-08 00:51:07 +08:00
{
2020-04-24 18:32:50 +08:00
public static class StyleHelper
2019-12-08 00:51:07 +08:00
{
//fix the user set 100% or xxxVH etc..
public static string ToCssPixel(string value) => int.TryParse(value, out var _) ? $"{value}px" : value;
public static string ToCssPixel(int value) => $"{value}px";
2019-12-08 00:51:07 +08:00
}
2020-04-24 18:32:50 +08:00
}