fix: correctly handle CSS layers#123
Conversation
WalkthroughThis pull request expands the CSS rule processing logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as Processing Engine
participant Beasties
Runner->>Beasties: Invoke processStyle(rule)
alt rule.type is 'atrule'
alt rule.name is 'font-face' or rule.name is 'layer'
Beasties->>Runner: Retain rule for later processing
else
Beasties->>Runner: Skip rule for inline processing
end
else
Beasties->>Runner: Process rule normally
end
Assessment against linked issues
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code Definitions (1)packages/beasties/test/beasties.test.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
CodSpeed Performance ReportMerging #123 will not alter performanceComparing Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
+ Coverage 85.01% 85.25% +0.23%
==========================================
Files 8 8
Lines 1275 1275
Branches 301 302 +1
==========================================
+ Hits 1084 1087 +3
+ Misses 191 188 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Prior to this commit layers where not being handled correctly
Prior to this commit layers where not being handled correctly
✨
Description by Callstackai
This PR fixes the handling of CSS layers by updating the condition for font-face rules and adding tests for at-rules with layers.
Diagrams of code changes
sequenceDiagram participant Test participant Beasties participant CSSProcessor Test->>Beasties: process(HTML with stylesheet) Note over Beasties: Configure with reduceInlineStyles: false Beasties->>CSSProcessor: Process CSS rules alt @layer rule encountered CSSProcessor-->>CSSProcessor: Preserve @layer rules Note over CSSProcessor: Keep @layer declarations<br/>in first pass end CSSProcessor-->>Beasties: Return processed CSS Beasties-->>Test: Return HTML with<br/>preserved @layer rulesFiles Changed
This PR includes files in programming languages that we currently do not support. We have not reviewed files with the extensions
.ts,.snap. See list of supported languages.