ゼロベース社長ブログを読みやすくする

http://zerobase.jp/blog/


すごい毎回面白そうな記事で、わーっと楽しみになるけど、
line-height が狭くて読み気がかなり萎えるので、userscripts を書いた。
すごい簡単かつ単純。ただ読みやすくするだけ。自分用丸出し。
こういうのこそ、User Stylesheet を使うべきなんだろうなー。

// ==UserScript==
// @name           zerobase_blog_restyled.user.js
// @namespace      http://d.hatena.ne.jp/bannyan/
// @description    ゼロベース社長ブログを読みやすくする
// @include        http://zerobase.jp/blog/*
// ==/UserScript==

(function () {

    var isIE = function() {
        return /*@cc_on!@*/false;
    };

    var setStyle = function(spec, my) {
        my = my || {};

        my.element     = spec.element;
        my.declaration = spec.declaration;

        if (isIE()) {
            my.element.style.cssText = my.declaration + ";";
        } else {
            my.element.setAttribute("style", my.declaration);
        }
    };

    var div  = document.getElementById('alpha-inner');
    var p    = document.getElementsByTagName('p');

    setStyle({
        element     : div,
        declaration : "line-height: 2.0; font-size: 14px"
    });

    for (var i = 0; i < p.length; i++) {
      setStyle({
          element     : p[i],
          declaration : "margin-bottom: 35px"
      });
    }

})();