Skip to content

Releases: csskit/csskit

Canary

Canary Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Dec 10:06

This release is automatically built and generated on every commit to main that passes tests.

And is currently published to npm:

npm i csskit@canary

v0.0.30

Choose a tag to compare

@keithamus keithamus released this 23 Aug 20:40
82bc214

Headline Changes

The biggest change with this release is the NAPI API. This provides direct bindings for Node.JS:

import {
  StyleRule, StyleSheet, Color, MediaRule
} from "csskit";

const sheet = StyleSheet.parse("a { color: red }");
sheet instanceof StyleSheet; // true

for (const rule of sheet.querySelectorAll("style-rule")) {
 rule instanceof StyleRule; // true
 console.log(rule.constructor.name, rule.text);
   // -> StyleRule a { color: red }
}

Color.parse("#ff0000");
MediaRule.parse("@media print { a { color: red } }");

In addition to this:

  • Improves support for @layer, @scope.
  • Add more -webkit- and -moz- pseudo elements and classes.
  • Speed and memory efficiency improvements.
  • Improvements npm package size.
  • Bugfixes in minification.
  • Minifier now removes empty rules and @charset rules, when possible.

What's Changed

Full Changelog: v0.0.29...v0.0.30

v0.0.29

Choose a tag to compare

@keithamus keithamus released this 14 Aug 22:47
b531701

Headline Changes

This is a large release with several major improvements:

  • A huge amount of TODO nodes are now parsable, such as @scope, @font-face and @color-profile rules, calc-size(), mask-layer(), ray() functions, and properties like animation, rotate, and offset. We're now at the point where most specified CSS can be parsed.
  • Continued refinement for performance and memory, making more use of the new csskit_arena arena allocator crate.

What's Changed

Read more

v0.0.28

Choose a tag to compare

@keithamus keithamus released this 25 Jul 15:15
81c9273

Headline Changes

This is a large release with several major improvements:

  • All substitution functions, such as var(), calc() and env() are now fully parsed as "slotted" values, this means a value such as font-weight: var(--foo) is no-longer resolved as an unknown value, but instead as a fully typed substitution. This slotted design means that using calc() for substitutions that cannot be calculated (such as a keyword) is a parse error and still resolved to an unknown value.
  • In addition to var()/calc()/env() this release also supports parsing of if() functions in value positions.
  • Support for Container & Style queries has been improved, so that more variants of these syntaxes properly parse.
  • Identifier scanning is now SIMD accelerated, meaning parsing CSS is a lot faster. How fast depends on which SIMD instructions your particular CPU supports.
  • As usual, this release comes with support for a bunch of new properties.
  • This also includes parsing support for legacy vendor prefixes, such as -webkit-text-stroke, and the :-moz-meter-* pseudo classes.

What's Changed

  • css_lexer/csskit: Implement LineIndex, precomputing line offsets by @keithamus in #1264
  • csskit_derives: Add peek(skip) attribute by @keithamus in #1266
  • Regenerate css_ast/src/values from csswg drafts by @keithamus in #1267
  • chore(deps): update dependency @types/node to v24.13.2 by @renovate[bot] in #1269
  • chore(deps): update dependencies (patch) by @renovate[bot] in #1268
  • chore(deps): update dependency apexcharts to v5.14.0 by @renovate[bot] in #1271
  • chore(deps): update dependency @types/vscode to v1.125.0 by @renovate[bot] in #1270
  • css_parse/csskit_derives: Add semantic_eq(skip) to derive(SemanticEq) by @keithamus in #1272
  • chore(deps): update dependency typescript to v7 by @renovate[bot] in #1273
  • css_ast: Implement various shape functions for clip-path, etc by @keithamus in #1275
  • css_ast: Use blocks for Container & Style at rules by @keithamus in #1276
  • css_ast: Add more -moz-meter-* pseudo elements/classes by @keithamus in #1277
  • css_ast: Refactor and improve @supports parsing by @keithamus in #1278
  • css_ast: Implement fill & stroke by @keithamus in #1279
  • css_ast: Implement webkit-text-stroek by @keithamus in #1280
  • css_ast Implement grid functions, track, line, etc by @keithamus in #1281
  • csskit_derives: Ensure atom checks properly peek by @keithamus in #1282
  • csskit_spec_generator: Ensure property atoms includes the extra properties by @keithamus in #1283
  • css_ast/css_parse: Implement ToNormalisedValue trait by @keithamus in #1284
  • Regenerate css_ast/src/values from csswg drafts by @keithamus in #1285
  • chore(deps): update dependency apexcharts to v5.15.2 by @renovate[bot] in #1287
  • chore(deps): update dependency npm to v11.17.0 by @renovate[bot] in #1290
  • chore(deps): update dependencies (patch) - autoclosed by @renovate[bot] in #1286
  • chore(deps): update dependency apexcharts to v5.16.0 by @renovate[bot] in #1289
  • chore(deps): update actions/setup-node action to v7 by @renovate[bot] in #1291
  • fuzz: new parser findings 2026-07-13 by @keithamus in #1288
  • Regenerate css_ast/src/values from csswg drafts by @keithamus in #1294
  • csskit_derives: Allow multiple fields to delegate metadata by @keithamus in #1295
  • css_parse: Drop CursorSource trait by @keithamus in #1296
  • css_parse: Drop PreludeList, DeclarationRuleList by @keithamus in #1297
  • css_parse: Reimplement computed value declaration peeking/parsing in DeclarationValue by @keithamus in #1298
  • Regenerate css_ast/src/values from csswg drafts by @keithamus in #1299
  • chore(deps): update dependencies (patch) by @renovate[bot] in #1300
  • css_parse: Refactor BumpBox into generic Arena allocating Box. by @keithamus in #1304
  • chore(deps): update dependency oxlint to v1.69.0 by @renovate[bot] in #1303
  • chore(deps): update dependency lightningcss-cli to v1.33.0 by @renovate[bot] in #1302
  • chore(deps): update dependency npm to v11.18.0 by @renovate[bot] in #1301
  • css_lexer: Use a boxed slice in LineIndex, dropping Bumpalo's Vec. by @keithamus in #1305
  • css_parse: Implement an Arena allocated Vec. by @keithamus in #1306
  • css_lexer: Implement fearless_simd paths for scanning by @keithamus in #1307
  • css_ast: Build out substitution function architecture by @keithamus in #1308
  • css_ast: Use Value/CalcableValue in most manual types by @keithamus in #1309
  • Release v0.0.28 by @keithamus in #1265
  • css_ast: Add value slots for more types by @keithamus in #1310

Full Changelog: v0.0.27...v0.0.28

v0.0.27

Choose a tag to compare

@keithamus keithamus released this 04 Jul 17:47
584950b

Headline Changes

This is a small release, mostly improving parsing robustness.

What's Changed

Full Changelog: v0.0.26...v0.0.27

v0.0.26

Choose a tag to compare

@keithamus keithamus released this 20 Jun 13:53
c3ae3f8

What's Changed

Full Changelog: v0.0.25...v0.0.26

v0.0.25

Choose a tag to compare

@keithamus keithamus released this 13 Jun 11:24
a8567c2

Headline Changes

This release is largely about stability. In order to ensure the parser is as robust as possible, we've been running it against HTTP Archive, and introducing a Fuzz testing. This testing has discovered a variety of inputs that crashed csskit, including:

  • /*x*//*x*//*x*//*x*//*x*//*x*//*x*//*x*//*x*//*x*//*x*/a
  • ={-->} (this one was particularly bad as csskit would run forever, consuming all system memory!)
  • l\0000
  • x\u0000\u0000~\u0000\u0000\u0000\u0000\u0000

While it's quite unlikely for developers to write CSS that looks like this, making sure csskit doesn't crash (or eat all ram!) in these cases makes it much more reliable and trustworthy.

In addition, this release adds support for the new overflow-wrap (the new name for the non-standard word-wrap) property (word-wrap has been kept as the non-standard alias), as well as the new spatial-navigation* properties.

What's Changed

Full Changelog: v0.0.24...v0.0.25

v0.0.24

Choose a tag to compare

@keithamus keithamus released this 05 Jun 00:03
179ff2f

Headline Changes

csskit subcommands (colors, find, specificity, check) now all have a consistent --format json option.

Many many more properties now properly parse including older vendor prefixed properties such as -ms-filter.

Improvements to colour minification, including properly minifying color-mix().

What's Changed

Full Changelog: v0.0.23...v0.0.24

v0.0.23

Choose a tag to compare

@keithamus keithamus released this 22 May 20:17
293f9ce

Headline Changes

This change largely works on adding more proper AST nodes for parsing values such as light-dark(), relative colour syntax (color(from...)), text-overflow, background, content, touch-action, as well as SVG properties. There are also minor improvements to minification.

It also adds csskit specificty, a sub-command that can parse a stylesheet and provide a list of rules with their associated specificity, which can help isolate specificity issues in ss sheets.

What's Changed

Full Changelog: v0.0.22...v0.0.23

v0.0.22

Choose a tag to compare

@keithamus keithamus released this 15 May 18:00
97c489d

Headline Changes

This release supports parsing for many more properties, including many vendor prefixed properties while also improving minification for colours and improving overall performance.

What's Changed

  • packages: remove accidentally comitted bin by @keithamus in #1079
  • vscode: Add Open VSX release step by @keithamus in #1081
  • vscode: bump version by @keithamus in #1082
  • Release csskit vscode extension v1.0.7 by @keithamus in #1083
  • css_ast: implement corner-*, whites-pace, text-emphasis(-style), voice-volume by @keithamus in #1084
  • csskit_proc_macro: Auto generate name for Combinator of Alternatives by @keithamus in #1085
  • css_ast: Implement FontVariant* properties and sub-types by @keithamus in #1086
  • css_value_definition_parser: Optimize Auto Number/Percentage or LengthPercentage/Number cases by @keithamus in #1087
  • css_parse: Add Either<Left, Right> by @keithamus in #1088
  • csskit_proc_macro: use Either<> type for 2-type Alternatives by @keithamus in #1089
  • css_ast: implement BorderColor, BorderImageSlice, BorderImageWidth by @keithamus in #1090
  • css_ast: Implement lots more properties by @keithamus in #1091
  • chromashift/csskit_transform: Round fractional colour channels to perceptually safe values by @keithamus in #1092
  • css_ast: Uncomment BorderShape, OffsetPath, ShapeInside, ShapeOutside by @keithamus in #1093
  • css_parse/css_ast: Use PEEK_KINDSET alot more consistently by @keithamus in #1094
  • css_lexer: Add Span.overlaps by @keithamus in #1095
  • css_ast: Implement a bunch of vendor prefixed style values by @keithamus in #1096
  • css_ast: Add vendor prefix display values by @keithamus in #1097
  • css_value_definition_parser: Ensure dash prefixed idents are properly emitted by @keithamus in #1099
  • css_ast: Implement z-index by @keithamus in #1098
  • csskit_proc_macro: Ensure dash prefixed idents are properly emitted by @keithamus in #1100
  • css_ast: Add vendor prefixed value keywords by @keithamus in #1101
  • Regenerate css_ast/src/values from csswg drafts by @keithamus in #1102
  • chore(deps): update dependencies (patch) by @renovate[bot] in #1103
  • chore(deps): update dependency apexcharts to v5.11.0 by @renovate[bot] in #1104
  • chore(deps): update dependency npm to v11.14.1 by @renovate[bot] in #1105
  • chore(deps): update dependency oxlint to v1.63.0 by @renovate[bot] in #1106
  • chore(deps): update rust crate indexmap to v2.13.1 by @renovate[bot] in #1108
  • chore(deps): update rust crate indexmap to v2.14.0 by @renovate[bot] in #1109
  • css_ast: Uncomment clip/clip-path/mask/mask-image/mask-mode/mask-border-slice by @keithamus in #1110
  • css_ast: Unlock more properties by stubbing types by @keithamus in #1111
  • csskit: Improve messaging for check commands with missing sheets by @rlorenzo in #1113
  • Release v0.0.22 by @keithamus in #1080

New Contributors

Full Changelog: v0.0.21...v0.0.22