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.
Edit: This PR is fairly big and contains multiple scopes, so I will be splitting this PR into multiple PR's!
PR 1: #5585
PR 2: #5587
PR 3: #5590
PR 4: #5588
This PR will improve arbitrary value support for various plugins. I had to introduce a few more typehints, the names can still be changed if we want to!
Here are the changes to various plugins:
Background images
Added an
url
typehint, that checks for theurl
prefix.Input:
Output:
Background size & background position
Both
background-size
andbackground-position
can acceptlength
values like200px 100px
. This means that this is ambiguous, for this reason I introduced asize
andposition
typehint.Input:
Output:
Font family & font weight
Font families and font weights can be ambiguous but they aren't always. For example,
font-[300]
is a font-weight because you can't have afont-family
of value300
. Howeverfont-[black]
can both refer tofont-family: black;
andfont-weight: black;
For this reason I introduced
family
andweight
typehints.Input:
Output:
Outline
The outline plugin can be configured as an array in the config, therefore I mimicked this behaviour in the arbitrary value support for this plugin as well. The first argument will be the
outline
, the second argument will be theoutline-offset
which defaults to0
.Input:
Output: