public static IStyledComponent SetBackgroundColor(this IStyledComponent @this, CssColor?color) { if (!color.HasValue) { return(@this); } @this.Style.Add("background-color", color).Add("border-color", color); return(@this); }
public static IStyledComponent SetBackgroundColor(this IStyledComponent @this, string?color) { if (String.IsNullOrWhiteSpace(color)) { return(@this); } // TODO: Try and parse css color @this.Class.Add(color, true); return(@this); }
public static IStyledComponent SetTextColor(this IStyledComponent @this, string?color) { if (String.IsNullOrWhiteSpace(color)) { return(@this); } // TODO: Try and parse css color var parts = color.Split(' ', StringSplitOptions.RemoveEmptyEntries); var colorName = parts[0]; @this.Class.Add($"{colorName}--text", true); if (parts[^ 1] != parts[0])
public static IStyledComponent RemoveClass(this IStyledComponent @this, string key) { @this.Class.Remove(key); return(@this); }
public static IStyledComponent RemoveClasses(this IStyledComponent @this, params string[] keys) { @this.Class.Remove(keys); return(@this); }
public static IStyledComponent RemoveClasses(this IStyledComponent @this, IEnumerable <string> keys) { @this.Class.Remove(keys); return(@this); }
public static IStyledComponent AddClass(this IStyledComponent @this, string key) { @this.Class.Add(key); return(@this); }
public static IStyledComponent AddClasses(this IStyledComponent @this, IStyledComponent component) { @this.Class.Add(component.Class); @this.Style.Add(component.Style); return(@this); }
public static IStyledComponent AddClasses(this IStyledComponent @this, CssClassList cssClassList) { @this.Class.Add(cssClassList); return(@this); }
public static IStyledComponent AddClasses(this IStyledComponent @this, params string[] keys) { @this.Class.Add(keys); return(@this); }
public static IStyledComponent AddClasses(this IStyledComponent @this, IEnumerable <KeyValuePair <string, bool> > values) { @this.Class.Add(values); return(@this); }
public static IStyledComponent ClearClasses(this IStyledComponent @this) { @this.Class.Clear(); return(@this); }
public static IStyledComponent RemoveStyle(this IStyledComponent @this, string key) { @this.Style.Remove(key); return(@this); }
public static IStyledComponent AddStyle(this IStyledComponent @this, string key, string value) { @this.Style.Add(key, value); return(@this); }
public static IStyledComponent AddStyles(this IStyledComponent @this, IEnumerable <KeyValuePair <string, string> > values) { @this.Style.Add(values); return(@this); }
public static IStyledComponent ClearStyles(this IStyledComponent @this) { @this.Style.Clear(); return(@this); }