Repository navigation
[FEATURE] Recognize newer CSS units in Size - #1641
Merged
Merged
Conversation
Add the container query, dynamic/large/small/logical viewport, font-relative and resolution units to the known units. Before, a value like `2cqi` was split into the number and a separate identifier, which rendered as invalid CSS and could drop whole declarations using these units inside functions in lenient mode.
JakeQZ
approved these changes
Oct 3, 2026
JakeQZ
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @felipemarcos, this looks excellent to me and good to merge.
For reference, the current list of units is at https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Values_and_units#units.
I think this is more feature than bugfix - it wasn't a bug until the new units were introduced, though I note that #1639 is also listed in the 'fixed' category. I'll create a separate PR to adjust the changelog (and add the PR number for this).
Longer term, it would be good to find a way of not having to keep updating the list of units... :)
@oliverklee, let us know if you spot anything amiss that we've missed.
JakeQZ
added a commit
that referenced
this pull request
Oct 3, 2026
Also add reference in entry for #1641.
JakeQZ
added a commit
that referenced
this pull request
Oct 3, 2026
These aren't bugfixes; they are supporting new CSS features. Also add reference in entry for #1641.
oliverklee
pushed a commit
that referenced
this pull request
Oct 4, 2026
These aren't bugfixes; they are supporting new CSS features. Also add reference in entry for #1641.
SizeSize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Size::parse()only knows the units in its hardcoded lists, so values like2cqiwere split into2andcqi. This rendered as invalid CSS, and in lenient mode it dropped whole declarations that used these units insidecalc()/min().This adds the missing units:
cqw,cqh,cqi,cqb,cqmin,cqmaxdv*,lv*,sv*variants,vi,vbcap,ic,lh,rlh,rex,rch,rcap,ricdpi,dpcm,dppx,x