UNPKG

1.35 kBJavaScriptView Raw
1"use strict";
2/**
3 * @license
4 * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
5 * This code may only be used under the BSD style license found at
6 * http://polymer.github.io/LICENSE.txt
7 * The complete set of authors may be found at
8 * http://polymer.github.io/AUTHORS.txt
9 * The complete set of contributors may be found at
10 * http://polymer.github.io/CONTRIBUTORS.txt
11 * Code distributed by Google as part of the polymer project is also
12 * subject to an additional IP rights grant found at
13 * http://polymer.github.io/PATENTS.txt
14 */
15Object.defineProperty(exports, "__esModule", { value: true });
16const shadyCss = require("shady-css-parser");
17const css_document_1 = require("./css-document");
18class CssParser {
19 constructor() {
20 this._parser = new shadyCss.Parser();
21 }
22 parse(contents, url, _urlResolver, inlineInfo) {
23 const ast = this._parser.parse(contents);
24 const isInline = !!inlineInfo;
25 inlineInfo = inlineInfo || {};
26 return new css_document_1.ParsedCssDocument({
27 url,
28 baseUrl: inlineInfo.baseUrl,
29 contents,
30 ast,
31 locationOffset: inlineInfo.locationOffset,
32 astNode: inlineInfo.astNode,
33 isInline,
34 });
35 }
36}
37exports.CssParser = CssParser;
38//# sourceMappingURL=css-parser.js.map
\No newline at end of file