Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '24.x'
node-version: '26.x'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false # never use caching in release builds
- run: npm install
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

# 1.8.0

- [x] the walker functions now use DFS instead of BFS
- [x] [disallow](https://drafts.csswg.org/css-mixins-1/#mixin-rule) mixin inside rules or nested groups
- [x] [disallow](https://drafts.csswg.org/css-mixins-1/#mixin-rule) layer inside mixin
- [x] [disallow](https://drafts.csswg.org/css-mixins-1/#contents-rule) contents outside mixin
- [x] support dashed indent as unit

```css
.module {
margin-block: 1.5--bs;
border-block: .5--bs;
/* gives a vertical margin of 12px,
and vertical border of 4px */
}
```

is rendered as

```css
.module {
margin-block: 1.5--bs;
border-block: .5--bs
}
```

# v1.7.0

- [x] implement CSS [Custom Functions and Mixins Modules and Level 1](https://drafts.csswg.org/css-mixins/#apply-rule)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $ deno add @tbela99/css-parser
* **CSS variable inlining** where values can be safely resolved.
* **Duplicate declaration removal** to eliminate redundant rules.
* **`@import` flattening** to produce self-contained stylesheets.
* **51.5kb** once minified and gzipped.

## Vendor prefix removal
**Vendor prefix cleanup** to modernize generated CSS.
Expand Down
7 changes: 4 additions & 3 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
},
"dependencies": {
"@tbela99/css-parser": "^1.7.0",
"@tbela99/css-parser2": "github:tbela99/css-parser#89f2136",
"@tbela99/css-parser2": "github:tbela99/css-parser#293f2dc",
"clean-css": "^5.3.3",
"css-tree": "^3.2.1",
"cssnano": "^9.9.0",
"csso": "^5.0.5",
"esbuild": "^0.28.2",
"lightningcss": "^1.33.0",
"postcss": "^8.5.31",
"vitest": "^5.0.5"
"postcss": "^8.5.32",
"vitest": "^5.0.5",
"yuku-css": "^0.2.0"
}
}
8 changes: 8 additions & 0 deletions benchmark/src/minifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as csso from "csso";
import * as csstree from "css-tree";
import * as esbuild from "esbuild";
import { transform } from "lightningcss";
import { transform as yukuTransform} from "yuku-css";
import { transformSync as tbelaTransform } from "@tbela99/css-parser";
import { transformSync as tbelaDevTransform } from "@tbela99/css-parser2";

Expand Down Expand Up @@ -65,6 +66,7 @@ const versions = {
"css-tree": pkgVersion("css-tree", "css-tree/package.json"),
esbuild: pkgVersion("esbuild", "esbuild/package.json"),
lightningcss: pkgVersion("lightningcss", "lightningcss/package.json"),
'yuku-css': pkgVersion("yuku-css", "yuku-css/package.json"),
"css-parser": pkgVersion("css-parser", "@tbela99/css-parser/package.json"),
"css-parser-dev": pkgVersion("css-parser-dev", "@tbela99/css-parser2/package.json"),
};
Expand Down Expand Up @@ -118,6 +120,12 @@ export const minifiers = [
label: `lightningcss - ${versions.lightningcss.version}`,
minify: (css) => transform({ filename: "style.css", code: Buffer.from(css), minify: true }).code.toString(),
},
{
id: "yuku-css",
url: versions["yuku-css"].url,
label: `yuku-css - ${versions["yuku-css"].version}`,
minify: (css) => yukuTransform(css).code,
},
{
id: "css-parser",
url: versions["css-parser"].url,
Expand Down
Loading
Loading