Set <body> max-width

    @@ -17,6 +17,8 @@ background: '#555' }); Object.assign(document.body.style, { + background: '#fafafa', + color: '#333', padding: '1em 3em' }); }
  • /*
     * @title Set <body> max-width
     * @description eh, too wide paragraphs... :/
     * @include *
     * @license MIT License
     * @javascript_url 
     */
    
    (function(){
      Object.assign(document.body.style, {
        maxWidth: prompt('body width', '22cm'),
        marginLeft: 'auto',
        marginRight: 'auto'
      });
      if (confirm('darken background (and etc.)?')) {
        Object.assign(document.documentElement.style, {
          background: '#555'
        });
        Object.assign(document.body.style, {
          background: '#fafafa',
          color: '#333',
          padding: '1em 3em'
        });
      }
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/06/07 19:04:14 - 2018-06-07
  2. 2018/02/10 18:59:36 - 2018-02-10
  3. 2018/02/10 18:58:38 - 2018-02-10
  4. 2018/02/10 18:46:21 - 2018-02-10