css-tree
Advanced tools
Changelog
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)Changelog
1.0.0-alpha9 (December 21, 2016)
<angle>
generic according to specs that allow a <number>
equals to zero to be used as valid value (#30)Changelog
1.0.0-alpha8 (November 11, 2016)
Scanner#skip()
issue method when cursor is moving to the end of sourceProgid
node<id-selector>
generic syntaxq
unit for <length>
generic syntaxmdn/data
instead of Template:CSSData
syntax.stringify()
method to syntax.translate()
true
or false
var()
, those values are always valid for now98.5%
Changelog
1.0.0-alpha7 (October 7, 2016)
>>
)Type
and Universal
type nodesNumber
parsing by including sign and exponent (#26)before
, after
, first-letter
and first-line
pseudos with single colon as PseudoElement
FunctionalPseudo
node type to PseudoClass
eof
is reachedSyntax#getAll()
methodChangelog
1.0.0-alpha6 (September 23, 2016)
apple
specific font keywords (#20)Property
node stucture from object to stringRuleset
node type to Rule
Argument
node typeDimension
and Percentage
position computationpositions:true
(even freeze)line
and column
computation for SyntaxMatch
error