-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Border Support: Add support for custom border units #33315
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
packages/block-editor/src/components/border-style-control/style.scss
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.components-border-style-control { | ||
legend { | ||
line-height: 1.2; | ||
padding-bottom: $grid-unit-05; | ||
} | ||
|
||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #33280 (comment) we consolidated all units into
spacing.units
so there's no longer alayout.units
. I wonder if we can do the same here.See this specific thread for more context #33280 (comment) The concerns were that the relation between both wasn't well understood and the implementation of
UnitControl
made layout values dependant on spacing values (layout couldn't have values that spacing also had).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change this to
spacing.units
if desired. I'm not sure I follow why we wouldn't potentially want a different set of units for borders.For example, do
vh
andvw
make sense for borders? Would a theme author wish to have a different set of available units for borders as opposed to spacing?Unless I'm missing something, is it not that the supplied units had to be a subset of spacing units? That makes sense to me for borders. If you didn't want
em
orrem
for spacing, I can see them also not being desired for border units.From the linked thread, you mention there that units can only be a subset of spacing.units.
I'm also fine with a desire to simplify the handling and config of units. If the extra flexibility of different border units isn't worth the cost, I'll change this PR accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some further testing, the borders behave ok with all units. I also found I'd missed the global styles' border panel units.
Given that, I've taken the opportunity to switch everything to use
spacing.units
while updating the global styles panel.