3.2.1
- Fixed parsing of nested function in a group in definition syntax (#358)
csstree release notes.
| Jun | Jul | Aug | Sep | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sunday | No releases on May 24, 2026 | No releases on May 31, 2026 | No releases on Jun 7, 2026 | No releases on Jun 14, 2026 | No releases on Jun 21, 2026 | No releases on Jun 28, 2026 | No releases on Jul 5, 2026 | No releases on Jul 12, 2026 | No releases on Jul 19, 2026 | No releases on Jul 26, 2026 | No releases on Aug 2, 2026 | No releases on Aug 9, 2026 | No releases on Aug 16, 2026 | No releases on Aug 23, 2026 | No releases on Aug 30, 2026 | No releases on Sep 6, 2026 |
| Monday | No releases on May 25, 2026 | No releases on Jun 1, 2026 | No releases on Jun 8, 2026 | No releases on Jun 15, 2026 | No releases on Jun 22, 2026 | No releases on Jun 29, 2026 | No releases on Jul 6, 2026 | No releases on Jul 13, 2026 | No releases on Jul 20, 2026 | No releases on Jul 27, 2026 | No releases on Aug 3, 2026 | No releases on Aug 10, 2026 | No releases on Aug 17, 2026 | No releases on Aug 24, 2026 | No releases on Aug 31, 2026 | No releases on Sep 7, 2026 |
| Tuesday | No releases on May 26, 2026 | No releases on Jun 2, 2026 | No releases on Jun 9, 2026 | No releases on Jun 16, 2026 | No releases on Jun 23, 2026 | No releases on Jun 30, 2026 | No releases on Jul 7, 2026 | No releases on Jul 14, 2026 | No releases on Jul 21, 2026 | No releases on Jul 28, 2026 | No releases on Aug 4, 2026 | No releases on Aug 11, 2026 | No releases on Aug 18, 2026 | No releases on Aug 25, 2026 | No releases on Sep 1, 2026 | No releases on Sep 8, 2026 |
| Wednesday | No releases on May 27, 2026 | No releases on Jun 3, 2026 | No releases on Jun 10, 2026 | No releases on Jun 17, 2026 | No releases on Jun 24, 2026 | No releases on Jul 1, 2026 | No releases on Jul 8, 2026 | No releases on Jul 15, 2026 | No releases on Jul 22, 2026 | No releases on Jul 29, 2026 | No releases on Aug 5, 2026 | No releases on Aug 12, 2026 | No releases on Aug 19, 2026 | No releases on Aug 26, 2026 | No releases on Sep 2, 2026 | No releases on Sep 9, 2026 |
| Thursday | No releases on May 28, 2026 | No releases on Jun 4, 2026 | No releases on Jun 11, 2026 | No releases on Jun 18, 2026 | No releases on Jun 25, 2026 | No releases on Jul 2, 2026 | No releases on Jul 9, 2026 | No releases on Jul 16, 2026 | No releases on Jul 23, 2026 | No releases on Jul 30, 2026 | No releases on Aug 6, 2026 | No releases on Aug 13, 2026 | No releases on Aug 20, 2026 | No releases on Aug 27, 2026 | No releases on Sep 3, 2026 | No releases on Sep 10, 2026 |
| Friday | No releases on May 29, 2026 | No releases on Jun 5, 2026 | No releases on Jun 12, 2026 | No releases on Jun 19, 2026 | No releases on Jun 26, 2026 | No releases on Jul 3, 2026 | No releases on Jul 10, 2026 | No releases on Jul 17, 2026 | No releases on Jul 24, 2026 | No releases on Jul 31, 2026 | No releases on Aug 7, 2026 | No releases on Aug 14, 2026 | No releases on Aug 21, 2026 | No releases on Aug 28, 2026 | No releases on Sep 4, 2026 | |
| Saturday | No releases on May 30, 2026 | No releases on Jun 6, 2026 | No releases on Jun 13, 2026 | No releases on Jun 20, 2026 | No releases on Jun 27, 2026 | No releases on Jul 4, 2026 | No releases on Jul 11, 2026 | No releases on Jul 18, 2026 | No releases on Jul 25, 2026 | No releases on Aug 1, 2026 | No releases on Aug 8, 2026 | No releases on Aug 15, 2026 | No releases on Aug 22, 2026 | No releases on Aug 29, 2026 | No releases on Sep 5, 2026 |
2 releases in the last year, busiest day 2
From csstree
"sideEffects": false in package.jsonlist option to the parse() method to specify whether the parser should produce a List (by default, list: true) or an array (list: false) for node's children (e.g., SelectorList, Block, etc.){A}? and {A,B}? according to spec in definition syntax parsing (#346)min(), max(), etc.) (#344)onToken option to the parse() method, which can be either an array or a function:
{ type, start, end } (token type, and its start and end offsets).type, start, end, and index parameters, and is invoked with a token API as this, enabling advanced token handling (see onToken). For example, the following demonstrates checking if all block tokens have matching pairs:
parse(css, {
onToken(type, start, end, index) {
if (this.isBlockOpenerTokenType(type)) {
if (this.getBlockPairTokenIndex(index) === -1) {
console.warn('No closing pair for', this.getTokenValue(index), this.getRangeLocation(start, end));
}
} else if (this.isBlockCloserTokenType(type)) {
if (this.getBlockPairTokenIndex(index) === -1) {
console.warn('No opening pair for', this.getTokenValue(index), this.getRangeLocation(start, end));
}
}
}
});
TokenStream with the following methods:
getTokenEnd(tokenIndex) – returns the token's end offset by index, complementing getTokenStart(tokenIndex)getTokenType(tokenIndex) – returns the token's type by indexisBlockOpenerTokenType(tokenType) – returns true for <function-token>, <(-token>, <[-token>, and <{-token>isBlockCloserTokenType(tokenType) – returns true for <)-token>, <]-token>, and <}-token>getBlockTokenPairIndex(tokenIndex) – returns the index of the pair token for a block, or -1 if no pair existsgenerate() to not auto insert whitespaces between tokens for raw values (#356)fork() to extend node definitions instead of overriding them. For example, fork({ node: { Dimension: { generate() { /* ... */ } } } }) will now update only the generate() method on the Dimension node, while inheriting all other properties from the previous syntax definition.mdn/data to 2.27.1 and various fixes in syntaxesFrom csstree
<boolean-expr[ test ]> (#304)source, startOffset, startLine, and startColumn parameters to OffsetToLocation constructor, eliminating the need to call setSource() after creating a new OffsetToLocation instanceOffsetToLocation class in the main entry point, which was previously accessible only via css-tree/tokenizerRaw node value consumption by ignoring stop tokens inside blocks, resolving an issue where Raw value consumption stopped prematurely. This fix also enables parsing of functions whose content includes stop characters (e.g., semicolons and curly braces) within declaration values, aligning with the latest draft of CSS Values and Units L5.TokenStream#balance computation to handle unmatched brackets correctly. Previously, when encountering a closing bracket, the TokenStream would prioritize it over unmatched opening brackets, leading to improper parsing. For example, the parser would incorrectly consume the declaration value of .a { prop: ([{); } as ([{) instead of consuming it until all opened brackets were closed (([{); }). Now, unmatched closing brackets are discarded unless they match the most recent opening bracket on the stack. This change aligns CSSTree with CSS specifications and browser behavior.Layer node (#310)mdn/data to 2.12.2From csstree
mdn/data to 2.12.1errors array to the Lexer#validate() method result, providing details on problematic syntax.Lexer#cssWideKeywords dictionary to list CSS-wide keywordsconfig.cssWideKeywords for overriding the default listcssWideKeywords dictionaryfork() method to accept a cssWideKeywords option, allowing the addition of new keywords to the existing listBlock to include { and }, and Atrule and Rule to exclude { and } for a block (#296)assign) for the callback in the fork() method (e.g., syntax.fork((config, assign) => { ... })), as it simply refers to Object.assign()<basic-shapes>, <absolute-color-function> and <'stroke-opacity'>From csstree
@container at-rule@starting-style at-rule@scope at-rule@position-try at-rule@layer at-rulelayer, layer() and supports() in the @media at-rule (according to the @import rule in Cascading and Inheritance 5)Layer and LayerList node typesTokenStream#lookupTypeNonSC() method<dashed-ident> to generic typesmdn/data to 2.10.0<'font'> to CSS Fonts 4<color> to CSS Color 5Object.prototype is extended or polluted (#262)fork() method to consider the generic option when creating a Lexer instance (#266)line or offset is specified via options (#251)speak syntax patch (#241):lang() to accept a list of <ident> or <string> per spec (#265)<'property'>, when the syntax has a top-level #-multiplier (#102)parseWithFallback() to rollback tokenIndex before calling a fallbackBlock to not include { and }Atrule and Rule to include { and } for a blockRatio parsing:
Ratio can be omitted. While this can't be a parser output (which would produce a Number node), it's feasible during Ratio node construction or transformation.Feature: represents features like (feature) and (feature: value), fundamental for both @media and @container at-rulesFeatureRange: represents features in a range contextFeatureFunction: represents functional features such as @supports's selector() or @container's style()Condition: used across all query-like at-rules, encapsulating queries with features and the not, and, and or operatorsGeneralEnclosure: represents the <general-enclosed> production, which caters to unparsed parentheses or functional expressionsNote: All new nodes include a
kindproperty to define the at-rule type. Supported kinds aremedia,supports, andcontainer
(width: calc(100cm / 6))condition value for the parser's context option to parse queries. Use the kind option to specify the condition type, e.g., parse('...', { context: 'condition', kind: 'media' })features section in the syntax configuration for defining functional features of at-rules. Expand definitions using the fork() method. The current definition is as follows:
features: {
supports: { selector() { /* ... */ } },
container: { style() { /* ... */ } }
}
@media at-rule:
GeneralEnclosed(width > 100px) or (100px < height < 400px)MediaFeature node type to the Feature node type with kind: "media"MediaQuery node structure into the following form:
type MediaQuery = {
type: "MediaQuery";
modifier: string | null; // e.g. "not", "only", etc.
mediaType: string | null; // e.g. "all", "screen", etc.
condition: Condition | null;
}
@supports at-rule:
GeneralEnclosed(width > 100px) or (100px < height < 400px)SupportsDeclaration node type to encapsulate a declaration in a query, replacing ParenthesesCondition or SupportsDeclaration nodes of kind supports instead of Parenthesesselector() feature via the FeatureFunction node (configured in features.supports.selector)From csstree
:host, :host() and :host-context() pseudo class support (#216)generator, parse and parse-selector entry points by adding missed NestedSelector node typeFrom csstree
NestingSelector node type for & (a nesting selector) in selectors@nest at-rule@media inside a Rule to parse its block content as a Declaration firstDeclarationList behaviour to follow the rules for Rule's blockLexer#units dictionary to provide unit groups (length, angle, etc.) used for matchingconfig.units to override default unitsmdn-data to 2.0.30From csstree
2.2.0 for at-rule syntax matching when at-rule has no prelude (#203)From csstree
mdn-data to 2.0.28revert and revert-layerexpression() the same way as CSS wide keywordsbackground-clip property definition to match Backgrounds and Borders 4 (#190)content property definition to allow attr() (#201)<delim-token>@page at-rule (#191)rex, cap, rcap, rch, ic, ric, lh, rlh, vi, vb, sv*, lv*, dv*cqw, cqh, cqi, cqb, cqmin, cqmaxvm unit (supposed to be an old IE versions supported this unit instead of vmax)+# and #? according to spec (#199)[-∞,∞] rangesFrom csstree
mdn-data to 2.0.27module field to package.jsoncss-tree/utils export (#181)css-tree/convertor exportcss-tree/selector-parser export (~27kb when bundled, #183)css-tree/parser 50kb -> 41kbcss-tree/generator 46kb -> 23kbsyntaxes into types in css-tree/definition-syntax-data-patch:is(), :-moz-any(), :-webkit-any() and :where() (#182, #184)The library for web and native user interfaces.
The Vue 2 line, in long-term maintenance since its end of life in December 2023.
The progressive JavaScript framework for building user interfaces.
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
react-native release notes.
Bring data to life with SVG, Canvas and HTML.
If you publish csstree, you can claim this product by proving you administer its repository.