public static IDistance ToBorderSlice(this CSSValue value) { var percent = value.ToPercent(); if (percent.HasValue) { return(percent.Value); } var number = value.ToSingle(); if (number.HasValue) { return(new Length(number.Value, Length.Unit.Px)); } return(null); }
static SliceMode ToMode(CSSValue value) { var percent = value.ToPercent(); if (percent.HasValue) { return(new PercentSliceMode(percent.Value)); } var number = value.ToNumber(); if (number.HasValue) { return(new PixelSliceMode(number.Value)); } return(null); }