Skip to content
Open
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: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
/.github/** linguist-vendored
# exclude all files in test/ from stats
/rollup.config.js linguist-vendored
/dist/** linguist-vendored
/docs/** linguist-vendored
/tools/** linguist-vendored
/dist/** linguist-vendored
/test/** linguist-vendored
/benchmark/** linguist-vendored
/coverage/** linguist-vendored
#
# do not replace lf by crlf
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/ROADMAP.draft.md
/.idea
/.DS_Store
/benchmark
/ROADMAP.md
/package-lock.json
test/*.ts
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

# v1.5.0

## Improvements

- [x] Add support for input sourcemap

# v1.4.11

- fix bug in url resolution
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

# css-parser

CSS parser, transformer, minifier and validator for node and the browser
An all-in-one CSS parsing solution for Node.js and the browser, covering parsing, validation, transformation, minification, and AST-based tooling.

The library always fully parses the stylesheet into a structured AST, and token values are exposed as typed data so custom transforms, plugins, and analysis can work with reliable, semantic input instead of raw strings.

## Installation

Expand All @@ -23,9 +25,11 @@ $ deno add @tbela99/css-parser
## Features

* **Zero dependencies** — lightweight and easy to integrate into any project.
* **All-in-one CSS parsing solution** covering parsing, validation, transformation, minification, and AST manipulation.
* **Standards-based CSS validation** powered by MDN data.
* **Full CSS Modules support** for modern component-based workflows.
* **Fault-tolerant parsing** that follows the CSS Syntax Module Level 3 specification.
* **Fault-tolerant parsing** that follows the CSS Syntax Module Level 3 specification and always produces a complete, structured parse result.
* **Typed tokens and AST** — parsed CSS is exposed as strongly typed tokens and nodes so plugins and transforms can operate on semantic structures.
* **High-performance minification** with safe optimizations and no unsafe transforms.
* **Advanced color processing** with support for modern color spaces and functions, including `color()`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color-mix()`, `light-dark()`, system colors, and relative colors.
* **Color conversion engine** capable of transforming colors between all supported formats.
Expand All @@ -39,7 +43,7 @@ $ deno add @tbela99/css-parser
* **`@import` flattening** to produce self-contained stylesheets.

## Vendor prefix removal
**Experimental vendor prefix cleanup** to modernize generated CSS.
**Vendor prefix cleanup** to modernize generated CSS.

## Syntax lowering
CSS-Parser can transform these modern CSS features into lower-level CSS syntax:
Expand Down Expand Up @@ -81,6 +85,8 @@ Try it [online](https://tbela99.github.io/css-parser/playground/)
- [CSS Modules](https://tbela99.github.io/css-parser/docs/documents/Guide.CSS_Modules.html)
- [Minification](https://tbela99.github.io/css-parser/docs/documents/Guide.Minification.html)
- [Custom Transform](https://tbela99.github.io/css-parser/docs/documents/Guide.Custom_Transform.html)
- [Sourcemap](https://tbela99.github.io/css-parser/docs/documents/Guide.Sourcemap.html)
- [Plugins API](https://tbela99.github.io/css-parser/docs/documents/Guide.Plugins_API.html)
- [Syntax Lowering](https://tbela99.github.io/css-parser/docs/documents/Guide.Syntax_Lowering.html)
- [Ast Manipulation](https://tbela99.github.io/css-parser/docs/documents/Guide.Ast_Manipulation.html)
- [Utility Functions](https://tbela99.github.io/css-parser/docs/documents/Guide.Utility_Functions.html)
Expand Down
6 changes: 3 additions & 3 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"all": "npm run sizes && npm run bench && npm run report"
},
"dependencies": {
"@tbela99/css-parser": "^1.4.9",
"@tbela99/css-parser2": "github:tbela99/css-parser#2279484",
"@tbela99/css-parser": "^1.4.11",
"@tbela99/css-parser2": "github:tbela99/css-parser#2628ebce",
"clean-css": "^5.3.3",
"css-tree": "^3.2.1",
"cssnano": "^8.0.5",
"cssnano": "^8.0.6",
"csso": "^5.0.5",
"esbuild": "^0.28.2",
"lightningcss": "^1.33.0",
Expand Down
Loading
Loading