fix(declaration-converters-mapping): fix border shorthands, improves border-width, and fixes border arbitrary values #24
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.
Supports border shorthand when some of its values are missing (width, style, color)
Description of change
The way
border
shorthand was being converted, it was always expecting a perfect value, in order, and nothing missing:width style color
. But sometimesborder
doesn't come with width, or style, or color - and it's still valid CSS. Or it could be on a completely different order, likecolor width style
.Example:
was converting to:
now converts to:
Fixes #26
It now also properly handles border-width arbitrary value. It used to convert
border-width: 4.5em
toborder-[4.5em]
which is wrong (that is for border-color), now it converts toborder-w-[4.5em]
and it's quite smart and convertsborder-width: 1px 2px;
toborder-y border-x-2
Fixes +1: #25