Changelog
1.0.0-alpha17 (March 13, 2017)
syntax
exports
to expose a default syntaxcreateSyntax()
method to create a new syntax from scratchfork()
method to create a new syntax based on given via extensionmediaQueryList
and mediaQuery
parsing contextsCDO
and CDC
node types#
and +
)@font-face
at-rulechroma()
to legacy IE filter functionsHexColor
to consume hex only\0
and \9
hacks (#2)Ratio
terms
Ratio
termRatio
term!ie
)true
for important
field in case identifier equals to important
and string otherwiseParser
classreadSelectorSequence()
, readSequenceFallback()
and readSelectorSequenceFallback
methodsAtruleExpression
, Selector
and Value
translateMarkup(ast, before, after)
method for complex casestranslateWithSourceMap
to be more flexible (based on translateMarkup
, additional work to be done in next releases)checkStructure(ast)
method to check AST structure based on syntax definitionmdn/data
<'offset-position'>
syntax<position>
property with -webkit-sticky
(@sergejmueller, #37)gen:syntax
) to generate AST format reference page (docs/ast.md
) using syntax definitionChangelog
1.0.0-alpha16 (February 12, 2017)
Parser
classstartOffset
option to Tokenizer
(constructor and setSource()
method)readSequenceFallback
) and selector (readSelectorSequenceFallback
) sequence readersAnPlusB
Selector
consumerChangelog
1.0.0-alpha15 (February 8, 2017)
atruleExpression
contextkeyword()
and property()
property()
to not lowercase custom property namesvariable
boolean flag in property()
resultscanner
into tokenizer
syntax
into lexer
docs/*.html
files to csstree/docs repoelement()
function for Value
context (-moz-element()
supported as well)Universal
node type into Type
Id
-> IdSelector
Class
-> ClassSelector
Type
-> TypeSelector
Attribute
-> AttributeSelector
PseudoClass
-> PseudoClassSelector
PseudoElement
-> PseudoElementSelector
Hash
-> HexColor
Space
-> WhiteSpace
An+B
-> AnPlusB
Progid
node typeMediaQuery
consumer to not validate syntax on parse and to include whitespaces in children sequence as isWhiteSpace.value
property to store whitespace sequencefalse
some part of CSS represents as balanced Raw
):
parseAtruleExpression
– to parse at-rule expressions (true
by default)parseSelector
– to parse rule's selector (true
by default)parseValue
- to parse declaration's value (true
by default)parseCustomProperty
– to parse value and fallback of custom property (false
by default)Changelog
1.0.0-alpha14 (February 3, 2017)
DeclarationList
, MediaQueryList
, MediaQuery
, MediaFeature
and Ratio
node typesdeclarationList
context (useful to parse HTML style
attribute content)@import
, @media
, @page
and @supports
at-rulesatrule
option for parse()
config, is used for atruleExpession
context to specify custom consumer for at-rule if anyScanner#skipWS()
, Scanner#eatNonWS()
, Scanner#consume()
and Scanner#consumeNonWS()
helper methodsRaw
PseudoElement
to be a functional-pseudo (#33)Atrule.block
to contain a Block
node type only if anyBlock.loc
positions to include curly bracketsAtrule.expression
to store a null
if no expressionStyleSheet
node type only for top level node (when context is stylesheet
, that's by default)Parentheses
, Brackets
and Function
consumers to use passed sequence reader instead of its ownValue
and AtruleExpression
consumers to use common sequence reader (that reader was used by Value
consumer before)Comma
Raw
var()
fallback value as balanced Raw
var()
starts with double dashNth
to have a loc
propertySelectorList.loc
and Selector.loc
positions to exclude spacesdefault-syntax.json
is not found error (#32, @philschatz)Type
selector starting with dash (parser throws an error in this case now)Rule
(not sure if it's correct but looks reasonable)>>
combinator support until any browser support (no signals about that yet)PseudoElement.legacy
property:before
, :after
, :first-letter
and :first-line
to represent them as PseudoElement
, now those pseudos are represented as PseudoClass
nodesSyntax#match()
methodChangelog
1.0.0-alpha13 (January 19, 2017)
SyntaxMatchError
mismatchOffset
offset
property to store bad node offset in source CSS if anyloc
property that stores bad node loc
if anyChangelog
1.0.0-alpha12 (January 19, 2017)
Syntax#matchProperty()
method to always return a positive result for custom properties since syntax is never defined for them (#31)fromPlainObject()
and toPlainObject()
to convert plain object to AST or AST to plain object (currently converts List
<-> Array
)Changelog
1.0.0-alpha11 (January 18, 2017)
:matches(<selector-list>)
(#28):has(<relative-selector-list>)
::slotted(<compound-selector>)
Brackets
node typeSelector
node type to SelectorList
SimpleSelector
node type to Selector
UnicodeRange.name
property to UnicodeRange.value
Negation
node type for regular PseudoClass
children
now:
StyleSheet.rules
-> StyleSheet.children
SelectorList.selectors
-> SelectorList.children
Block.declarations
-> Block.children
*.sequence
-> *.children
Hex
and UnicodeRange
when number not an integernth-
pseudos parsing
An+B
node type to represent expressions like 2n + 1
or -3n
a
or b
is not an integerodd
and even
keywords processing, keywords are storing as Identifier
node type nowNth
node type format to store a nth
-query and an optional selector
of
clause for nth-
pseudos (a.e. :nth-child(2n + 1 of li, img)
)Nth
parsing rules to :nth-child()
, :nth-last-child()
, :nth-of-type()
and :nth-last-of-type()
pseudosinfo
node property to loc
loc
to store start
and end
positionsChangelog
1.0.0-alpha10 (January 11, 2017)
Scanner
to be a single point to its functionalityScanner
class to be useful for external projectswalk()
function behaviour to traverse AST nodes in natural orderwalkUp()
function to traverse AST nodes from deepest to parent (behaves as walk()
before)