A few days/weeks ago, some of my sites' twitter widgets stopped pulling through data properly. Turns out Version 2 twitter widget is deprecated, and the new embedded timeline widget is the only way to go, apparently.
https://dev.twitter.com/blog/planning-for-api-v1-retirement
Except this new widget creates an iframe, which prevents any custom styling of the widget from within my own stylesheets - such as setting the font family, font size, colours, etc.
Is there a workaround? From what I'm reading, you can't apply / inject styles into an iframe, and I can't find any API-way of doing it.
I'd also like to limit the widget to just the 3 most recent tweets; not sure if that's possible anymore, and to remove the vertical scroll bar (probably related to limiting the tweets).
You can import twitter-widget.js javascript in your own project, then modify some styling from within this .js file.
After, you invoke it instead of invoking the twitter's site library
//your.ownsite.web/widgets.js
. It is actually working, but no guaranties for the future.In the .js, look for this block of code :
I've found that you can use document ready without the settimeout, provided you wrap the widget in a container. This should trigger not only on page load, but on any dynamic content changes in the timeline itself after page load.
Otherwise, I agree with a-gorsky regarding adding a stylesheet into the iframe rather than making the style changes to every element.
Go to this site and download this plugin, then you can style in anyway you chose Jason Mayes
If you take a look at widgets.js and look for this line:
You can copy timeline.css and modify both files however you like.
I can at least help with limiting the tweets and removing the scroll bar.
From the documentation:
And
Still looking at the styling.
See "client side options" here. But basically, you can slap the whole thing in a styled div, remove the header & footer & make the background transparent. I'm personally still searching for a way to limit the number of tweets & get rid of the user icon.
Here's our code (Drupal block): ok, I can't get the code to show nicely.