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

10 lines
295 B
C#
Raw Normal View History

2019-12-08 00:51:07 +08:00
namespace AntBlazor
{
public class StyleHelper
{
//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
}
}