public static IClassBuilder AddElevation(this IClassBuilder builder, int level, bool when = true) { if (!when || level < 1 || level > 6) { return(builder); } return(builder.Add("lx-elevation-l" + level)); }
public static IClassBuilder AddFontColor(this IClassBuilder builder, Color background, bool when = true) { if (!when || background == Color.Transparent) { return(builder); } return(builder.Add(ColorHelper.IsDarkColor(background) ? "lx-fg-white" : "lx-fg-black")); }
public static IClassBuilder AddFontColor(this IClassBuilder builder, Color background, Appearance appearance) { if (appearance == Appearance.Inline || appearance == Appearance.Outlined || background == Color.Transparent) { return(builder); } return(builder.Add(ColorHelper.IsDarkColor(background) ? "lx-fg-white" : "lx-fg-black")); }
public static IClassBuilder AddSize(this IClassBuilder builder, ComponentSize size, bool when = true) { if (!when) { return(builder); } return(builder .Add(ClassNames.InputComponent) .Add(size switch { ComponentSize.Tiny => ClassNames.SizeTiny, ComponentSize.Small => ClassNames.SizeSmall, ComponentSize.Medium => ClassNames.SizeMedium, ComponentSize.Large => ClassNames.SizeLarge, ComponentSize.Big => ClassNames.SizeBig, ComponentSize.Huge => ClassNames.SizeHuge, ComponentSize.Massive => ClassNames.SizeMassive, _ => throw new ArgumentOutOfRangeException(nameof(size)) }));