Ensure that we test every value for the length
datatype
#6283
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.
This PR will improve the matching of the
length
data type.The issue is that we are basically validating if
center_top_1rem
is a valid data type. According to our definition, this is the case. The regex tests against(?:cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax)$
and it happens to be that we end in1rem
which is valid.However, this is not enough so we could potentially check that it also start with a number. But this will break examples where we have
1rem_2rem
.Instead, we will split by underscores (except if they are inside brackets
[
and]
) and validate each part of it.This should result in the fact that
1rem_2rem_3rem
is valid, butcenter_1rem
is not.