How to change font type in twitter.com widget?

Aouni picture Aouni · May 23, 2013 · Viewed 21.1k times · Source

I have some basic knowledge in coding, most of which I learned through reading.

I'm using wordpress for my website. Now I like the official twitter widget but the only downside for it is the limited options of styling.

I've checked the available styling options, but couldn't find any which allows me to change the font size.

So I thought I'd try to import the javascript file ( here: http://platform.twitter.com/widgets.js ) and see if I can change anything in it. So I searched for "font" and edited the default font in the file then uploaded it to my website, but it didn't affect how the font appears.

Is there a simple way to enforce changing the predefined css of the widget?

Answer

Dominic Tancredi picture Dominic Tancredi · Jul 8, 2013

The only solution I found with Twitter's Enhanced Timeline is to use javascript to modify the css after the iframe has loaded.

Needed to use window.setTimeout for it.

window.setTimeout(function(){
    $(".twitter-timeline").contents().find(".e-entry-title").css("font-family","sans-serif");
    $(".twitter-timeline").contents().find(".tweet").css("font-family","sans-serif");
  }, 1000);

I'm not saying I'm "proud" of using setTimeout, but when my wife wants a styled Twitter's widget for her site, she GETS a styled Twitter widget.