static CssImportRule NewImportRule(String cssText) { var parser = new CssParser(); var rule = new CssImportRule(parser); rule.CssText = cssText; return rule; }
public CssRule CreateImport(CssToken current) { var token = _tokenizer.Get(); var rule = new CssImportRule(_parser); if (token.Is(CssTokenType.String, CssTokenType.Url)) { rule.Href = token.Data; token = _tokenizer.Get(); FillMediaList(rule.Media, CssTokenType.Semicolon, ref token); } _tokenizer.JumpToNextSemicolon(); return rule; }
public CssRule CreateImport(CssToken current) { var rule = new CssImportRule(_parser); var start = current.Position; var token = NextToken(); _nodes.Push(rule); CollectTrivia(ref token); if (token.Is(CssTokenType.String, CssTokenType.Url)) { rule.Href = token.Data; token = NextToken(); CollectTrivia(ref token); FillMediaList(rule.Media, CssTokenType.Semicolon, ref token); } CollectTrivia(ref token); JumpToEnd(ref token); rule.SourceCode = CreateView(start, token.Position); _nodes.Pop(); return rule; }