mediaFeatures method

List<Node> mediaFeatures ()

Search for a list of mediaFeature, such as:

@media all and (max-width: 1024px)
@media handheld and (min-width: @var), scrreen and (min-width: 20em)

Implementation

List<Node> mediaFeatures() {
  Node e;
  final List<Node> features = <Node>[];

  do {
    e = mediaFeature();
    if (e != null) {
      features.add(e);
      if (parserInput.$char(',') == null) break;
    } else {
      e = entities.variable() ?? entities.mixinLookup();

      if (e != null) {
        features.add(e);
        if (parserInput.$char(',') == null) break;
      }
    }
  } while (e != null);

  return features.isNotEmpty ? features : null;

// 3.5.0.beta.5 20180703
//  mediaFeatures: function () {
//      var entities = this.entities, features = [], e;
//      do {
//          e = this.mediaFeature();
//          if (e) {
//              features.push(e);
//              if (!parserInput.$char(',')) { break; }
//          } else {
//              e = entities.variable() || entities.mixinLookup();
//              if (e) {
//                  features.push(e);
//                  if (!parserInput.$char(',')) { break; }
//              }
//          }
//      } while (e);
//
//      return features.length > 0 ? features : null;
//  },
}