-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Share button updates #2285
base: main
Are you sure you want to change the base?
Share button updates #2285
Conversation
patphg
commented
Apr 23, 2024
- Hides the share API button until support is detected instead of hiding after
- Changes FontAwesome CSS icon elements to HTML for SVG swapping
- Improvements to A11y of share buttons
- Adds X to the array of detected social names
* Hides the share API button until support is detected instead of hiding after * Changes FontAwesome CSS icon elements to HTML for SVG swapping * Improvements to A11y of share buttons * Adds X to the array of detected social names
@@ -213,30 +213,23 @@ body.admin-bar {scroll-padding-top: 32px;} //Account for the admin bar height wh | |||
//Nebula social share buttons | |||
a.nebula-share-btn {display: inline-block; padding: 5px 7px; border-radius: 3px; font-size: rem(12px); line-height: 1; color: #fff !important; text-shadow: 1px 1px rgb(0 0 0 / 25%); margin-right: 5px; | |||
&:last-child {margin-right: 0;} | |||
&::before {font-family: "Font Awesome 5 Brands"; margin-right: 4px; text-shadow: none;} |
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.
} | ||
|
||
if ( in_array($network, array('facebook', 'fb')) ){ | ||
echo '<a class="nebula-share-btn facebook" href="http://www.facebook.com/sharer.php?u=' . $encoded_url . '&t=' . $encoded_title . '" target="_blank" rel="noopener">' . __('Share', 'nebula') . '</a>'; | ||
echo '<a class="nebula-share-btn facebook" href="http://www.facebook.com/sharer.php?u=' . $encoded_url . '&t=' . $encoded_title . '" target="_blank" rel="noopener" title="Share on Facebook"><i class="fa-brands fa-facebook me-1"></i>' . __('Share', 'nebula') . '</a>'; |
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.
Only note here is lets wrap the titles in translation functions so instead of:
title="Share on Facebook"
use:
title="' . __('Share on Facebook', 'nebula') . '"