Skip to content
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

Post Navigation Link: Add border and spacing block support #64258

Open
wants to merge 21 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a02df3f
Add border support to post mavigation block
akasunil Aug 5, 2024
f331538
Add box sizing style to post navigation link block
akasunil Aug 5, 2024
e9fff19
Return empty if the adjacent post is unavailable
akasunil Aug 7, 2024
6baaa15
Update comment text
akasunil Aug 7, 2024
de7485c
Merge branch 'trunk' of personal.github.com:WordPress/gutenberg into …
akasunil Aug 8, 2024
700f22c
Add spacing support to post navigation link
akasunil Aug 9, 2024
d9d51b7
Merge branch 'trunk' of personal.github.com:WordPress/gutenberg into …
akasunil Aug 13, 2024
4c25d1a
Merge branch 'trunk' of personal.github.com:WordPress/gutenberg into …
akasunil Aug 13, 2024
6aa39df
Revert changes of render function
akasunil Aug 13, 2024
0551091
Add selectors for border and spacing support
akasunil Aug 14, 2024
a14512f
Merge branch 'trunk' of personal.github.com:WordPress/gutenberg into …
akasunil Aug 16, 2024
c46823f
Remove styles from empty post navigation link element
akasunil Aug 16, 2024
f15548f
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/post-…
akasunil Sep 25, 2024
311f5d8
Skip serialization of border and spacing support
akasunil Sep 26, 2024
6404d13
Apply border and spacing support manully
akasunil Sep 26, 2024
3fca4e4
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/post-…
akasunil Sep 26, 2024
b0fdd00
Update comment texts
akasunil Sep 26, 2024
8dcec4d
Fix coding standards
akasunil Sep 26, 2024
c656936
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/post-…
akasunil Oct 3, 2024
b027a57
Fix inline support style issue
akasunil Oct 3, 2024
2654826
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/post-…
akasunil Oct 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ Displays the next or previous post link that is adjacent to the current post. ([

- **Name:** core/post-navigation-link
- **Category:** theme
- **Supports:** color (background, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** color (background, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** arrow, label, linkLabel, showTitle, taxonomy, textAlign, type

## Post Template
Expand Down
18 changes: 18 additions & 0 deletions packages/block-library/src/post-navigation-link/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,25 @@
},
"interactivity": {
"clientNavigation": true
},
"spacing": {
"margin": true,
"padding": true,
"__experimentalDefaultControls": {
"margin": false,
"padding": false
}
},
"__experimentalBorder": {
"radius": true,
"color": true,
"width": true,
"style": true
}
},
"selectors": {
"border": ".wp-block-post-navigation-link:not(:empty)",
"spacing": ".wp-block-post-navigation-link:not(:empty)"
},
"style": "wp-block-post-navigation-link"
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function render_block_core_post_navigation_link( $attributes, $content ) {

return sprintf(
'<div %1$s>%2$s</div>',
$wrapper_attributes,
! empty( $content ) ? $wrapper_attributes : "class=\"post-navigation-link {$classes}\"",
$content
);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/post-navigation-link/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.wp-block-post-navigation-link {
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;

.wp-block-post-navigation-link__arrow-previous {
display: inline-block;
Expand Down
Loading