Skip to content

Conversation

@srobinson
Copy link
Member

  • fix: migrate to @eslint/css-tree to support CSS variables (var())

    • 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.

  • docs: update bundle sizes and dependencies in README

    • 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
  • docs: update comment to reference @eslint/css-tree

  • docs: link to b_values fork in acknowledgments

  • docs: add separate acknowledgment for b_values

    • Keep @eslint/css-tree link to upstream repo
    • Add b_values link for CSS value expansion/validation work

- 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
Copilot AI review requested due to automatic review settings November 11, 2025 12:20
Copy link
Contributor

Copilot AI left a 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 v3.6.6 and adds support for CSS custom properties (variables using var()). The migration resolves validation errors that occurred when CSS variables were present in property values.

Key Changes:

  • Replaced css-tree with @eslint/css-tree as a bundled dependency (moved from peerDependencies to dependencies)
  • Added containsVar() function to detect and skip validation for CSS custom properties since they cannot be validated at parse time
  • Fixed TypeScript types for csstree.walk() callbacks across 8 files to use proper type guards

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
package.json Moved @eslint/css-tree from peerDependencies to dependencies; removed @types/css-tree devDependency
pnpm-lock.yaml Updated package resolutions for @eslint/css-tree v3.6.6 and mdn-data v2.23.0
src/core/validate.ts Added containsVar() function to detect CSS variables and skip validation; updated import to @eslint/css-tree
src/internal/layer-parser-utils.ts Updated import and fixed walk() callback type from csstree.Value to csstree.CssNode with type guard
src/internal/is-value-node.ts Updated import to @eslint/css-tree
src/handlers/transition/transition-layers.ts Updated import and fixed walk() callback type with proper type guard
src/handlers/mask/mask-layers.ts Updated import and fixed walk() callback type with proper type guard
src/handlers/grid/expand.ts Updated import and fixed walk() callback type with proper type guard
src/handlers/background/background-layers.ts Updated import and fixed walk() callback type with proper type guard
src/handlers/animation/animation-layers.ts Updated import and fixed walk() callback type with proper type guard
README.md Updated bundle sizes, installation instructions (removed css-tree requirement), test count, and acknowledgments
docs.llm/llm_src.txt Synchronized with source code changes across all modified files
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@srobinson srobinson merged commit f709da1 into main Nov 11, 2025
14 checks passed
@srobinson srobinson deleted the develop branch November 11, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants