-
Notifications
You must be signed in to change notification settings - Fork 360
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
Blockbase: Add social navigation to blockbase themes #4482
Conversation
7f0e7f6
to
b97a262
Compare
I rebased this now that #4468 is merged. Seedlet and Mayland look okay, but I have two questions about Blockbase and Quadrat:
One option is adding a
|
@kjellr, do you have any thoughts on this? |
For desktop, I think we should do that. In general, this should look like the Quadrat screenshot above, but with more margin in between the nav + the social links: The right margin should be equal to the gap between nav items.
This is another example of where we would ideally put these in the expanded hamburger menu. Part of me wonders if we should hack some temporary jQuery in there to move it there on small screens. 😅 Let me think about this on a little and get back to you later today/tomorrow. |
@@ -11,6 +11,8 @@ | |||
<!-- wp:navigation {"itemsJustification":"center","isResponsive":true,"__unstableLocation":"primary"} --> | |||
<!-- /wp:navigation --> | |||
|
|||
<!-- wp:navigation {"orientation":"horizontal","itemsJustification":"center","isResponsive":true,"__unstableLocation":"social"} --><!-- /wp:navigation --> |
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.
For Seedlet, let's use a default icon color of black (the foreground color) to match the social menu color in the classic version of the theme.
@melchoyce @beafialho what do you think of these options for social links placement on small screens in Blockbase and Quadrat? None of them seem ideal to me, so I've also offered a plea for a better solution in the issue here. |
I think the best and less invasive option is definitely the top middle one, it makes most sense for the social icons to be beneath the hamburger. The lines add way too much noise to the top area (in this case, where these themes don't use them anywhere else). I agree that the solution you propose in the Navigation block issue should be possible as a default. |
b97a262
to
a0c7bbe
Compare
I updated the approach here - now the social navigation gets appended to the primary navigation block. This means that it gets wrapped by the hamburger menu when in smaller screens. We probably need some CSS to fix the alignments of the social menu, but I'm curious to get feedback on the approach before we do that. |
I really like the approach. I kind of would prefer to have a secondary attribute to key on for appending the social menu to the block. But presently I think maybe that's something the feature potentially could grow into rather than start at. It feels like the cleanest way to achieve the design target. Only beef I have with the code is a preference to move the menu rendering stuff to another file. |
Good idea, done! |
I'm getting this error when I apply this branch and go to the customizer and add a social menu to the "Social" location:
|
blockbase/inc/social-navigation.php
Outdated
|
||
// We should only change the render of the navigtion block | ||
// to social links in the following conditions. | ||
function blockbase_condition_to_render_social_menu( $block ) { |
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.
A theme may want to define a menu that follows these conditions to show up in the footer too for example, or a pre-footer template part. In some cases we may want to have the social navigation but maybe not always. The perfect example of this is actually Skatepark, with this PR in place, this is what I see when I insert the pre footer block pattern:
8dfa0a4
to
d5afbd0
Compare
Fixed in 21c1ed4 |
This turned out to be a very good idea, as it means we can control which menus the links get appended to, as I have done in 3a9f0f5. If y'all like this approach we can add it to the header nav in all blockbase themes. |
3e5cc86
to
03f6a10
Compare
I fixed the fatal, so you should be able to test now. This revealed one shortcoming of this approach - if the primary navigation location is empty then no navigation is output, even if something is set in social... |
Yes! no more errors for me. Now that we have |
Hi all, I've been testing the current social menu implementation in trunk with a local child theme and it seems to work well. Only concern I have is that (unlike item justification) it's not possible to change/unset icon color and icon size. Is this feature considered already, and if so, is anybody working on that? If not, I could work on a proposal... |
Does it work to set icon color and size in the theme.json? |
@scruffian, I tried that but do not think it is possible with this block... IS there any documentation on Social Icons specifically? |
I think we'll need something like this for that to work. |
For now I think we'll have have to make this a setting for the theme... |
Pushed a small change with regard to @MaggieCabrera 's comment. No longer requires the parent container to be parent menu; __unstableSocialLinks on a navigation block is the only requirement. Holds true for having content; when there is no content the social links are provided (rather than appended) eliminating the need for the empty() check (and allowing the 'social links' menu target to be exclusively targeted as such:
I think the existing color management (leveraging Otherwise (IMO) this change is good-to-go once the appropriate changes have been made to all of the child themes to both add (and style) the social links. |
…or even have content)
f68b2f6
to
4f6db5b
Compare
I have now added social nav to all Blockbase themes, and updated the CSS to accommodate the new navigation. I have updated the screenshots in the PR description This should also fix #4590 |
…ay that the navigation block works
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.
Boom!
All the themes look great. Seems like a great ponyfill to get things into place.
Diggit
Shippit
Changes proposed in this Pull Request:
This adds social navigation to all Blockbase themes:
Seedlet blocks
Mayland Blocks
Geologist
Quadrat
Blockbase:
Skatepark