KeyframeSelector
Represents the keyframe selector.
using AngleSharp.Css.Values;
using AngleSharp.Extensions;
using System.Collections.Generic;
using System.IO;
namespace AngleSharp.Dom.Css
{
internal sealed class KeyframeSelector : CssNode, IKeyframeSelector, ICssNode, IStyleFormattable
{
private readonly List<Percent> _stops;
public IEnumerable<Percent> Stops => _stops;
public string Text => this.ToCss();
public KeyframeSelector(IEnumerable<Percent> stops)
{
_stops = new List<Percent>(stops);
}
public override void ToCss(TextWriter writer, IStyleFormatter formatter)
{
if (_stops.Count > 0) {
writer.Write(_stops[0].ToString());
for (int i = 1; i < _stops.Count; i++) {
writer.Write(", ");
writer.Write(_stops[i].ToString());
}
}
}
}
}