isomorphic-git / isomorphic-git.github.io

Project website and documentation
https://isomorphic-git.org
1 stars 27 forks source link

Buttons.js set body white-space to nowrap and it breaks Firefox #24

Closed TomasHubelbauer closed 6 years ago

TomasHubelbauer commented 6 years ago

On top of that the GitHub button ends up being visually broken too in FF.

I'll investigate if this is a (known?) issue with them or if we can work around it.

billiegoose commented 6 years ago

Is this the little # of github stars widget? I'm sure we could find a better one than the "official" github one.

TomasHubelbauer commented 6 years ago

image

Yeah. It's text is white and it also downloads buttons.css asynchronously which messes with the body.

TomasHubelbauer commented 6 years ago

This might be nice, it uses the user's IP to talk to the GitHub rate-limited API to get the stars. We could rebuilt the design statically and just load in the number. And if the rate limit is exceeded, it's just for that user.

I'll spike that and if it looks okay will suggest we migrate to it.

TomasHubelbauer commented 6 years ago

Woot I just noticed Zeit covered the surprise charge, I'm super duper glad for that! πŸŽ‰ πŸ˜ƒ

billiegoose commented 6 years ago

HA!

HTMLElement.prototype.attachShadow)

It's the same issue as https://github.com/isomorphic-git/isomorphic-git.github.io/issues/19. They're attempting to use the Shadow DOM.

TomasHubelbauer commented 6 years ago

Yup. #19 works for me as it probably just doesn't pull any styles and the rest of the shadow DOM features works in latest FF. Maybe it can be worked around by !importanting (yeah I said it) the white-space on our end so they can't break it and then we can just wait out proper shadow DOM support so it fixes itself in time.

billiegoose commented 6 years ago

@TomasHubelbauer Let's build our own Github Star Count!

I've simplified and modernized stretchr/github-stars. Here we are:

githubStars = async (repo) =>
  (await fetch(`https://api.github.com/repos/${repo}',
  {headers:{accept:'application/vnd.github.v3+json'}}).then(x => x.json())).stargazers_count
TomasHubelbauer commented 6 years ago

LOL we don't even need to !imporant it because attribute style beats the weakass stylesheet file rule. I'll add it.

TomasHubelbauer commented 6 years ago

Sure I'll do that in a separate PR and fix the overflow with the trick above first.

TomasHubelbauer commented 6 years ago

πŸ€¦β€β™‚οΈ (No need to fix this since we are going to be replacing GitHub buttons… Don't mind me…)

billiegoose commented 6 years ago

I mean... we could try to fix Github's CSS. But they have all the resources of Microsoft and they still make a bloated Buttons.js that could easily have a tracker in there for all we know.

TomasHubelbauer commented 6 years ago

It's an unofficial 3rd party thingy, not GitHub's own CSS (but that only reinforces the point about it containing a tracker for all we know).

billiegoose commented 6 years ago

Docusaurus uses React, so if you know React you could make a little React component.

Or we could just file the issue on ... wait it is? (double checks) oh mtsdfkljer. You're right LOL. It's just a github.IO page

billiegoose commented 6 years ago

Well heck, let's just open an issue there

billiegoose commented 6 years ago

It looks like the Shadow DOM thing was added less than 24 hours ago.

billiegoose commented 6 years ago

So I propose we sit on our butt for a day and see if somebody else will fix this problem. 😁 hint hint button breaker

billiegoose commented 6 years ago

Unless you feel like making your own. πŸ‘Œ

billiegoose commented 6 years ago

Eh... IDK it is really broken. πŸ€• I think I'll yank the Github Stars widget temporarily.

TomasHubelbauer commented 6 years ago

Give me 5 to learn Docusaurus and add our own counter - still good you filed the issue with them though you'll save other sites!

billiegoose commented 6 years ago

πŸ‘ Alright, I'm hands off! If it doesn't work out, you can merge the backup plan.

billiegoose commented 6 years ago

image

I actually like this even better than what we had before! It's got a consistent look & feel with the other links.