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

Share button updates #2285

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

patphg
Copy link
Contributor

@patphg 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;}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the encoded before content, the icons do not appear for me:
Screen Shot 2024-04-23 at 10 20 20 AM

Compared to when I add them back (by reverting to previous):
Screen Shot 2024-04-23 at 10 21 41 AM

}

//Facebook
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>';
Copy link
Owner

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') . '"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants