Skip to content

fix: skip parsing invalid css in preferUnitlessValues#1512

Merged
cossssmin merged 1 commit intomasterfrom
fix-preferunitlessvalues
Jun 12, 2025
Merged

fix: skip parsing invalid css in preferUnitlessValues#1512
cossssmin merged 1 commit intomasterfrom
fix-preferunitlessvalues

Conversation

@cossssmin
Copy link
Member

This PR fixes an issue where builds failed because preferUnitlessValues (which is on by default) was throwing an error when encountering invalid inline CSS.

There are situations where inline CSS values contain expressions that are meant to be parsed later on, and the user just needs to have them output as they are, for example:

<div style="color: #{{ $themeHexValue }}">

Normally PostCSS, which we use to parse the inline styles so we can remove units like px from 0-based CSS values like margin: 0px, will trip on that. This PR ensures it just silently skips it so that it's just output as-is.

Fixes #1510.

avoids throwing an error in a case where unitless values wouldn't make sense anyway
@cossssmin cossssmin merged commit ac7f38d into master Jun 12, 2025
3 checks passed
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.

CssSyntaxError on @{{ in DIV style

1 participant