feat: enhance CSS parsing with modern features and improved regex pat… #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enhance CSS Parsing with Modern Features and Improved Regex Patterns
Overview
This pull request significantly upgrades the CSS language parsing logic to support a wide range of modern CSS features and syntax. The improvements include more robust and accurate regular expressions, expanded keyword and value recognition, and better handling of advanced CSS constructs. The changes are demonstrated and validated with an updated and comprehensive
test.cssexample file.Key Changes
1. Expanded CSS Test Coverage
examples/languages/test.cssfile now includes:@layer,@property,@counter-style,@namespace,@font-face,@supports,@container,@custom-media,@view-transition, etc.:is(),:where(),:has(),:not(),:focus-visible, etc.2. Improved Regex Patterns in CSS Parser
/* ... */) and single-line (// ...) comments.url()parsing to handle quoted and unquoted URLs robustly.@...) and important keywords (!important).--var) and property names before colons.cqw,cqmin,dvw,svh, etc.).auto,inherit,block,flex,grid, etc.).3. Parser Structure Enhancements
Benefits
test.cssfile serves as a robust testbed for parser validation.Testing
test.cssfile, which exercises the full range of supported CSS features.Backward Compatibility
Related Issues
Please review the changes and provide feedback or suggestions for further improvements.