Skip to content

Share button updates - #2285

Open
patphg wants to merge 1 commit into
chrisblakley:mainfrom
patphg:share-button-updates
Open

Share button updates#2285
patphg wants to merge 1 commit into
chrisblakley:mainfrom
patphg:share-button-updates

Conversation

@patphg

@patphg patphg commented Apr 23, 2024

Copy link
Copy Markdown
Contributor
  • 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
@patphg
patphg requested a review from chrisblakley as a code owner April 23, 2024 14:13
Comment thread assets/scss/partials/_helpers.scss Outdated
//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
Copy Markdown
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

Comment thread libs/Functions.php
//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
Copy Markdown
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.

2 participants