-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Default CSS preventing embedded tweets from having transparent borders #6889
Comments
The tweet is embedded using an ![]() I could not find anything on the embedded tweet parameter reference that would change the background of the iframe. Not sure if it is possible to do from outside as the browser security model should prevent this? Unless you can convince Twitter to put a dark themed embedded tweet into an iframe with a dark background, I am afraid you may be stuck. That said, I am not an expert on matters of web design, so there is a chance I have missed a trick. |
@perpil is right – it does not happen with the ![]() |
This line is causing the problem:
If you remove the declaration, borders are transparent. I'm not sure why. This might be a bug in or an interference with Twitter's CSS. We should not remove the ![]() |
Thanks for the quick work, I tested it and it does indeed resolve it for the repro I attached, but when you set a palette, it doesn't. You can repro by toggling to dark mode with what I attached. Is there a fix that works if for all scenarios? |
Hmm, indeed, very strange. I'd expect that |
I'm on the insiders version, can you push it there too? |
I just did, could you please check |
I have not tested Firefox. I'll look into it again. This is really weird... |
I think it's fixed with 750b798 (already on Insiders). |
That did it! Thanks! |
Released as part of 9.5.14. |
The changes had another side effect – now Giscus rendering is broken in Chrome. I'm not yet sure how we can ensure that both work. It seems to be an inconsistency between Chrome and Firefox. |
I'm sorry, but we have to revert the changes we made to fix the issue mentioned here. The reason is that I currently see no way forward to fix this in a general fashion. If we apply ![]() Twitter expects us to set For this reason, I decided to revert the changes we made in 750b798 until a better solution is found. I'm quite at the end of ideas how to support borderless arbitrary iframes. If somebody cooks up a solution, please create a PR! |
The ideal solution would be Twitter's CSS setting the value on the |
Is it possible to override the |
Yes, of course, this should do the trick: .twitter-tweet iframe {
color-scheme: light;
} |
Ok that's a good enough workaround for me if you don't want to pollute the main css with it, I tested it and it works in FF and Chrome, thanks! |
Perfect, thanks! Sorry for the inconvenience this is causing, but I hope my explanation made sense and outlines that the situation is tricky, to say the least. |
Context
I'm trying to embed a tweet into my site. In dark mode, borders on a tweet show up as white and not transparent. It has something to do with material css. If I create a blank html page with a dark background and embed a tweet the corners look fine. I cut this as a discussion originally but it also happens on the mkdocs material site. I have been unable to pinpoint which piece of material CSS is causing this.
Bug description
Material's CSS is causing corners on embedded tweets to look bad in dark mode when they are rendered.
Related links
Reproduction
9.5.13+insiders.4.53.1-css-twitter-embed-corners.zip
Steps to reproduce
Browser
No response
Before submitting
The text was updated successfully, but these errors were encountered: