Google search "old style"

Fix style in google search results page

Verze ze dne 22. 01. 2020. Zobrazit nejnovější verzi.

/* ==UserStyle==
@name         Google search "old style"
@namespace    https://github.com/Procyon-b
@version      1.0.5
@description  Fix style in google search results page
@author       Achernar
@license      CC BY-NC 4.0
@preprocessor stylus

@var checkbox hide-favicon 'Hide favicons' 1
@var checkbox invert-lines 'Invert lines' 1
@var checkbox font-size    'Reduce results font size' 1
@var range    font-sizeV   'size' [0.9, 0.7, 1, 0.01]
@var checkbox get-ws       'Recover whitespace' 0
@var checkbox head-mg      'Title margin' 1
@var range    line-h       "Text's line height" [1.57, 1.0, 1.7, .01]
@var range    bottom-mg    'Bottom margin' [27, 0, 30, 1, 'px']
==/UserStyle== */
@-moz-document regexp("^https:\\/\\/www.google\\..*?\\/search\\?.*") {
/* version 20200121.2200 v1.0.5 */

/* reduce result blocks font size */
if font-size {
  .g {
    --font-sizeV: font-sizeV;
    --sz-norm: 14px;
    --sz-gblk: 16px;
    --margin-b: 27px;
    /*zoom: 90%;*/
    zoom: font-sizeV;
  }
  @supports (-moz-appearance: none) {
    .g {
      font-size: calc(var(--font-sizeV) * var(--sz-norm));
      margin-bottom: calc(var(--font-sizeV) * var(--margin-b)) !important;
    }
    .g.g-blk span > span {
      font-size: calc(var(--font-sizeV) * var(--sz-gblk));
    }
    .g cite {
      font-size: calc(var(--font-sizeV) * var(--sz-norm));
    }
    .g h3 {
      font-size: calc(var(--font-sizeV) * 20px) !important;
    }
  }
}

/* hide result favicon */
if hide-favicon {
  .g img[height="16"][src*="data:image"][width="16"] {
    display: none;
  }
}

/* invert the 2 lines */
if invert-lines {
  .g .r > a {
    display: inline-flex;
    flex-flow: column;
  }
  .g .r > a > h3 {
    order: 0;
  }
  .g .r > a > div+br,
  .g .r > a br {
    display: none;
  }
  .g .r > a > div:first-child {
    order: 2;
    top: -0.5em;
    position: relative;
  }
  .g .r > a > div:first-child * {
    color: green !important;
  }
  .g .r > a > div:first-child cite {
    display: inline-block !important;
  }
  .r > div {
    position: relative; 
    top: -2.1em;
  }
}

/* whitespace */
if get-ws {
  if head-mg {
    .g .r {
      margin-bottom: -7px;
    }

  }
  if line-h != 1.57 {
    .g .st, .g .s > div {
      line-height: line-h;
    }
  }
  if bottom-mg != 27px {
    .g {
      --margin-b: bottom-mg;
      margin-bottom: bottom-mg;
    }
  }
  
}

/* to prevent the userstyle from disappearing from stylus menu when all options are disabled */
.none {
  dummy:1;
}

}