CssShorthandProperty
Base class for all shorthand properties
using AngleSharp.Css;
namespace AngleSharp.Dom.Css
{
internal abstract class CssShorthandProperty : CssProperty
{
public CssShorthandProperty(string name, PropertyFlags flags = PropertyFlags.None)
: base(name, flags | PropertyFlags.Shorthand)
{
}
public string Stringify(CssProperty[] properties)
{
return Converter.Construct(properties)?.CssText;
}
public void Export(CssProperty[] properties)
{
foreach (CssProperty cssProperty in properties) {
CssValue newValue = base.DeclaredValue.ExtractFor(cssProperty.Name);
cssProperty.TrySetValue(newValue);
}
}
}
}