-
Notifications
You must be signed in to change notification settings - Fork 0
develop #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Replace css-tree with @eslint/css-tree v3.6.6 - Add var() detection to skip validation for CSS custom properties - Update all imports across 8 files - Fix TypeScript types for walk() callbacks - Remove @types/css-tree dependency Resolves issue where properties containing var() would report validation errors even though expansion was successful. CSS variables are runtime values that cannot be validated at parse time.
- Update bundle size: ~68KB (ESM), ~73KB (CJS) minified + brotli - Remove css-tree from installation (now bundled dependency) - Update test count: 973 tests - Update acknowledgments to @eslint/css-tree - Add accurate performance metrics
- Keep @eslint/css-tree link to upstream repo - Add b_values link for CSS value expansion/validation work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the CSS parsing dependency from css-tree to @eslint/css-tree and adds support for CSS variables (var() functions) which cannot be validated at parse time.
Key Changes
- Replaced
css-treewith@eslint/css-treev3.6.6 across all source files - Added
containsVar()function to detect and skip validation of properties containing CSS variables - Updated TypeScript types for
walk()callbacks fromcsstree.Valuetocsstree.CssNodewith type guards - Changed package dependency from peer to bundled, updated README installation instructions accordingly
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/internal/layer-parser-utils.ts | Updated import and walk callback types with type guard |
| src/internal/is-value-node.ts | Updated type import to @eslint/css-tree |
| src/handlers/transition/transition-layers.ts | Updated import and walk callback types with type guard |
| src/handlers/mask/mask-layers.ts | Updated import and walk callback types with type guard |
| src/handlers/grid/expand.ts | Updated import and walk callback types with type guard |
| src/handlers/background/background-layers.ts | Updated import and walk callback types with type guard |
| src/handlers/animation/animation-layers.ts | Updated import and walk callback types with type guard |
| src/core/validate.ts | Updated import, added containsVar() function and validation skip logic |
| pnpm-lock.yaml | Updated dependencies from css-tree@3.1.0 to @eslint/css-tree@3.6.6 with mdn-data@2.23.0 |
| package.json | Changed css-tree from peerDependency to bundled dependency @eslint/css-tree |
| docs.llm/llm_src.txt | Updated imports across all code sections (with one comment needing correction) |
| README.md | Updated bundle sizes, installation instructions, test counts, and acknowledgments |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /** | ||
| * Checks if a CSS value node contains var() function. | ||
| * CSS variables cannot be validated by css-tree as they are runtime values. |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment still references "css-tree library" but should be updated to "@eslint/css-tree" to match the migration.
| * CSS variables cannot be validated by css-tree as they are runtime values. | |
| * CSS variables cannot be validated by @eslint/css-tree as they are runtime values. |
fix: migrate to @eslint/css-tree to support CSS variables (var())
Resolves issue where properties containing var() would report validation
errors even though expansion was successful. CSS variables are runtime
values that cannot be validated at parse time.
docs: update bundle sizes and dependencies in README
docs: update comment to reference @eslint/css-tree
docs: link to b_values fork in acknowledgments
docs: add separate acknowledgment for b_values