Closed baradusov closed 1 year ago
Thank you for raising this question I was thinking to ask for a while. But why don’t we go further? I believe all the buttons could be replaced with links:
<div class="likely">
<a href="" class="facebook" aria-label="Share on Facebook">Share</a>
<a href="" class="twitter" aria-label="Tweet on Twitter">Tweet</a>
<a href="" class="vkontakte" aria-label="Share on Vkontakte">Share</a>
<a href="" class="pinterest" aria-label="Pin on Pinterest">Pin</a>
<a href="" class="odnoklassniki" aria-label="Like on Odnoklassniki">Like</a>
<a href="" class="telegram" aria-label="Send on Telegram">Send</a>
<a href="" class="linkedin" aria-label="Share on LinkedIn">Share</a>
<a href="" class="whatsapp" aria-label="Send on WhatsApp">Share</a>
</div>
Why links? Because that’s what really happening when you click those things. It’s just a link opening in another tab. Yes, it needs to be opened in a certain way, maybe as a pop-up window, maybe with some extra GET-parameters you need to get from the current page, but it’s still a link. And it could look and even function almost the same even without JS, while it’s loading or in case when it’s blocked or broken.
@pepelsbey Thanks for the additional suggestions!
I doubted <button>
is the right choice, but decided to use it, because my thought was that it is a pop-up window first. But after your clarification I agree that <a>
fit in better here.
Actually I’ve never seen Likely’s pop-ups before I wrote this issue because my browser on macOS is always in full screen split mode, so to me it’s just a target=_blank
thing.
Thank you for the suggestion, guys, we'll consider it for the upcoming version.
@NikolayRys, thanks! Please let me know once you have some code to test or even the idea how to approach this. I’ll be glad to help!
Switched to <a>
tags in 3.0, please update your version: https://github.com/NikolayRys/Likely/releases/tag/v3.0.0
Codepen example with all changes.
Adding
tabindex
,role
andaria-label
to current recommended layout withdiv
sonly making buttons accessible for navigating with
Tab
, but they ignoreSpace
orEnter
pressing, so modal window doesn't open.Because people mostly copy the default layout I suggest to change main recommended layout in "Setup" section to
or at least make changes in section about accessibility settings.
Adding
button
will break styles, so will have to changeindex.styl
a little: fromto
I think this little changes make LIkely a little bit better.
We can also remove browser's default outline and make fancier one. Remove outline:
Change colorize function:
Codepen example with all changes. If it is acceptable changes I could make PR.