parseList static method

CSS? parseList(
  1. List<String> entries
)

Implementation

static CSS? parseList(List<String> entries) {
  if (entries.isEmpty) return null;

  var cssEntries = <CSSEntry>[];

  String? comment;

  for (var i = 0; i < entries.length; ++i) {
    var e = entries[i];
    e = e.trim();
    if (e.isEmpty) continue;

    if (e.startsWith('/*') && e.endsWith('*/')) {
      comment = e;
    } else {
      var entry = CSSEntry.parse(e, comment);
      if (entry != null) {
        cssEntries.add(entry);
      }
      comment = null;
    }
  }

  var o = CSS._();
  o.putAll(cssEntries);
  return o;
}