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

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

Closed
TomasHubelbauer opened this issue Jul 5, 2018 · 21 comments
Closed
Assignees

Comments

@TomasHubelbauer
Copy link
Member

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.

@TomasHubelbauer TomasHubelbauer self-assigned this Jul 5, 2018
@billiegoose
Copy link
Member

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

@TomasHubelbauer
Copy link
Member Author

image

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

@TomasHubelbauer
Copy link
Member Author

TomasHubelbauer commented Jul 5, 2018

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
Copy link
Member Author

TomasHubelbauer commented Jul 5, 2018

Woot I just noticed Zeit covered the surprise charge, I'm super duper glad for that! 🎉 😃

@billiegoose
Copy link
Member

HA!

HTMLElement.prototype.attachShadow)

It's the same issue as #19. They're attempting to use the Shadow DOM.

@TomasHubelbauer
Copy link
Member Author

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
Copy link
Member

@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
Copy link
Member Author

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

@TomasHubelbauer
Copy link
Member Author

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

@TomasHubelbauer
Copy link
Member Author

🤦‍♂️ (No need to fix this since we are going to be replacing GitHub buttons… Don't mind me…)

@billiegoose
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member

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
Copy link
Member

Well heck, let's just open an issue there

@billiegoose
Copy link
Member

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

@billiegoose
Copy link
Member

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
Copy link
Member

Unless you feel like making your own. 👌

@billiegoose
Copy link
Member

Eh... IDK it is really broken. 🤕
I think I'll yank the Github Stars widget temporarily.

@TomasHubelbauer
Copy link
Member Author

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
Copy link
Member

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

@billiegoose
Copy link
Member

image

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

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

No branches or pull requests

2 participants