Changelog
1.0.0-alpha.37 (October 22, 2019)
source-map
version to ^0.6.1
to fix source map generation inconsistency across node.js versions due to mappings sorting bug and v8 moving to a stable Array#sort (fix commit in source-map
)Changelog
1.0.0-alpha.36 (October 13, 2019)
npm audit
issues)dist/csstree.js
and dist/csstree.min.js
now (instead of single dist/csstree.js
that was a min version)grammar
into definitionSyntax
(named per spec)compact
option to generate()
method to avoid formatting (spaces) when possibledump()
method to produce syntaxes in compact form by defaultChangelog
1.0.0-alpha.35 (October 7, 2019)
find()
, findLast()
and findAll()
methods (e.g. csstree.find(ast, node => node.type === 'ClassSelector')
)Changelog
1.0.0-alpha.34 (July 27, 2019)
isBOM()
functioncharCodeCategory()
functionfirstCharOffset()
function (use isBOM()
instead)CHARCODE
dictionaryINPUT_STREAM_CODE*
dictionariesdebugger
(#104)Changelog
1.0.0-alpha.33 (July 11, 2019)
Changelog
1.0.0-alpha.32 (July 11, 2019)
||-
and &&-
groups (#103)Changelog
1.0.0-alpha.31 (July 11, 2019)
mdn/data
to 2.0.4
(#99)<number-zero-one>
, <number-one-or-greater>
and <positive-integer>
from generic types. In fact, types moved to patch, because those types can be expressed in a regular grammar due to bracketed range notation implemented<custom-ident>
production matching to claim the keyword only if no other unfulfilled production can claim it (#101)<length>
production matching to claim "unitless zero" only if no other unfulfilled production can claim it||
- and &&
-group matching, matching continues from the beginning on term match (#85)var()
occurrences when value is a string (such values can't be matched on syntax currently and fail with specific error that can be used for ignorance in validation tools)<declaration-value>
and <any-value>
matching when a value contains a function, parentheses or bracesChangelog
1.0.0-alpha.30 (July 3, 2019)
mdn/data
to ~2.0.3
mdn/data
due to lack of some generic types and specific lexer restictions (since lexer was reworked, see below)Tokenizer
class splitted into several abstractions:
TokenStream
classOffsetToLocation
classtokenize()
function that creates TokenStream
instance for given string or updates a TokenStream
instance passed as second parameterTokenizer
classRaw
token typeIdentifier
token type to Ident
Hash
, BadString
, BadUrl
, Delim
, Percentage
, Dimension
, Colon
, Semicolon
, Comma
, LeftSquareBracket
, RightSquareBracket
, LeftParenthesis
, RightParenthesis
, LeftCurlyBracket
, RightCurlyBracket
Punctuator
with Delim
token type, that excludes specific characters with its own token type like Colon
, Semicolon
etcfindCommentEnd
, findStringEnd
, findDecimalNumberEnd
, findNumberEnd
, findEscapeEnd
, findIdentifierEnd
and findUrlRawEnd
helper functionSYMBOL_TYPE
, PUNCTUATION
and STOP_URL_RAW
dictionariesisDigit
, isHexDigit
, isUppercaseLetter
, isLowercaseLetter
, isLetter
, isNonAscii
, isNameStart
, isName
, isNonPrintable
, isNewline
, isWhiteSpace
, isValidEscape
, isIdentifierStart
, isNumberStart
, consumeEscaped
, consumeName
, consumeNumber
and consumeBadUrlRemnants
helper functionsHexColor
consumption in way to relax checking a value, i.e. now value
is a sequence of one or more name chars&
as a property hackvar()
parsing to only check that a first arguments is an identifier (not a custom property name as before)Lexer#match()
, Lexer#matchType()
and Lexer#matchProperty()
methods to take a string as value, beside AST as a valueLexer#match()
method to take a string as a syntax, beside of syntax descriptor<attr()>
, <url>
(moved to patch) and <progid>
types<ident-token>
, <function-token>
, <at-keyword-token>
, <hash-token>
, <string-token>
, <bad-string-token>
, <url-token>
, <bad-url-token>
, <delim-token>
, <number-token>
, <percentage-token>
, <dimension-token>
, <whitespace-token>
, <CDO-token>
, <CDC-token>
, <colon-token>
, <semicolon-token>
, <comma-token>
, <[-token>
, <]-token>
, <(-token>
, <)-token>
, <{-token>
and <}-token>
<an-plus-b>
, <urange>
, <custom-property-name>
, <declaration-value>
, <any-value>
and <zero>
<unicode-range>
to <urange>
as per spec<expression>
(IE legacy extension) to <-ms-legacy-expression>
and may to be removed in next releasesChangelog
1.0.0-alpha.29 (May 30, 2018)
Token
node type to represent a single code point (<delim-token>
)Multiplier
that wraps a single node (term
property)AtKeyword
to represent <at-keyword-token>
Slash
and Percent
node types, they are replaced for a node with Token
typeFunction
to represent <function-token>
with no childrenmultiplier
property from Group
generate()
method:
options
as second argument now (generate(node, forceBraces, decorator)
-> generate(node, options)
). Two options are supported: forceBraces
and decorator
decorate
option value, i.e. generate(node, fn)
-> generate(node, { decorate: fn })
Atrule
const to AtKeyword
Changelog
1.0.0-alpha.28 (February 19, 2018)
lexer.grammar.translate()
method into generate()
<'-webkit-font-smoothing'>
and <'-moz-osx-font-smoothing'>
syntaxes (#75)<'overflow'>
property syntax (#76)mdn-data
to ~1.1.0
and fixed issues with some updated property syntaxes