-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Separator: Add borderWidth style support #23403
Conversation
height: 28, | ||
lineHeight: '24px', |
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.
Adjustments to label height. Abstracted from:
#23006
Size Change: +345 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
I just want to say that this is super helpful to be able to adjust the width (height) of the line or dots used. As the default line might be too thin and having the option to make it bigger helps. |
@ItsJonQ should this be border-width or just height? |
It would be more natural to call it height. As in how tall the line is. - Vertical. So let's say there was a control named height and another control named width. The names in themselves would then make it clear that they do. Height would make the line taller. Width would make the line broader. Expect further in horizontal directions. Another scenario with another control. Bottom line is that the Separator block can then have additional controls affecting where on the page it is located (left/center/right), how wide it is, and how tall it is. Hmm I might just have to add an issue or two or so for this. There is some work on Separator styles going on in WordPress/twentytwentyone#278 |
Btw Jon @ItsJonQ Check out this comment by @richtabor |
It's been a while since this PR was opened, and it looks like a lot has happened with the theme.json / block library settings. |
"Thickness" as the setting name might work well as well, because "height" could imply the height of the whole area the block takes (including empty space). |
I picked this up and so far adding
to border-separator.mp4The rendering has to also be updated to account for the borders. |
Doing some repository cleanup: Closing this PR as it probably needs to be redone entirely using block support anyway. |
This update adds a control for border width for the Separator block. This is achieved using the new styled hook/supports registration system and CSS variables.
Above is a GIF demo of the control working.
Note: How Separator appears to be highly dependant on a theme's CSS. For example, TwentyTwenty uses very custom CSS in order to achieve the separator designs. In order to demo this, I had to adjust a CSS value (via Chrome inspect element) to use the variable.
CSS Variable
The CSS variable for the separator border is:
Opt-in
To opt into this feature, one must add:
Feedback
cc'ing @mtias 😊 . I'd love for some feedback! Does adding this control under a "Border" panel make sense? Also... I'm unsure about the way
<hr />
are rendered by existing CSS. It seems like most users won't see the effect, unless they make some adjustments in their WordPress theme 🤔How has this been tested?
add_theme_support
in PHPnpm run dev
Checklist:
Hopes to resolve:
#20758