Skip to content

fix: skip parsing invalid css in preferUnitlessValues #1512

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

Merged
merged 1 commit into from
Jun 12, 2025

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