-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Social Link: Add border and spacing support #63782
base: trunk
Are you sure you want to change the base?
Changes from 6 commits
f76ea75
0d025ce
f7eaf6a
789b27b
0861737
b252dd1
c6aa0b3
0516af5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,27 @@ | |
"html": false, | ||
"interactivity": { | ||
"clientNavigation": true | ||
}, | ||
"spacing": { | ||
"margin": true, | ||
"padding": true, | ||
"units": [ "px", "em", "rem", "vh", "vw" ], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need custom definitions of available spacing units here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess not. |
||
"__experimentalDefaultControls": { | ||
"margin": false, | ||
"padding": false | ||
} | ||
}, | ||
"__experimentalBorder": { | ||
"radius": true, | ||
"color": true, | ||
"width": true, | ||
"style": true, | ||
"__experimentalDefaultControls": { | ||
"radius": true, | ||
"color": true, | ||
"width": true, | ||
"style": true | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the dimension controls aren't displayed by default, the border controls shouldn't be either. |
||
} | ||
}, | ||
"editorStyle": "wp-block-social-link-editor" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,8 +91,6 @@ | |
// This needs specificity because themes usually override it with things like .widget-area a. | ||
.wp-block-social-links .wp-block-social-link.wp-social-link { | ||
display: inline-block; | ||
margin: 0; | ||
padding: 0; | ||
Comment on lines
-94
to
-95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the thinking behind removing these resets? My understanding was they should be tweaked to lower the specificity so global styles could be applied. Was there an unexpected issue when doing so? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we move these style to social link block? Global style would be able to override that style. Another solution is we can add selector in social link block for spacing styles. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this might need some further thought. The Social Link block contains a clickable button or link depending on whether the user is in the editor or frontend. It would make sense to me that any padding added for a link would be on that inner button or link so it is taken into account for the clickable area. The same could be said for the border too. This would likely mean, leaving the styles here untouched and skipping serialization for the border and padding support. Then manually applying the support styles on the appropriate inner element. |
||
|
||
.wp-block-social-link-anchor { | ||
&, | ||
|
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'm not sure how useful allowing margin support on individual links is. My understanding of the social links block is that spacing should be handled via the parent Social Links block's block spacing support.