public static IDistance ToImageBorderWidth(this CSSValue value) { if (value.Is(Keywords.Auto)) { return(Percent.Hundred); } var multiple = value.ToSingle(); if (multiple.HasValue) { return(new Percent(multiple.Value * 100f)); } return(value.ToDistance()); }
public static IDistance ToLineHeight(this CSSValue value) { var distance = value.ToDistance(); if (distance != null) { return(distance); } else if (value.Is(Keywords.Normal)) { return(new Percent(120f)); } var val = value.ToSingle(); if (val.HasValue) { return(new Percent(val.Value * 100f)); } return(null); }