(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define('vscode-css-languageservice/parser/cssScanner',["require", "exports"], factory); } })(function (require, exports) { /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var TokenType; (function (TokenType) { TokenType[TokenType["Ident"] = 0] = "Ident"; TokenType[TokenType["AtKeyword"] = 1] = "AtKeyword"; TokenType[TokenType["String"] = 2] = "String"; TokenType[TokenType["BadString"] = 3] = "BadString"; TokenType[TokenType["UnquotedString"] = 4] = "UnquotedString"; TokenType[TokenType["Hash"] = 5] = "Hash"; TokenType[TokenType["Num"] = 6] = "Num"; TokenType[TokenType["Percentage"] = 7] = "Percentage"; TokenType[TokenType["Dimension"] = 8] = "Dimension"; TokenType[TokenType["UnicodeRange"] = 9] = "UnicodeRange"; TokenType[TokenType["CDO"] = 10] = "CDO"; TokenType[TokenType["CDC"] = 11] = "CDC"; TokenType[TokenType["Colon"] = 12] = "Colon"; TokenType[TokenType["SemiColon"] = 13] = "SemiColon"; TokenType[TokenType["CurlyL"] = 14] = "CurlyL"; TokenType[TokenType["CurlyR"] = 15] = "CurlyR"; TokenType[TokenType["ParenthesisL"] = 16] = "ParenthesisL"; TokenType[TokenType["ParenthesisR"] = 17] = "ParenthesisR"; TokenType[TokenType["BracketL"] = 18] = "BracketL"; TokenType[TokenType["BracketR"] = 19] = "BracketR"; TokenType[TokenType["Whitespace"] = 20] = "Whitespace"; TokenType[TokenType["Includes"] = 21] = "Includes"; TokenType[TokenType["Dashmatch"] = 22] = "Dashmatch"; TokenType[TokenType["SubstringOperator"] = 23] = "SubstringOperator"; TokenType[TokenType["PrefixOperator"] = 24] = "PrefixOperator"; TokenType[TokenType["SuffixOperator"] = 25] = "SuffixOperator"; TokenType[TokenType["Delim"] = 26] = "Delim"; TokenType[TokenType["EMS"] = 27] = "EMS"; TokenType[TokenType["EXS"] = 28] = "EXS"; TokenType[TokenType["Length"] = 29] = "Length"; TokenType[TokenType["Angle"] = 30] = "Angle"; TokenType[TokenType["Time"] = 31] = "Time"; TokenType[TokenType["Freq"] = 32] = "Freq"; TokenType[TokenType["Exclamation"] = 33] = "Exclamation"; TokenType[TokenType["Resolution"] = 34] = "Resolution"; TokenType[TokenType["Comma"] = 35] = "Comma"; TokenType[TokenType["Charset"] = 36] = "Charset"; TokenType[TokenType["EscapedJavaScript"] = 37] = "EscapedJavaScript"; TokenType[TokenType["BadEscapedJavaScript"] = 38] = "BadEscapedJavaScript"; TokenType[TokenType["Comment"] = 39] = "Comment"; TokenType[TokenType["SingleLineComment"] = 40] = "SingleLineComment"; TokenType[TokenType["EOF"] = 41] = "EOF"; TokenType[TokenType["CustomToken"] = 42] = "CustomToken"; })(TokenType = exports.TokenType || (exports.TokenType = {})); var MultiLineStream = /** @class */ (function () { function MultiLineStream(source) { this.source = source; this.len = source.length; this.position = 0; } MultiLineStream.prototype.substring = function (from, to) { if (to === void 0) { to = this.position; } return this.source.substring(from, to); }; MultiLineStream.prototype.eos = function () { return this.len <= this.position; }; MultiLineStream.prototype.pos = function () { return this.position; }; MultiLineStream.prototype.goBackTo = function (pos) { this.position = pos; }; MultiLineStream.prototype.goBack = function (n) { this.position -= n; }; MultiLineStream.prototype.advance = function (n) { this.position += n; }; MultiLineStream.prototype.nextChar = function () { return this.source.charCodeAt(this.position++) || 0; }; MultiLineStream.prototype.peekChar = function (n) { if (n === void 0) { n = 0; } return this.source.charCodeAt(this.position + n) || 0; }; MultiLineStream.prototype.lookbackChar = function (n) { if (n === void 0) { n = 0; } return this.source.charCodeAt(this.position - n) || 0; }; MultiLineStream.prototype.advanceIfChar = function (ch) { if (ch === this.source.charCodeAt(this.position)) { this.position++; return true; } return false; }; MultiLineStream.prototype.advanceIfChars = function (ch) { if (this.position + ch.length > this.source.length) { return false; } var i = 0; for (; i < ch.length; i++) { if (this.source.charCodeAt(this.position + i) !== ch[i]) { return false; } } this.advance(i); return true; }; MultiLineStream.prototype.advanceWhileChar = function (condition) { var posNow = this.position; while (this.position < this.len && condition(this.source.charCodeAt(this.position))) { this.position++; } return this.position - posNow; }; return MultiLineStream; }()); exports.MultiLineStream = MultiLineStream; var _a = 'a'.charCodeAt(0); var _f = 'f'.charCodeAt(0); var _z = 'z'.charCodeAt(0); var _A = 'A'.charCodeAt(0); var _F = 'F'.charCodeAt(0); var _Z = 'Z'.charCodeAt(0); var _0 = '0'.charCodeAt(0); var _9 = '9'.charCodeAt(0); var _TLD = '~'.charCodeAt(0); var _HAT = '^'.charCodeAt(0); var _EQS = '='.charCodeAt(0); var _PIP = '|'.charCodeAt(0); var _MIN = '-'.charCodeAt(0); var _USC = '_'.charCodeAt(0); var _PRC = '%'.charCodeAt(0); var _MUL = '*'.charCodeAt(0); var _LPA = '('.charCodeAt(0); var _RPA = ')'.charCodeAt(0); var _LAN = '<'.charCodeAt(0); var _RAN = '>'.charCodeAt(0); var _ATS = '@'.charCodeAt(0); var _HSH = '#'.charCodeAt(0); var _DLR = '$'.charCodeAt(0); var _BSL = '\\'.charCodeAt(0); var _FSL = '/'.charCodeAt(0); var _NWL = '\n'.charCodeAt(0); var _CAR = '\r'.charCodeAt(0); var _LFD = '\f'.charCodeAt(0); var _DQO = '"'.charCodeAt(0); var _SQO = '\''.charCodeAt(0); var _WSP = ' '.charCodeAt(0); var _TAB = '\t'.charCodeAt(0); var _SEM = ';'.charCodeAt(0); var _COL = ':'.charCodeAt(0); var _CUL = '{'.charCodeAt(0); var _CUR = '}'.charCodeAt(0); var _BRL = '['.charCodeAt(0); var _BRR = ']'.charCodeAt(0); var _CMA = ','.charCodeAt(0); var _DOT = '.'.charCodeAt(0); var _BNG = '!'.charCodeAt(0); var staticTokenTable = {}; staticTokenTable[_SEM] = TokenType.SemiColon; staticTokenTable[_COL] = TokenType.Colon; staticTokenTable[_CUL] = TokenType.CurlyL; staticTokenTable[_CUR] = TokenType.CurlyR; staticTokenTable[_BRR] = TokenType.BracketR; staticTokenTable[_BRL] = TokenType.BracketL; staticTokenTable[_LPA] = TokenType.ParenthesisL; staticTokenTable[_RPA] = TokenType.ParenthesisR; staticTokenTable[_CMA] = TokenType.Comma; var staticUnitTable = {}; staticUnitTable['em'] = TokenType.EMS; staticUnitTable['ex'] = TokenType.EXS; staticUnitTable['px'] = TokenType.Length; staticUnitTable['cm'] = TokenType.Length; staticUnitTable['mm'] = TokenType.Length; staticUnitTable['in'] = TokenType.Length; staticUnitTable['pt'] = TokenType.Length; staticUnitTable['pc'] = TokenType.Length; staticUnitTable['deg'] = TokenType.Angle; staticUnitTable['rad'] = TokenType.Angle; staticUnitTable['grad'] = TokenType.Angle; staticUnitTable['ms'] = TokenType.Time; staticUnitTable['s'] = TokenType.Time; staticUnitTable['hz'] = TokenType.Freq; staticUnitTable['khz'] = TokenType.Freq; staticUnitTable['%'] = TokenType.Percentage; staticUnitTable['fr'] = TokenType.Percentage; staticUnitTable['dpi'] = TokenType.Resolution; staticUnitTable['dpcm'] = TokenType.Resolution; var Scanner = /** @class */ (function () { function Scanner() { this.stream = new MultiLineStream(''); this.ignoreComment = true; this.ignoreWhitespace = true; this.inURL = false; } Scanner.prototype.setSource = function (input) { this.stream = new MultiLineStream(input); }; Scanner.prototype.finishToken = function (offset, type, text) { return { offset: offset, len: this.stream.pos() - offset, type: type, text: text || this.stream.substring(offset) }; }; Scanner.prototype.substring = function (offset, len) { return this.stream.substring(offset, offset + len); }; Scanner.prototype.pos = function () { return this.stream.pos(); }; Scanner.prototype.goBackTo = function (pos) { this.stream.goBackTo(pos); }; Scanner.prototype.scanUnquotedString = function () { var offset = this.stream.pos(); var content = []; if (this._unquotedString(content)) { return this.finishToken(offset, TokenType.UnquotedString, content.join('')); } return null; }; Scanner.prototype.scan = function () { // processes all whitespaces and comments var triviaToken = this.trivia(); if (triviaToken !== null) { return triviaToken; } var offset = this.stream.pos(); // End of file/input if (this.stream.eos()) { return this.finishToken(offset, TokenType.EOF); } return this.scanNext(offset); }; Scanner.prototype.scanNext = function (offset) { // CDO if (this.stream.advanceIfChars([_MIN, _MIN, _RAN])) { return this.finishToken(offset, TokenType.CDC); } var content = []; if (this.ident(content)) { return this.finishToken(offset, TokenType.Ident, content.join('')); } // at-keyword if (this.stream.advanceIfChar(_ATS)) { content = ['@']; if (this._name(content)) { var keywordText = content.join(''); if (keywordText === '@charset') { return this.finishToken(offset, TokenType.Charset, keywordText); } return this.finishToken(offset, TokenType.AtKeyword, keywordText); } else { return this.finishToken(offset, TokenType.Delim); } } // hash if (this.stream.advanceIfChar(_HSH)) { content = ['#']; if (this._name(content)) { return this.finishToken(offset, TokenType.Hash, content.join('')); } else { return this.finishToken(offset, TokenType.Delim); } } // Important if (this.stream.advanceIfChar(_BNG)) { return this.finishToken(offset, TokenType.Exclamation); } // Numbers if (this._number()) { var pos = this.stream.pos(); content = [this.stream.substring(offset, pos)]; if (this.stream.advanceIfChar(_PRC)) { // Percentage 43% return this.finishToken(offset, TokenType.Percentage); } else if (this.ident(content)) { var dim = this.stream.substring(pos).toLowerCase(); var tokenType_1 = staticUnitTable[dim]; if (typeof tokenType_1 !== 'undefined') { // Known dimension 43px return this.finishToken(offset, tokenType_1, content.join('')); } else { // Unknown dimension 43ft return this.finishToken(offset, TokenType.Dimension, content.join('')); } } return this.finishToken(offset, TokenType.Num); } // String, BadString content = []; var tokenType = this._string(content); if (tokenType !== null) { return this.finishToken(offset, tokenType, content.join('')); } // single character tokens tokenType = staticTokenTable[this.stream.peekChar()]; if (typeof tokenType !== 'undefined') { this.stream.advance(1); return this.finishToken(offset, tokenType); } // includes ~= if (this.stream.peekChar(0) === _TLD && this.stream.peekChar(1) === _EQS) { this.stream.advance(2); return this.finishToken(offset, TokenType.Includes); } // DashMatch |= if (this.stream.peekChar(0) === _PIP && this.stream.peekChar(1) === _EQS) { this.stream.advance(2); return this.finishToken(offset, TokenType.Dashmatch); } // Substring operator *= if (this.stream.peekChar(0) === _MUL && this.stream.peekChar(1) === _EQS) { this.stream.advance(2); return this.finishToken(offset, TokenType.SubstringOperator); } // Substring operator ^= if (this.stream.peekChar(0) === _HAT && this.stream.peekChar(1) === _EQS) { this.stream.advance(2); return this.finishToken(offset, TokenType.PrefixOperator); } // Substring operator $= if (this.stream.peekChar(0) === _DLR && this.stream.peekChar(1) === _EQS) { this.stream.advance(2); return this.finishToken(offset, TokenType.SuffixOperator); } // Delim this.stream.nextChar(); return this.finishToken(offset, TokenType.Delim); }; Scanner.prototype._matchWordAnyCase = function (characters) { var index = 0; this.stream.advanceWhileChar(function (ch) { var result = characters[index] === ch || characters[index + 1] === ch; if (result) { index += 2; } return result; }); if (index === characters.length) { return true; } else { this.stream.goBack(index / 2); return false; } }; Scanner.prototype.trivia = function () { while (true) { var offset = this.stream.pos(); if (this._whitespace()) { if (!this.ignoreWhitespace) { return this.finishToken(offset, TokenType.Whitespace); } } else if (this.comment()) { if (!this.ignoreComment) { return this.finishToken(offset, TokenType.Comment); } } else { return null; } } }; Scanner.prototype.comment = function () { if (this.stream.advanceIfChars([_FSL, _MUL])) { var success_1 = false, hot_1 = false; this.stream.advanceWhileChar(function (ch) { if (hot_1 && ch === _FSL) { success_1 = true; return false; } hot_1 = ch === _MUL; return true; }); if (success_1) { this.stream.advance(1); } return true; } return false; }; Scanner.prototype._number = function () { var npeek = 0, ch; if (this.stream.peekChar() === _DOT) { npeek = 1; } ch = this.stream.peekChar(npeek); if (ch >= _0 && ch <= _9) { this.stream.advance(npeek + 1); this.stream.advanceWhileChar(function (ch) { return ch >= _0 && ch <= _9 || npeek === 0 && ch === _DOT; }); return true; } return false; }; Scanner.prototype._newline = function (result) { var ch = this.stream.peekChar(); switch (ch) { case _CAR: case _LFD: case _NWL: this.stream.advance(1); result.push(String.fromCharCode(ch)); if (ch === _CAR && this.stream.advanceIfChar(_NWL)) { result.push('\n'); } return true; } return false; }; Scanner.prototype._escape = function (result, includeNewLines) { var ch = this.stream.peekChar(); if (ch === _BSL) { this.stream.advance(1); ch = this.stream.peekChar(); var hexNumCount = 0; while (hexNumCount < 6 && (ch >= _0 && ch <= _9 || ch >= _a && ch <= _f || ch >= _A && ch <= _F)) { this.stream.advance(1); ch = this.stream.peekChar(); hexNumCount++; } if (hexNumCount > 0) { try { var hexVal = parseInt(this.stream.substring(this.stream.pos() - hexNumCount), 16); if (hexVal) { result.push(String.fromCharCode(hexVal)); } } catch (e) { // ignore } // optional whitespace or new line, not part of result text if (ch === _WSP || ch === _TAB) { this.stream.advance(1); } else { this._newline([]); } return true; } if (ch !== _CAR && ch !== _LFD && ch !== _NWL) { this.stream.advance(1); result.push(String.fromCharCode(ch)); return true; } else if (includeNewLines) { return this._newline(result); } } return false; }; Scanner.prototype._stringChar = function (closeQuote, result) { // not closeQuote, not backslash, not newline var ch = this.stream.peekChar(); if (ch !== 0 && ch !== closeQuote && ch !== _BSL && ch !== _CAR && ch !== _LFD && ch !== _NWL) { this.stream.advance(1); result.push(String.fromCharCode(ch)); return true; } return false; }; Scanner.prototype._string = function (result) { if (this.stream.peekChar() === _SQO || this.stream.peekChar() === _DQO) { var closeQuote = this.stream.nextChar(); result.push(String.fromCharCode(closeQuote)); while (this._stringChar(closeQuote, result) || this._escape(result, true)) { // loop } if (this.stream.peekChar() === closeQuote) { this.stream.nextChar(); result.push(String.fromCharCode(closeQuote)); return TokenType.String; } else { return TokenType.BadString; } } return null; }; Scanner.prototype._unquotedChar = function (result) { // not closeQuote, not backslash, not newline var ch = this.stream.peekChar(); if (ch !== 0 && ch !== _BSL && ch !== _SQO && ch !== _DQO && ch !== _LPA && ch !== _RPA && ch !== _WSP && ch !== _TAB && ch !== _NWL && ch !== _LFD && ch !== _CAR) { this.stream.advance(1); result.push(String.fromCharCode(ch)); return true; } return false; }; Scanner.prototype._unquotedString = function (result) { var hasContent = false; while (this._unquotedChar(result) || this._escape(result)) { hasContent = true; } return hasContent; }; Scanner.prototype._whitespace = function () { var n = this.stream.advanceWhileChar(function (ch) { return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; }); return n > 0; }; Scanner.prototype._name = function (result) { var matched = false; while (this._identChar(result) || this._escape(result)) { matched = true; } return matched; }; Scanner.prototype.ident = function (result) { var pos = this.stream.pos(); var hasMinus = this._minus(result); if (hasMinus && this._minus(result) /* -- */) { if (this._identFirstChar(result) || this._escape(result)) { while (this._identChar(result) || this._escape(result)) { // loop } return true; } } else if (this._identFirstChar(result) || this._escape(result)) { while (this._identChar(result) || this._escape(result)) { // loop } return true; } this.stream.goBackTo(pos); return false; }; Scanner.prototype._identFirstChar = function (result) { var ch = this.stream.peekChar(); if (ch === _USC || // _ ch >= _a && ch <= _z || // a-z ch >= _A && ch <= _Z || // A-Z ch >= 0x80 && ch <= 0xFFFF) { // nonascii this.stream.advance(1); result.push(String.fromCharCode(ch)); return true; } return false; }; Scanner.prototype._minus = function (result) { var ch = this.stream.peekChar(); if (ch === _MIN) { this.stream.advance(1); result.push(String.fromCharCode(ch)); return true; } return false; }; Scanner.prototype._identChar = function (result) { var ch = this.stream.peekChar(); if (ch === _USC || // _ ch === _MIN || // - ch >= _a && ch <= _z || // a-z ch >= _A && ch <= _Z || // A-Z ch >= _0 && ch <= _9 || // 0/9 ch >= 0x80 && ch <= 0xFFFF) { // nonascii this.stream.advance(1); result.push(String.fromCharCode(ch)); return true; } return false; }; return Scanner; }()); exports.Scanner = Scanner; }); var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define('vscode-css-languageservice/parser/cssNodes',["require", "exports"], factory); } })(function (require, exports) { /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); /// /// Nodes for the css 2.1 specification. See for reference: /// http://www.w3.org/TR/CSS21/grammar.html#grammar /// var NodeType; (function (NodeType) { NodeType[NodeType["Undefined"] = 0] = "Undefined"; NodeType[NodeType["Identifier"] = 1] = "Identifier"; NodeType[NodeType["Stylesheet"] = 2] = "Stylesheet"; NodeType[NodeType["Ruleset"] = 3] = "Ruleset"; NodeType[NodeType["Selector"] = 4] = "Selector"; NodeType[NodeType["SimpleSelector"] = 5] = "SimpleSelector"; NodeType[NodeType["SelectorInterpolation"] = 6] = "SelectorInterpolation"; NodeType[NodeType["SelectorCombinator"] = 7] = "SelectorCombinator"; NodeType[NodeType["SelectorCombinatorParent"] = 8] = "SelectorCombinatorParent"; NodeType[NodeType["SelectorCombinatorSibling"] = 9] = "SelectorCombinatorSibling"; NodeType[NodeType["SelectorCombinatorAllSiblings"] = 10] = "SelectorCombinatorAllSiblings"; NodeType[NodeType["SelectorCombinatorShadowPiercingDescendant"] = 11] = "SelectorCombinatorShadowPiercingDescendant"; NodeType[NodeType["Page"] = 12] = "Page"; NodeType[NodeType["PageBoxMarginBox"] = 13] = "PageBoxMarginBox"; NodeType[NodeType["ClassSelector"] = 14] = "ClassSelector"; NodeType[NodeType["IdentifierSelector"] = 15] = "IdentifierSelector"; NodeType[NodeType["ElementNameSelector"] = 16] = "ElementNameSelector"; NodeType[NodeType["PseudoSelector"] = 17] = "PseudoSelector"; NodeType[NodeType["AttributeSelector"] = 18] = "AttributeSelector"; NodeType[NodeType["Declaration"] = 19] = "Declaration"; NodeType[NodeType["Declarations"] = 20] = "Declarations"; NodeType[NodeType["Property"] = 21] = "Property"; NodeType[NodeType["Expression"] = 22] = "Expression"; NodeType[NodeType["BinaryExpression"] = 23] = "BinaryExpression"; NodeType[NodeType["Term"] = 24] = "Term"; NodeType[NodeType["Operator"] = 25] = "Operator"; NodeType[NodeType["Value"] = 26] = "Value"; NodeType[NodeType["StringLiteral"] = 27] = "StringLiteral"; NodeType[NodeType["URILiteral"] = 28] = "URILiteral"; NodeType[NodeType["EscapedValue"] = 29] = "EscapedValue"; NodeType[NodeType["Function"] = 30] = "Function"; NodeType[NodeType["NumericValue"] = 31] = "NumericValue"; NodeType[NodeType["HexColorValue"] = 32] = "HexColorValue"; NodeType[NodeType["MixinDeclaration"] = 33] = "MixinDeclaration"; NodeType[NodeType["MixinReference"] = 34] = "MixinReference"; NodeType[NodeType["VariableName"] = 35] = "VariableName"; NodeType[NodeType["VariableDeclaration"] = 36] = "VariableDeclaration"; NodeType[NodeType["Prio"] = 37] = "Prio"; NodeType[NodeType["Interpolation"] = 38] = "Interpolation"; NodeType[NodeType["NestedProperties"] = 39] = "NestedProperties"; NodeType[NodeType["ExtendsReference"] = 40] = "ExtendsReference"; NodeType[NodeType["SelectorPlaceholder"] = 41] = "SelectorPlaceholder"; NodeType[NodeType["Debug"] = 42] = "Debug"; NodeType[NodeType["If"] = 43] = "If"; NodeType[NodeType["Else"] = 44] = "Else"; NodeType[NodeType["For"] = 45] = "For"; NodeType[NodeType["Each"] = 46] = "Each"; NodeType[NodeType["While"] = 47] = "While"; NodeType[NodeType["MixinContent"] = 48] = "MixinContent"; NodeType[NodeType["Media"] = 49] = "Media"; NodeType[NodeType["Keyframe"] = 50] = "Keyframe"; NodeType[NodeType["FontFace"] = 51] = "FontFace"; NodeType[NodeType["Import"] = 52] = "Import"; NodeType[NodeType["Namespace"] = 53] = "Namespace"; NodeType[NodeType["Invocation"] = 54] = "Invocation"; NodeType[NodeType["FunctionDeclaration"] = 55] = "FunctionDeclaration"; NodeType[NodeType["ReturnStatement"] = 56] = "ReturnStatement"; NodeType[NodeType["MediaQuery"] = 57] = "MediaQuery"; NodeType[NodeType["FunctionParameter"] = 58] = "FunctionParameter"; NodeType[NodeType["FunctionArgument"] = 59] = "FunctionArgument"; NodeType[NodeType["KeyframeSelector"] = 60] = "KeyframeSelector"; NodeType[NodeType["ViewPort"] = 61] = "ViewPort"; NodeType[NodeType["Document"] = 62] = "Document"; NodeType[NodeType["AtApplyRule"] = 63] = "AtApplyRule"; NodeType[NodeType["CustomPropertyDeclaration"] = 64] = "CustomPropertyDeclaration"; NodeType[NodeType["CustomPropertySet"] = 65] = "CustomPropertySet"; NodeType[NodeType["ListEntry"] = 66] = "ListEntry"; NodeType[NodeType["Supports"] = 67] = "Supports"; NodeType[NodeType["SupportsCondition"] = 68] = "SupportsCondition"; NodeType[NodeType["NamespacePrefix"] = 69] = "NamespacePrefix"; NodeType[NodeType["GridLine"] = 70] = "GridLine"; NodeType[NodeType["Plugin"] = 71] = "Plugin"; NodeType[NodeType["UnknownAtRule"] = 72] = "UnknownAtRule"; })(NodeType = exports.NodeType || (exports.NodeType = {})); var ReferenceType; (function (ReferenceType) { ReferenceType[ReferenceType["Mixin"] = 0] = "Mixin"; ReferenceType[ReferenceType["Rule"] = 1] = "Rule"; ReferenceType[ReferenceType["Variable"] = 2] = "Variable"; ReferenceType[ReferenceType["Function"] = 3] = "Function"; ReferenceType[ReferenceType["Keyframe"] = 4] = "Keyframe"; ReferenceType[ReferenceType["Unknown"] = 5] = "Unknown"; })(ReferenceType = exports.ReferenceType || (exports.ReferenceType = {})); function getNodeAtOffset(node, offset) { var candidate = null; if (!node || offset < node.offset || offset > node.end) { return null; } // Find the shortest node at the position node.accept(function (node) { if (node.offset === -1 && node.length === -1) { return true; } if (node.offset <= offset && node.end >= offset) { if (!candidate) { candidate = node; } else if (node.length <= candidate.length) { candidate = node; } return true; } return false; }); return candidate; } exports.getNodeAtOffset = getNodeAtOffset; function getNodePath(node, offset) { var candidate = getNodeAtOffset(node, offset); var path = []; while (candidate) { path.unshift(candidate); candidate = candidate.parent; } return path; } exports.getNodePath = getNodePath; function getParentDeclaration(node) { var decl = node.findParent(NodeType.Declaration); if (decl && decl.getValue() && decl.getValue().encloses(node)) { return decl; } return null; } exports.getParentDeclaration = getParentDeclaration; var Node = /** @class */ (function () { function Node(offset, len, nodeType) { if (offset === void 0) { offset = -1; } if (len === void 0) { len = -1; } this.parent = null; this.offset = offset; this.length = len; if (nodeType) { this.nodeType = nodeType; } } Object.defineProperty(Node.prototype, "end", { get: function () { return this.offset + this.length; }, enumerable: true, configurable: true }); Object.defineProperty(Node.prototype, "type", { get: function () { return this.nodeType || NodeType.Undefined; }, set: function (type) { this.nodeType = type; }, enumerable: true, configurable: true }); Node.prototype.getTextProvider = function () { var node = this; while (node && !node.textProvider) { node = node.parent; } if (node) { return node.textProvider; } return function () { return 'unknown'; }; }; Node.prototype.getText = function () { return this.getTextProvider()(this.offset, this.length); }; Node.prototype.matches = function (str) { return this.length === str.length && this.getTextProvider()(this.offset, this.length) === str; }; Node.prototype.startsWith = function (str) { return this.length >= str.length && this.getTextProvider()(this.offset, str.length) === str; }; Node.prototype.endsWith = function (str) { return this.length >= str.length && this.getTextProvider()(this.end - str.length, str.length) === str; }; Node.prototype.accept = function (visitor) { if (visitor(this) && this.children) { for (var _i = 0, _a = this.children; _i < _a.length; _i++) { var child = _a[_i]; child.accept(visitor); } } }; Node.prototype.acceptVisitor = function (visitor) { this.accept(visitor.visitNode.bind(visitor)); }; Node.prototype.adoptChild = function (node, index) { if (index === void 0) { index = -1; } if (node.parent && node.parent.children) { var idx = node.parent.children.indexOf(node); if (idx >= 0) { node.parent.children.splice(idx, 1); } } node.parent = this; var children = this.children; if (!children) { children = this.children = []; } if (index !== -1) { children.splice(index, 0, node); } else { children.push(node); } return node; }; Node.prototype.attachTo = function (parent, index) { if (index === void 0) { index = -1; } if (parent) { parent.adoptChild(this, index); } return this; }; Node.prototype.collectIssues = function (results) { if (this.issues) { results.push.apply(results, this.issues); } }; Node.prototype.addIssue = function (issue) { if (!this.issues) { this.issues = []; } this.issues.push(issue); }; Node.prototype.hasIssue = function (rule) { return Array.isArray(this.issues) && this.issues.some(function (i) { return i.getRule() === rule; }); }; Node.prototype.isErroneous = function (recursive) { if (recursive === void 0) { recursive = false; } if (this.issues && this.issues.length > 0) { return true; } return recursive && Array.isArray(this.children) && this.children.some(function (c) { return c.isErroneous(true); }); }; Node.prototype.setNode = function (field, node, index) { if (index === void 0) { index = -1; } if (node) { node.attachTo(this, index); this[field] = node; return true; } return false; }; Node.prototype.addChild = function (node) { if (node) { if (!this.children) { this.children = []; } node.attachTo(this); this.updateOffsetAndLength(node); return true; } return false; }; Node.prototype.updateOffsetAndLength = function (node) { if (node.offset < this.offset || this.offset === -1) { this.offset = node.offset; } var nodeEnd = node.end; if ((nodeEnd > this.end) || this.length === -1) { this.length = nodeEnd - this.offset; } }; Node.prototype.hasChildren = function () { return this.children && this.children.length > 0; }; Node.prototype.getChildren = function () { return this.children ? this.children.slice(0) : []; }; Node.prototype.getChild = function (index) { if (this.children && index < this.children.length) { return this.children[index]; } return null; }; Node.prototype.addChildren = function (nodes) { for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { var node = nodes_1[_i]; this.addChild(node); } }; Node.prototype.findFirstChildBeforeOffset = function (offset) { if (this.children) { var current = null; for (var i = this.children.length - 1; i >= 0; i--) { // iterate until we find a child that has a start offset smaller than the input offset current = this.children[i]; if (current.offset <= offset) { return current; } } } return null; }; Node.prototype.findChildAtOffset = function (offset, goDeep) { var current = this.findFirstChildBeforeOffset(offset); if (current && current.end >= offset) { if (goDeep) { return current.findChildAtOffset(offset, true) || current; } return current; } return null; }; Node.prototype.encloses = function (candidate) { return this.offset <= candidate.offset && this.offset + this.length >= candidate.offset + candidate.length; }; Node.prototype.getParent = function () { var result = this.parent; while (result instanceof Nodelist) { result = result.parent; } return result; }; Node.prototype.findParent = function (type) { var result = this; while (result && result.type !== type) { result = result.parent; } return result; }; Node.prototype.findAParent = function () { var types = []; for (var _i = 0; _i < arguments.length; _i++) { types[_i] = arguments[_i]; } var result = this; while (result && !types.some(function (t) { return result.type === t; })) { result = result.parent; } return result; }; Node.prototype.setData = function (key, value) { if (!this.options) { this.options = {}; } this.options[key] = value; }; Node.prototype.getData = function (key) { if (!this.options || !this.options.hasOwnProperty(key)) { return null; } return this.options[key]; }; return Node; }()); exports.Node = Node; var Nodelist = /** @class */ (function (_super) { __extends(Nodelist, _super); function Nodelist(parent, index) { if (index === void 0) { index = -1; } var _this = _super.call(this, -1, -1) || this; _this.attachTo(parent, index); _this.offset = -1; _this.length = -1; return _this; } return Nodelist; }(Node)); exports.Nodelist = Nodelist; var Identifier = /** @class */ (function (_super) { __extends(Identifier, _super); function Identifier(offset, length) { var _this = _super.call(this, offset, length) || this; _this.isCustomProperty = false; return _this; } Object.defineProperty(Identifier.prototype, "type", { get: function () { return NodeType.Identifier; }, enumerable: true, configurable: true }); Identifier.prototype.containsInterpolation = function () { return this.hasChildren(); }; return Identifier; }(Node)); exports.Identifier = Identifier; var Stylesheet = /** @class */ (function (_super) { __extends(Stylesheet, _super); function Stylesheet(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Stylesheet.prototype, "type", { get: function () { return NodeType.Stylesheet; }, enumerable: true, configurable: true }); Stylesheet.prototype.setName = function (value) { this.name = value; }; return Stylesheet; }(Node)); exports.Stylesheet = Stylesheet; var Declarations = /** @class */ (function (_super) { __extends(Declarations, _super); function Declarations(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Declarations.prototype, "type", { get: function () { return NodeType.Declarations; }, enumerable: true, configurable: true }); return Declarations; }(Node)); exports.Declarations = Declarations; var BodyDeclaration = /** @class */ (function (_super) { __extends(BodyDeclaration, _super); function BodyDeclaration(offset, length) { return _super.call(this, offset, length) || this; } BodyDeclaration.prototype.getDeclarations = function () { return this.declarations; }; BodyDeclaration.prototype.setDeclarations = function (decls) { return this.setNode('declarations', decls); }; return BodyDeclaration; }(Node)); exports.BodyDeclaration = BodyDeclaration; var RuleSet = /** @class */ (function (_super) { __extends(RuleSet, _super); function RuleSet(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(RuleSet.prototype, "type", { get: function () { return NodeType.Ruleset; }, enumerable: true, configurable: true }); RuleSet.prototype.getSelectors = function () { if (!this.selectors) { this.selectors = new Nodelist(this); } return this.selectors; }; RuleSet.prototype.isNested = function () { return !!this.parent && this.parent.findParent(NodeType.Declarations) !== null; }; return RuleSet; }(BodyDeclaration)); exports.RuleSet = RuleSet; var Selector = /** @class */ (function (_super) { __extends(Selector, _super); function Selector(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Selector.prototype, "type", { get: function () { return NodeType.Selector; }, enumerable: true, configurable: true }); return Selector; }(Node)); exports.Selector = Selector; var SimpleSelector = /** @class */ (function (_super) { __extends(SimpleSelector, _super); function SimpleSelector(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(SimpleSelector.prototype, "type", { get: function () { return NodeType.SimpleSelector; }, enumerable: true, configurable: true }); return SimpleSelector; }(Node)); exports.SimpleSelector = SimpleSelector; var AtApplyRule = /** @class */ (function (_super) { __extends(AtApplyRule, _super); function AtApplyRule(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(AtApplyRule.prototype, "type", { get: function () { return NodeType.AtApplyRule; }, enumerable: true, configurable: true }); AtApplyRule.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; AtApplyRule.prototype.getIdentifier = function () { return this.identifier; }; AtApplyRule.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; return AtApplyRule; }(Node)); exports.AtApplyRule = AtApplyRule; var AbstractDeclaration = /** @class */ (function (_super) { __extends(AbstractDeclaration, _super); function AbstractDeclaration(offset, length) { return _super.call(this, offset, length) || this; } return AbstractDeclaration; }(Node)); exports.AbstractDeclaration = AbstractDeclaration; var CustomPropertyDeclaration = /** @class */ (function (_super) { __extends(CustomPropertyDeclaration, _super); function CustomPropertyDeclaration(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(CustomPropertyDeclaration.prototype, "type", { get: function () { return NodeType.CustomPropertyDeclaration; }, enumerable: true, configurable: true }); CustomPropertyDeclaration.prototype.setProperty = function (node) { return this.setNode('property', node); }; CustomPropertyDeclaration.prototype.getProperty = function () { return this.property; }; CustomPropertyDeclaration.prototype.setValue = function (value) { return this.setNode('value', value); }; CustomPropertyDeclaration.prototype.getValue = function () { return this.value; }; CustomPropertyDeclaration.prototype.setPropertySet = function (value) { return this.setNode('propertySet', value); }; CustomPropertyDeclaration.prototype.getPropertySet = function () { return this.propertySet; }; return CustomPropertyDeclaration; }(AbstractDeclaration)); exports.CustomPropertyDeclaration = CustomPropertyDeclaration; var CustomPropertySet = /** @class */ (function (_super) { __extends(CustomPropertySet, _super); function CustomPropertySet(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(CustomPropertySet.prototype, "type", { get: function () { return NodeType.CustomPropertySet; }, enumerable: true, configurable: true }); return CustomPropertySet; }(BodyDeclaration)); exports.CustomPropertySet = CustomPropertySet; var Declaration = /** @class */ (function (_super) { __extends(Declaration, _super); function Declaration(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Declaration.prototype, "type", { get: function () { return NodeType.Declaration; }, enumerable: true, configurable: true }); Declaration.prototype.setProperty = function (node) { return this.setNode('property', node); }; Declaration.prototype.getProperty = function () { return this.property; }; Declaration.prototype.getFullPropertyName = function () { var propertyName = this.property ? this.property.getName() : 'unknown'; if (this.parent instanceof Declarations && this.parent.getParent() instanceof NestedProperties) { var parentDecl = this.parent.getParent().getParent(); if (parentDecl instanceof Declaration) { return parentDecl.getFullPropertyName() + propertyName; } } return propertyName; }; Declaration.prototype.getNonPrefixedPropertyName = function () { var propertyName = this.getFullPropertyName(); if (propertyName && propertyName.charAt(0) === '-') { var vendorPrefixEnd = propertyName.indexOf('-', 1); if (vendorPrefixEnd !== -1) { return propertyName.substring(vendorPrefixEnd + 1); } } return propertyName; }; Declaration.prototype.setValue = function (value) { return this.setNode('value', value); }; Declaration.prototype.getValue = function () { return this.value; }; Declaration.prototype.setNestedProperties = function (value) { return this.setNode('nestedProperties', value); }; Declaration.prototype.getNestedProperties = function () { return this.nestedProperties; }; return Declaration; }(AbstractDeclaration)); exports.Declaration = Declaration; var Property = /** @class */ (function (_super) { __extends(Property, _super); function Property(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Property.prototype, "type", { get: function () { return NodeType.Property; }, enumerable: true, configurable: true }); Property.prototype.setIdentifier = function (value) { return this.setNode('identifier', value); }; Property.prototype.getIdentifier = function () { return this.identifier; }; Property.prototype.getName = function () { return this.getText(); }; Property.prototype.isCustomProperty = function () { return this.identifier.isCustomProperty; }; return Property; }(Node)); exports.Property = Property; var Invocation = /** @class */ (function (_super) { __extends(Invocation, _super); function Invocation(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Invocation.prototype, "type", { get: function () { return NodeType.Invocation; }, enumerable: true, configurable: true }); Invocation.prototype.getArguments = function () { if (!this.arguments) { this.arguments = new Nodelist(this); } return this.arguments; }; return Invocation; }(Node)); exports.Invocation = Invocation; var Function = /** @class */ (function (_super) { __extends(Function, _super); function Function(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Function.prototype, "type", { get: function () { return NodeType.Function; }, enumerable: true, configurable: true }); Function.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; Function.prototype.getIdentifier = function () { return this.identifier; }; Function.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; return Function; }(Invocation)); exports.Function = Function; var FunctionParameter = /** @class */ (function (_super) { __extends(FunctionParameter, _super); function FunctionParameter(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(FunctionParameter.prototype, "type", { get: function () { return NodeType.FunctionParameter; }, enumerable: true, configurable: true }); FunctionParameter.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; FunctionParameter.prototype.getIdentifier = function () { return this.identifier; }; FunctionParameter.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; FunctionParameter.prototype.setDefaultValue = function (node) { return this.setNode('defaultValue', node, 0); }; FunctionParameter.prototype.getDefaultValue = function () { return this.defaultValue; }; return FunctionParameter; }(Node)); exports.FunctionParameter = FunctionParameter; var FunctionArgument = /** @class */ (function (_super) { __extends(FunctionArgument, _super); function FunctionArgument(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(FunctionArgument.prototype, "type", { get: function () { return NodeType.FunctionArgument; }, enumerable: true, configurable: true }); FunctionArgument.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; FunctionArgument.prototype.getIdentifier = function () { return this.identifier; }; FunctionArgument.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; FunctionArgument.prototype.setValue = function (node) { return this.setNode('value', node, 0); }; FunctionArgument.prototype.getValue = function () { return this.value; }; return FunctionArgument; }(Node)); exports.FunctionArgument = FunctionArgument; var IfStatement = /** @class */ (function (_super) { __extends(IfStatement, _super); function IfStatement(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(IfStatement.prototype, "type", { get: function () { return NodeType.If; }, enumerable: true, configurable: true }); IfStatement.prototype.setExpression = function (node) { return this.setNode('expression', node, 0); }; IfStatement.prototype.setElseClause = function (elseClause) { return this.setNode('elseClause', elseClause); }; return IfStatement; }(BodyDeclaration)); exports.IfStatement = IfStatement; var ForStatement = /** @class */ (function (_super) { __extends(ForStatement, _super); function ForStatement(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(ForStatement.prototype, "type", { get: function () { return NodeType.For; }, enumerable: true, configurable: true }); ForStatement.prototype.setVariable = function (node) { return this.setNode('variable', node, 0); }; return ForStatement; }(BodyDeclaration)); exports.ForStatement = ForStatement; var EachStatement = /** @class */ (function (_super) { __extends(EachStatement, _super); function EachStatement(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(EachStatement.prototype, "type", { get: function () { return NodeType.Each; }, enumerable: true, configurable: true }); EachStatement.prototype.getVariables = function () { if (!this.variables) { this.variables = new Nodelist(this); } return this.variables; }; return EachStatement; }(BodyDeclaration)); exports.EachStatement = EachStatement; var WhileStatement = /** @class */ (function (_super) { __extends(WhileStatement, _super); function WhileStatement(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(WhileStatement.prototype, "type", { get: function () { return NodeType.While; }, enumerable: true, configurable: true }); return WhileStatement; }(BodyDeclaration)); exports.WhileStatement = WhileStatement; var ElseStatement = /** @class */ (function (_super) { __extends(ElseStatement, _super); function ElseStatement(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(ElseStatement.prototype, "type", { get: function () { return NodeType.Else; }, enumerable: true, configurable: true }); return ElseStatement; }(BodyDeclaration)); exports.ElseStatement = ElseStatement; var FunctionDeclaration = /** @class */ (function (_super) { __extends(FunctionDeclaration, _super); function FunctionDeclaration(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(FunctionDeclaration.prototype, "type", { get: function () { return NodeType.FunctionDeclaration; }, enumerable: true, configurable: true }); FunctionDeclaration.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; FunctionDeclaration.prototype.getIdentifier = function () { return this.identifier; }; FunctionDeclaration.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; FunctionDeclaration.prototype.getParameters = function () { if (!this.parameters) { this.parameters = new Nodelist(this); } return this.parameters; }; return FunctionDeclaration; }(BodyDeclaration)); exports.FunctionDeclaration = FunctionDeclaration; var ViewPort = /** @class */ (function (_super) { __extends(ViewPort, _super); function ViewPort(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(ViewPort.prototype, "type", { get: function () { return NodeType.ViewPort; }, enumerable: true, configurable: true }); return ViewPort; }(BodyDeclaration)); exports.ViewPort = ViewPort; var FontFace = /** @class */ (function (_super) { __extends(FontFace, _super); function FontFace(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(FontFace.prototype, "type", { get: function () { return NodeType.FontFace; }, enumerable: true, configurable: true }); return FontFace; }(BodyDeclaration)); exports.FontFace = FontFace; var NestedProperties = /** @class */ (function (_super) { __extends(NestedProperties, _super); function NestedProperties(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(NestedProperties.prototype, "type", { get: function () { return NodeType.NestedProperties; }, enumerable: true, configurable: true }); return NestedProperties; }(BodyDeclaration)); exports.NestedProperties = NestedProperties; var Keyframe = /** @class */ (function (_super) { __extends(Keyframe, _super); function Keyframe(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Keyframe.prototype, "type", { get: function () { return NodeType.Keyframe; }, enumerable: true, configurable: true }); Keyframe.prototype.setKeyword = function (keyword) { return this.setNode('keyword', keyword, 0); }; Keyframe.prototype.getKeyword = function () { return this.keyword; }; Keyframe.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; Keyframe.prototype.getIdentifier = function () { return this.identifier; }; Keyframe.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; return Keyframe; }(BodyDeclaration)); exports.Keyframe = Keyframe; var KeyframeSelector = /** @class */ (function (_super) { __extends(KeyframeSelector, _super); function KeyframeSelector(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(KeyframeSelector.prototype, "type", { get: function () { return NodeType.KeyframeSelector; }, enumerable: true, configurable: true }); return KeyframeSelector; }(BodyDeclaration)); exports.KeyframeSelector = KeyframeSelector; var Import = /** @class */ (function (_super) { __extends(Import, _super); function Import(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Import.prototype, "type", { get: function () { return NodeType.Import; }, enumerable: true, configurable: true }); Import.prototype.setMedialist = function (node) { if (node) { node.attachTo(this); this.medialist = node; return true; } return false; }; return Import; }(Node)); exports.Import = Import; var Namespace = /** @class */ (function (_super) { __extends(Namespace, _super); function Namespace(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Namespace.prototype, "type", { get: function () { return NodeType.Namespace; }, enumerable: true, configurable: true }); return Namespace; }(Node)); exports.Namespace = Namespace; var Media = /** @class */ (function (_super) { __extends(Media, _super); function Media(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Media.prototype, "type", { get: function () { return NodeType.Media; }, enumerable: true, configurable: true }); return Media; }(BodyDeclaration)); exports.Media = Media; var Supports = /** @class */ (function (_super) { __extends(Supports, _super); function Supports(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Supports.prototype, "type", { get: function () { return NodeType.Supports; }, enumerable: true, configurable: true }); return Supports; }(BodyDeclaration)); exports.Supports = Supports; var Document = /** @class */ (function (_super) { __extends(Document, _super); function Document(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Document.prototype, "type", { get: function () { return NodeType.Document; }, enumerable: true, configurable: true }); return Document; }(BodyDeclaration)); exports.Document = Document; var Medialist = /** @class */ (function (_super) { __extends(Medialist, _super); function Medialist(offset, length) { return _super.call(this, offset, length) || this; } Medialist.prototype.getMediums = function () { if (!this.mediums) { this.mediums = new Nodelist(this); } return this.mediums; }; return Medialist; }(Node)); exports.Medialist = Medialist; var MediaQuery = /** @class */ (function (_super) { __extends(MediaQuery, _super); function MediaQuery(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(MediaQuery.prototype, "type", { get: function () { return NodeType.MediaQuery; }, enumerable: true, configurable: true }); return MediaQuery; }(Node)); exports.MediaQuery = MediaQuery; var SupportsCondition = /** @class */ (function (_super) { __extends(SupportsCondition, _super); function SupportsCondition(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(SupportsCondition.prototype, "type", { get: function () { return NodeType.SupportsCondition; }, enumerable: true, configurable: true }); return SupportsCondition; }(Node)); exports.SupportsCondition = SupportsCondition; var Page = /** @class */ (function (_super) { __extends(Page, _super); function Page(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Page.prototype, "type", { get: function () { return NodeType.Page; }, enumerable: true, configurable: true }); return Page; }(BodyDeclaration)); exports.Page = Page; var PageBoxMarginBox = /** @class */ (function (_super) { __extends(PageBoxMarginBox, _super); function PageBoxMarginBox(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(PageBoxMarginBox.prototype, "type", { get: function () { return NodeType.PageBoxMarginBox; }, enumerable: true, configurable: true }); return PageBoxMarginBox; }(BodyDeclaration)); exports.PageBoxMarginBox = PageBoxMarginBox; var Expression = /** @class */ (function (_super) { __extends(Expression, _super); function Expression(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Expression.prototype, "type", { get: function () { return NodeType.Expression; }, enumerable: true, configurable: true }); return Expression; }(Node)); exports.Expression = Expression; var BinaryExpression = /** @class */ (function (_super) { __extends(BinaryExpression, _super); function BinaryExpression(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(BinaryExpression.prototype, "type", { get: function () { return NodeType.BinaryExpression; }, enumerable: true, configurable: true }); BinaryExpression.prototype.setLeft = function (left) { return this.setNode('left', left); }; BinaryExpression.prototype.getLeft = function () { return this.left; }; BinaryExpression.prototype.setRight = function (right) { return this.setNode('right', right); }; BinaryExpression.prototype.getRight = function () { return this.right; }; BinaryExpression.prototype.setOperator = function (value) { return this.setNode('operator', value); }; BinaryExpression.prototype.getOperator = function () { return this.operator; }; return BinaryExpression; }(Node)); exports.BinaryExpression = BinaryExpression; var Term = /** @class */ (function (_super) { __extends(Term, _super); function Term(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Term.prototype, "type", { get: function () { return NodeType.Term; }, enumerable: true, configurable: true }); Term.prototype.setOperator = function (value) { return this.setNode('operator', value); }; Term.prototype.getOperator = function () { return this.operator; }; Term.prototype.setExpression = function (value) { return this.setNode('expression', value); }; Term.prototype.getExpression = function () { return this.expression; }; return Term; }(Node)); exports.Term = Term; var AttributeSelector = /** @class */ (function (_super) { __extends(AttributeSelector, _super); function AttributeSelector(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(AttributeSelector.prototype, "type", { get: function () { return NodeType.AttributeSelector; }, enumerable: true, configurable: true }); AttributeSelector.prototype.setNamespacePrefix = function (value) { return this.setNode('namespacePrefix', value); }; AttributeSelector.prototype.getNamespacePrefix = function () { return this.namespacePrefix; }; AttributeSelector.prototype.setIdentifier = function (value) { return this.setNode('identifier', value); }; AttributeSelector.prototype.getIdentifier = function () { return this.identifier; }; AttributeSelector.prototype.setOperator = function (operator) { return this.setNode('operator', operator); }; AttributeSelector.prototype.getOperator = function () { return this.operator; }; AttributeSelector.prototype.setValue = function (value) { return this.setNode('value', value); }; AttributeSelector.prototype.getValue = function () { return this.value; }; return AttributeSelector; }(Node)); exports.AttributeSelector = AttributeSelector; var Operator = /** @class */ (function (_super) { __extends(Operator, _super); function Operator(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Operator.prototype, "type", { get: function () { return NodeType.Operator; }, enumerable: true, configurable: true }); return Operator; }(Node)); exports.Operator = Operator; var HexColorValue = /** @class */ (function (_super) { __extends(HexColorValue, _super); function HexColorValue(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(HexColorValue.prototype, "type", { get: function () { return NodeType.HexColorValue; }, enumerable: true, configurable: true }); return HexColorValue; }(Node)); exports.HexColorValue = HexColorValue; var _dot = '.'.charCodeAt(0), _0 = '0'.charCodeAt(0), _9 = '9'.charCodeAt(0); var NumericValue = /** @class */ (function (_super) { __extends(NumericValue, _super); function NumericValue(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(NumericValue.prototype, "type", { get: function () { return NodeType.NumericValue; }, enumerable: true, configurable: true }); NumericValue.prototype.getValue = function () { var raw = this.getText(); var unitIdx = 0; var code; for (var i = 0, len = raw.length; i < len; i++) { code = raw.charCodeAt(i); if (!(_0 <= code && code <= _9 || code === _dot)) { break; } unitIdx += 1; } return { value: raw.substring(0, unitIdx), unit: unitIdx < raw.length ? raw.substring(unitIdx) : undefined }; }; return NumericValue; }(Node)); exports.NumericValue = NumericValue; var VariableDeclaration = /** @class */ (function (_super) { __extends(VariableDeclaration, _super); function VariableDeclaration(offset, length) { var _this = _super.call(this, offset, length) || this; _this.needsSemicolon = true; return _this; } Object.defineProperty(VariableDeclaration.prototype, "type", { get: function () { return NodeType.VariableDeclaration; }, enumerable: true, configurable: true }); VariableDeclaration.prototype.setVariable = function (node) { if (node) { node.attachTo(this); this.variable = node; return true; } return false; }; VariableDeclaration.prototype.getVariable = function () { return this.variable; }; VariableDeclaration.prototype.getName = function () { return this.variable ? this.variable.getName() : ''; }; VariableDeclaration.prototype.setValue = function (node) { if (node) { node.attachTo(this); this.value = node; return true; } return false; }; VariableDeclaration.prototype.getValue = function () { return this.value; }; return VariableDeclaration; }(AbstractDeclaration)); exports.VariableDeclaration = VariableDeclaration; var Interpolation = /** @class */ (function (_super) { __extends(Interpolation, _super); function Interpolation(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Interpolation.prototype, "type", { get: function () { return NodeType.Interpolation; }, enumerable: true, configurable: true }); return Interpolation; }(Node)); exports.Interpolation = Interpolation; var Variable = /** @class */ (function (_super) { __extends(Variable, _super); function Variable(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(Variable.prototype, "type", { get: function () { return NodeType.VariableName; }, enumerable: true, configurable: true }); Variable.prototype.getName = function () { return this.getText(); }; return Variable; }(Node)); exports.Variable = Variable; var ExtendsReference = /** @class */ (function (_super) { __extends(ExtendsReference, _super); function ExtendsReference(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(ExtendsReference.prototype, "type", { get: function () { return NodeType.ExtendsReference; }, enumerable: true, configurable: true }); ExtendsReference.prototype.getSelectors = function () { if (!this.selectors) { this.selectors = new Nodelist(this); } return this.selectors; }; return ExtendsReference; }(Node)); exports.ExtendsReference = ExtendsReference; var MixinReference = /** @class */ (function (_super) { __extends(MixinReference, _super); function MixinReference(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(MixinReference.prototype, "type", { get: function () { return NodeType.MixinReference; }, enumerable: true, configurable: true }); MixinReference.prototype.getNamespaces = function () { if (!this.namespaces) { this.namespaces = new Nodelist(this); } return this.namespaces; }; MixinReference.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; MixinReference.prototype.getIdentifier = function () { return this.identifier; }; MixinReference.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; MixinReference.prototype.getArguments = function () { if (!this.arguments) { this.arguments = new Nodelist(this); } return this.arguments; }; MixinReference.prototype.setContent = function (node) { return this.setNode('content', node); }; MixinReference.prototype.getContent = function () { return this.content; }; return MixinReference; }(Node)); exports.MixinReference = MixinReference; var MixinDeclaration = /** @class */ (function (_super) { __extends(MixinDeclaration, _super); function MixinDeclaration(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(MixinDeclaration.prototype, "type", { get: function () { return NodeType.MixinDeclaration; }, enumerable: true, configurable: true }); MixinDeclaration.prototype.setIdentifier = function (node) { return this.setNode('identifier', node, 0); }; MixinDeclaration.prototype.getIdentifier = function () { return this.identifier; }; MixinDeclaration.prototype.getName = function () { return this.identifier ? this.identifier.getText() : ''; }; MixinDeclaration.prototype.getParameters = function () { if (!this.parameters) { this.parameters = new Nodelist(this); } return this.parameters; }; MixinDeclaration.prototype.setGuard = function (node) { if (node) { node.attachTo(this); this.guard = node; } return false; }; return MixinDeclaration; }(BodyDeclaration)); exports.MixinDeclaration = MixinDeclaration; var UnknownAtRule = /** @class */ (function (_super) { __extends(UnknownAtRule, _super); function UnknownAtRule(offset, length) { return _super.call(this, offset, length) || this; } Object.defineProperty(UnknownAtRule.prototype, "type", { get: function () { return NodeType.UnknownAtRule; }, enumerable: true, configurable: true }); UnknownAtRule.prototype.setAtRuleName = function (atRuleName) { this.atRuleName = atRuleName; }; UnknownAtRule.prototype.getAtRuleName = function (atRuleName) { return this.atRuleName; }; return UnknownAtRule; }(BodyDeclaration)); exports.UnknownAtRule = UnknownAtRule; var ListEntry = /** @class */ (function (_super) { __extends(ListEntry, _super); function ListEntry() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(ListEntry.prototype, "type", { get: function () { return NodeType.ListEntry; }, enumerable: true, configurable: true }); ListEntry.prototype.setKey = function (node) { return this.setNode('key', node, 0); }; ListEntry.prototype.setValue = function (node) { return this.setNode('value', node, 1); }; return ListEntry; }(Node)); exports.ListEntry = ListEntry; var LessGuard = /** @class */ (function (_super) { __extends(LessGuard, _super); function LessGuard() { return _super !== null && _super.apply(this, arguments) || this; } LessGuard.prototype.getConditions = function () { if (!this.conditions) { this.conditions = new Nodelist(this); } return this.conditions; }; return LessGuard; }(Node)); exports.LessGuard = LessGuard; var GuardCondition = /** @class */ (function (_super) { __extends(GuardCondition, _super); function GuardCondition() { return _super !== null && _super.apply(this, arguments) || this; } GuardCondition.prototype.setVariable = function (node) { return this.setNode('variable', node); }; return GuardCondition; }(Node)); exports.GuardCondition = GuardCondition; var Level; (function (Level) { Level[Level["Ignore"] = 1] = "Ignore"; Level[Level["Warning"] = 2] = "Warning"; Level[Level["Error"] = 4] = "Error"; })(Level = exports.Level || (exports.Level = {})); var Marker = /** @class */ (function () { function Marker(node, rule, level, message, offset, length) { if (offset === void 0) { offset = node.offset; } if (length === void 0) { length = node.length; } this.node = node; this.rule = rule; this.level = level; this.message = message || rule.message; this.offset = offset; this.length = length; } Marker.prototype.getRule = function () { return this.rule; }; Marker.prototype.getLevel = function () { return this.level; }; Marker.prototype.getOffset = function () { return this.offset; }; Marker.prototype.getLength = function () { return this.length; }; Marker.prototype.getNode = function () { return this.node; }; Marker.prototype.getMessage = function () { return this.message; }; return Marker; }()); exports.Marker = Marker; /* export class DefaultVisitor implements IVisitor { public visitNode(node:Node):boolean { switch (node.type) { case NodeType.Stylesheet: return this.visitStylesheet( node); case NodeType.FontFace: return this.visitFontFace( node); case NodeType.Ruleset: return this.visitRuleSet( node); case NodeType.Selector: return this.visitSelector( node); case NodeType.SimpleSelector: return this.visitSimpleSelector( node); case NodeType.Declaration: return this.visitDeclaration( node); case NodeType.Function: return this.visitFunction( node); case NodeType.FunctionDeclaration: return this.visitFunctionDeclaration( node); case NodeType.FunctionParameter: return this.visitFunctionParameter( node); case NodeType.FunctionArgument: return this.visitFunctionArgument( node); case NodeType.Term: return this.visitTerm( node); case NodeType.Declaration: return this.visitExpression( node); case NodeType.NumericValue: return this.visitNumericValue( node); case NodeType.Page: return this.visitPage( node); case NodeType.PageBoxMarginBox: return this.visitPageBoxMarginBox( node); case NodeType.Property: return this.visitProperty( node); case NodeType.NumericValue: return this.visitNodelist( node); case NodeType.Import: return this.visitImport( node); case NodeType.Namespace: return this.visitNamespace( node); case NodeType.Keyframe: return this.visitKeyframe( node); case NodeType.KeyframeSelector: return this.visitKeyframeSelector( node); case NodeType.MixinDeclaration: return this.visitMixinDeclaration( node); case NodeType.MixinReference: return this.visitMixinReference( node); case NodeType.Variable: return this.visitVariable( node); case NodeType.VariableDeclaration: return this.visitVariableDeclaration( node); } return this.visitUnknownNode(node); } public visitFontFace(node:FontFace):boolean { return true; } public visitKeyframe(node:Keyframe):boolean { return true; } public visitKeyframeSelector(node:KeyframeSelector):boolean { return true; } public visitStylesheet(node:Stylesheet):boolean { return true; } public visitProperty(Node:Property):boolean { return true; } public visitRuleSet(node:RuleSet):boolean { return true; } public visitSelector(node:Selector):boolean { return true; } public visitSimpleSelector(node:SimpleSelector):boolean { return true; } public visitDeclaration(node:Declaration):boolean { return true; } public visitFunction(node:Function):boolean { return true; } public visitFunctionDeclaration(node:FunctionDeclaration):boolean { return true; } public visitInvocation(node:Invocation):boolean { return true; } public visitTerm(node:Term):boolean { return true; } public visitImport(node:Import):boolean { return true; } public visitNamespace(node:Namespace):boolean { return true; } public visitExpression(node:Expression):boolean { return true; } public visitNumericValue(node:NumericValue):boolean { return true; } public visitPage(node:Page):boolean { return true; } public visitPageBoxMarginBox(node:PageBoxMarginBox):boolean { return true; } public visitNodelist(node:Nodelist):boolean { return true; } public visitVariableDeclaration(node:VariableDeclaration):boolean { return true; } public visitVariable(node:Variable):boolean { return true; } public visitMixinDeclaration(node:MixinDeclaration):boolean { return true; } public visitMixinReference(node:MixinReference):boolean { return true; } public visitUnknownNode(node:Node):boolean { return true; } } */ var ParseErrorCollector = /** @class */ (function () { function ParseErrorCollector() { this.entries = []; } ParseErrorCollector.entries = function (node) { var visitor = new ParseErrorCollector(); node.acceptVisitor(visitor); return visitor.entries; }; ParseErrorCollector.prototype.visitNode = function (node) { if (node.isErroneous()) { node.collectIssues(this.entries); } return true; }; return ParseErrorCollector; }()); exports.ParseErrorCollector = ParseErrorCollector; }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ define('vscode-nls/vscode-nls',["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function format(message, args) { var result; if (args.length === 0) { result = message; } else { result = message.replace(/\{(\d+)\}/g, function (match, rest) { var index = rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; }); } return result; } function localize(key, message) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return format(message, args); } function loadMessageBundle(file) { return localize; } exports.loadMessageBundle = loadMessageBundle; function config(opt) { return loadMessageBundle; } exports.config = config; }); define('vscode-nls', ['vscode-nls/vscode-nls'], function (main) { return main; }); (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define('vscode-css-languageservice/parser/cssErrors',["require", "exports", "vscode-nls"], factory); } })(function (require, exports) { /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var nls = require("vscode-nls"); var localize = nls.loadMessageBundle(); var CSSIssueType = /** @class */ (function () { function CSSIssueType(id, message) { this.id = id; this.message = message; } return CSSIssueType; }()); exports.CSSIssueType = CSSIssueType; exports.ParseError = { NumberExpected: new CSSIssueType('css-numberexpected', localize('expected.number', "number expected")), ConditionExpected: new CSSIssueType('css-conditionexpected', localize('expected.condt', "condition expected")), RuleOrSelectorExpected: new CSSIssueType('css-ruleorselectorexpected', localize('expected.ruleorselector', "at-rule or selector expected")), DotExpected: new CSSIssueType('css-dotexpected', localize('expected.dot', "dot expected")), ColonExpected: new CSSIssueType('css-colonexpected', localize('expected.colon', "colon expected")), SemiColonExpected: new CSSIssueType('css-semicolonexpected', localize('expected.semicolon', "semi-colon expected")), TermExpected: new CSSIssueType('css-termexpected', localize('expected.term', "term expected")), ExpressionExpected: new CSSIssueType('css-expressionexpected', localize('expected.expression', "expression expected")), OperatorExpected: new CSSIssueType('css-operatorexpected', localize('expected.operator', "operator expected")), IdentifierExpected: new CSSIssueType('css-identifierexpected', localize('expected.ident', "identifier expected")), PercentageExpected: new CSSIssueType('css-percentageexpected', localize('expected.percentage', "percentage expected")), URIOrStringExpected: new CSSIssueType('css-uriorstringexpected', localize('expected.uriorstring', "uri or string expected")), URIExpected: new CSSIssueType('css-uriexpected', localize('expected.uri', "URI expected")), VariableNameExpected: new CSSIssueType('css-varnameexpected', localize('expected.varname', "variable name expected")), VariableValueExpected: new CSSIssueType('css-varvalueexpected', localize('expected.varvalue', "variable value expected")), PropertyValueExpected: new CSSIssueType('css-propertyvalueexpected', localize('expected.propvalue', "property value expected")), LeftCurlyExpected: new CSSIssueType('css-lcurlyexpected', localize('expected.lcurly', "{ expected")), RightCurlyExpected: new CSSIssueType('css-rcurlyexpected', localize('expected.rcurly', "} expected")), LeftSquareBracketExpected: new CSSIssueType('css-rbracketexpected', localize('expected.lsquare', "[ expected")), RightSquareBracketExpected: new CSSIssueType('css-lbracketexpected', localize('expected.rsquare', "] expected")), LeftParenthesisExpected: new CSSIssueType('css-lparentexpected', localize('expected.lparen', "( expected")), RightParenthesisExpected: new CSSIssueType('css-rparentexpected', localize('expected.rparent', ") expected")), CommaExpected: new CSSIssueType('css-commaexpected', localize('expected.comma', "comma expected")), PageDirectiveOrDeclarationExpected: new CSSIssueType('css-pagedirordeclexpected', localize('expected.pagedirordecl', "page directive or declaraton expected")), UnknownAtRule: new CSSIssueType('css-unknownatrule', localize('unknown.atrule', "at-rule unknown")), UnknownKeyword: new CSSIssueType('css-unknownkeyword', localize('unknown.keyword', "unknown keyword")), SelectorExpected: new CSSIssueType('css-selectorexpected', localize('expected.selector', "selector expected")), StringLiteralExpected: new CSSIssueType('css-stringliteralexpected', localize('expected.stringliteral', "string literal expected")), WhitespaceExpected: new CSSIssueType('css-whitespaceexpected', localize('expected.whitespace', "whitespace expected")), MediaQueryExpected: new CSSIssueType('css-mediaqueryexpected', localize('expected.mediaquery', "media query expected")) }; }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // file generated from css-schema.xml and https://github.com/mdn/data using build/generate_browserjs.js (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define('vscode-css-languageservice/data/browsers',["require", "exports"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cssData = { "version": 1, "properties": [ { name: "additive-symbols", browsers: [ "FF33" ], "syntax": "[ && ]#", "description": "@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.", "restrictions": [ "integer", "string", "image", "identifier" ] }, { name: "align-content", values: [ { name: "center", "description": "Lines are packed toward the center of the flex container." }, { name: "flex-end", "description": "Lines are packed toward the end of the flex container." }, { name: "flex-start", "description": "Lines are packed toward the start of the flex container." }, { name: "space-around", "description": "Lines are evenly distributed in the flex container, with half-size spaces on either end." }, { name: "space-between", "description": "Lines are evenly distributed in the flex container." }, { name: "stretch", "description": "Lines stretch to take up the remaining space." } ], "syntax": "normal | | | ? ", "description": "Aligns a flex container’s lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.", "restrictions": [ "enum" ] }, { name: "align-items", values: [ { name: "baseline", "description": "If the flex item’s inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment." }, { name: "center", "description": "The flex item’s margin box is centered in the cross axis within the line." }, { name: "flex-end", "description": "The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line." }, { name: "flex-start", "description": "The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line." }, { name: "stretch", "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." } ], "syntax": "normal | stretch | | [ ? ]", "description": "Aligns flex items along the cross axis of the current line of the flex container.", "restrictions": [ "enum" ] }, { name: "justify-items", values: [ { name: "auto" }, { name: "normal" }, { name: "end" }, { name: "start" }, { name: "flex-end", "description": "\"Flex items are packed toward the end of the line.\"" }, { name: "flex-start", "description": "\"Flex items are packed toward the start of the line.\"" }, { name: "self-end" }, { name: "self-start" }, { name: "center", "description": "The items are packed flush to each other toward the center of the of the alignment container." }, { name: "left" }, { name: "right" }, { name: "baseline" }, { name: "first baseline" }, { name: "last baseline" }, { name: "stretch", "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." }, { name: "save" }, { name: "unsave" }, { name: "legacy" } ], "syntax": "normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ]", "description": "Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis", "restrictions": [ "enum" ] }, { name: "justify-self", browsers: [ "E16", "FF45", "S10.1", "C57", "O44" ], values: [ { name: "auto" }, { name: "normal" }, { name: "end" }, { name: "start" }, { name: "flex-end", "description": "\"Flex items are packed toward the end of the line.\"" }, { name: "flex-start", "description": "\"Flex items are packed toward the start of the line.\"" }, { name: "self-end" }, { name: "self-start" }, { name: "center", "description": "The items are packed flush to each other toward the center of the of the alignment container." }, { name: "left" }, { name: "right" }, { name: "baseline" }, { name: "first baseline" }, { name: "last baseline" }, { name: "stretch", "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." }, { name: "save" }, { name: "unsave" } ], "syntax": "auto | normal | stretch | | ? [ | left | right ]", "description": "Defines the way of justifying a box inside its container along the appropriate axis.", "restrictions": [ "enum" ] }, { name: "align-self", values: [ { name: "auto", "description": "Computes to the value of 'align-items' on the element’s parent, or 'stretch' if the element has no parent. On absolutely positioned elements, it computes to itself." }, { name: "baseline", "description": "If the flex item’s inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment." }, { name: "center", "description": "The flex item’s margin box is centered in the cross axis within the line." }, { name: "flex-end", "description": "The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line." }, { name: "flex-start", "description": "The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line." }, { name: "stretch", "description": "If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched." } ], "syntax": "auto | normal | stretch | | ? ", "description": "Allows the default alignment along the cross axis to be overridden for individual flex items.", "restrictions": [ "enum" ] }, { name: "all", browsers: [ "FF27", "S9.1", "C37", "O24" ], values: [], "syntax": "initial | inherit | unset | revert", "description": "Shorthand that resets all properties except 'direction' and 'unicode-bidi'.", "restrictions": [ "enum" ] }, { name: "alt", browsers: [ "S9" ], values: [], "description": "Provides alternative text for assistive technology to replace the generated content of a ::before or ::after element.", "restrictions": [ "string", "enum" ] }, { name: "animation", values: [ { name: "alternate" }, { name: "alternate-reverse" }, { name: "backwards" }, { name: "both", "description": "Both forwards and backwards fill modes are applied." }, { name: "forwards" }, { name: "infinite", "description": "Causes the animation to repeat forever." }, { name: "none", "description": "No animation is performed" }, { name: "normal", "description": "Normal playback." }, { name: "reverse", "description": "All iterations of the animation are played in the reverse direction from the way they were specified." } ], "syntax": "#", "description": "Shorthand property combines six of the animation properties into a single property.", "restrictions": [ "time", "timing-function", "enum", "identifier", "number" ] }, { name: "animation-delay", "syntax": "