Vectorman007

Wikipedia max-width fix v1.2

Oct 1st, 2020 (edited)
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 12.30 KB | None | 0 0
  1. @namespace url(http://www.w3.org/1999/xhtml);
  2.  
  3. @-moz-document domain("fr.wikipedia.org"), domain("eu.wikipedia.org"), domain("he.wikipedia.org"), domain("fa.wikipedia.org"), domain("fr.wiktionary.org"), domain("pt.wikiversity.org"), domain("office.wikimedia.org") {
  4. /*
  5.   Version: 1.2
  6.  
  7.   *** INSTALL NOTICE ***
  8.  
  9.   This CSS has been tested in Pale Moon and Waterfox Classic. It might work
  10.   flawlessly in Firefox, but will very likely have bugs in a Chrome-type
  11.   browser. Code suggestions are welcome.
  12.  
  13.   You can copy this code starting from line 3 ("@-moz-document ...") into
  14.   your user.css file in a Firefox-type browser. (More technical but doesn't
  15.   require addons)
  16.  
  17.   You can also install a userstyles addon and install this code in it as a
  18.   new user style. (Less technical but requires installing addons)
  19.  
  20.   Recommended user styles addons are Stylus for Firefox and Waterfox Current,
  21.   Stylem for Palemoon, Stylish 2.1.1 for Waterfox Classic. Stylish 2.1.1 can
  22.   be downloaded via Classic Addons Archive, and auto-updating Stylish should
  23.   be disabled as newer versions contain spyware.
  24.  
  25.   NOTE v1.2:
  26.   - Added removal of max-width for all beta websites. On most of them it
  27.     introduces some bugs. I'll fix them eventually. If you prefer the
  28.     width-limited to the bugged version, simply edit line 3 of this
  29.     script ("@-moz-document...") and remove the domain(s) that look bad.
  30.  
  31.   NOTE v1.1+:
  32.   - If having problems with horizontal scrolling, remove this text:
  33.         body {
  34.           overflow-x: hidden;
  35.         }
  36.   - There are some unfixed cosmetic problems with the footer
  37.  
  38.  
  39.   *** POST INSTALL INSTRUCTIONS ***
  40.  
  41.   PALE MOON, WATERFOX CLASSIC
  42.     You're good to go.
  43.  
  44.   FIREFOX, CHROMIUM, CHROME, OPERA, EDGE, IE
  45.     Not tested, will probably work to some degree or fully.
  46.     Please report if it works. Suggestions to make the fix work with these
  47.     and other browsers are welcome!
  48.  
  49.  
  50.   *** COMMENTS, SUGGESTIONS, BUG REPORTS & FIXES ***
  51.  
  52.   Feel free to send suggestions for improvement, code suggestions, bug
  53.   reports, ideas how to fix bugs and other comments to my e-mail or preferably
  54.   to my talk page on MediaWiki:
  55.  
  56.   <https://www.mediawiki.org/wiki/User_talk:Vectorman007>
  57.  
  58.   I'm not a professional web developer, merely a (hopefully talented) amateur.
  59.   I've decided to fully revert to "Legacy" Vector because when removing
  60.   max-width text, the sidebar gets in the way of article text in a way that I
  61.   don't know how to fix. Unfortunately some things are still broken, such as
  62.   the blue border of the "Article" button. Help will be much appreciated.
  63.  
  64.   For any accepted contributions, the contributor will retain copyright.
  65.  
  66.   Please donate to Free Software Foundation, World Wildlife Fund, Wikipedia
  67.   or Amnesty International if you wish to help out my causes.
  68.  
  69.  
  70.   *** CHANGELOG ***
  71.  
  72.   1.2: Support for Basque Wiki. Max-width removed on Hebrew, Persian Wiki,
  73.        French Wiktionary, Portuguese Wikiversity and Office Wiki, but with
  74.        bugs for now.
  75.        Fixed history page.
  76.   1.1: Fix for sidebar rendering on top of the article text and other changes
  77.   1.0: Original version
  78.  
  79.  
  80.   *** LICENSE ***
  81.  
  82.   Parts of this code, license text and accompanying notices that have been
  83.   contributed by Vectorman are (c) 2020 Vectorman.
  84.   All rights reserved unless noted otherwise below.
  85.  
  86.   By installing, using, reproducing, distributing, modifying, or scrolling
  87.   past the license notice, you agree to the terms of this license.
  88.  
  89.   You may install, reproduce, distribute and/or modify this code under the
  90.   conditions that i) it retains this license notice intact, and ii) the
  91.   resultant code does not restrict the width of text to any fixed amount or
  92.   to less than 80% of the screen width at 1920px wide or wider displays.
  93.  
  94.   You may not sell this code, nor charge for reproduction and/or distribution
  95.   thereof; this applies to any manner of distribution, sale and/or
  96.   reproduction, including but not limited to being part of other software,
  97.   being part of a web document, or offered as a paid web service. You may not
  98.   request donations for distributing this code.
  99.  
  100.   Any part of this license may be waived, and rights may be granted at
  101.   author's discretion. If any part(s) of this license is/are null and void, or
  102.   otherwise unenforceable, the enforceable part(s) shall hold regardless.
  103.   Any parts that have not been contributed by Vectorman, should they
  104.   exist, are copyright by their rightful owners.
  105.  
  106. */
  107.   .skin-vector-max-width .mw-content-container {
  108.     max-width: none !important;
  109.     padding: 0;
  110.     }
  111.   .skin-vector-max-width .mw-workspace-container {
  112.     max-width: none !important;
  113.     padding: 0;
  114.   }
  115.   .skin-vector-max-width .mw-sidebar-container {
  116.     left: -162px;
  117.   }
  118.   .skin-vector-max-width .mw-page-container {
  119.     margin-left: 177px;
  120.     max-width: none !important;
  121.         margin-top: -1px;
  122.    border-top: 1px solid #a7d7f9 !important;
  123.     border-right: 1px solid #a7d7f9 !important;
  124.     border-left: 1px solid #a7d7f9 !important;
  125.     border-top-width: 1px;
  126.     border-right-width: 0px;
  127.     border-bottom-width: 0px;
  128.     border-left-width: 1px;
  129.     border-top-style: solid;
  130.     border-right-style: solid;
  131.     border-bottom-style: solid;
  132.     border-left-style: solid;
  133.     border-top-color: rgb(167, 215, 249);
  134.     border-right-color: rgb(167, 215, 249);
  135.     border-bottom-color: rgb(167, 215, 249);
  136.     border-left-color: rgb(167, 215, 249);
  137.     -moz-border-top-colors: none;
  138.     -moz-border-right-colors: none;
  139.     -moz-border-bottom-colors: none;
  140.     -moz-border-left-colors: none;
  141.     border-image-source: none;
  142.     border-image-slice: 100% 100% 100% 100%;
  143.     border-image-width: 1 1 1 1;
  144.     border-image-outset: 0 0 0 0;
  145.     border-image-repeat: stretch stretch;
  146.     border-left: 1px solid #a7d7f9 !important;
  147.   }
  148.   .skin-vector-search-header-legacy #mw-sidebar-checkbox:not(:checked) ~ .mw-header .mw-sidebar, .skin-vector-search-header #mw-sidebar-checkbox:not(:checked) ~ .mw-workspace-container .mw-sidebar {
  149.     visibility: visible;
  150.     opacity: 100;
  151.   }
  152.   .mw-logo {
  153.     transform: translateX(39px);
  154.     display: block;
  155.   }
  156.   .skin-vector-max-width {
  157.     background-color: #f6f6f6;
  158.   }
  159.   #mw-panel {
  160.     border-right: inherit !important;
  161.     background-color: inherit !important;
  162.     background-image: none !important;
  163.   }
  164.   .mw-logo-icon {
  165.     display: block;
  166.     width: 160px;
  167.     height: 160px;
  168.     padding-left: 160px;
  169.     -moz-box-sizing: border-box;
  170.     box-sizing: border-box;
  171.   }
  172.   .mw-logo-container {
  173.     display:none;
  174.   }
  175.   #mw-sidebar-button::before, #mw-sidebar-button::after, #mw-sidebar-button {
  176.     visibility: hidden; display:none;
  177.   }
  178.   .skin-vector-search-header-legacy #mw-panel {
  179.       top: 9.6875em;
  180.   }
  181.   #mw-page-base {
  182.     background-color: #fbfbfb;
  183.     background-image: -webkit-gradient(linear,right top,right bottom,color-stop(50%,#ffffff),color-stop(100%,#f6f6f6));
  184.     background-image: -webkit-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
  185.     background-image: -moz-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
  186.     background-image: linear-gradient(to bottom,#ffffff 50%,#f6f6f6 100%);
  187.     background-position: bottom left;
  188.     height: 5em;
  189.     margin-left: -193px;
  190.     padding-left: 193px;
  191.  }
  192.   .vector-menu-tabs li {
  193.     background-image: url(/w/skins/Vector/resources/skins.vector.styles/images/tab-normal-fade.png?1cc52);
  194.     background-image: linear-gradient(to top,#77c1f6 0,#e8f2f8 1px,#ffffff 100%);
  195.     background-position: left bottom;
  196.     background-repeat: repeat-x;
  197.     float: left;
  198.     display: block;
  199.     height: 100%;
  200.     margin: 0;
  201.     padding: 0;
  202.     line-height: 1.125em;
  203.     white-space: nowrap;
  204.   }
  205.   .skin-vector-max-width.skin-vector-search-header-legacy .mw-article-toolbar-container {
  206.     margin-top: 2.48em;
  207.   }
  208.   .skin-vector-max-width .mw-page-container {
  209.       padding: 0 0px !important;
  210.   }
  211.   .skin-vector-max-width .mw-page-container {
  212.     padding: 0 0px;
  213.  
  214.   }
  215.  
  216.   .skin-vector-max-width .mw-footer-container {
  217.     background-color: #f6f6f6;
  218.     transform: translateX(-16px);
  219.     margin-left: -193px;
  220.     margin-right: -32px;
  221.   }
  222.   .skin-vector-max-width .mw-footer-container > .mw-content-container {
  223.     padding-left: 193px;
  224.   }
  225.   .skin-vector-max-width .mw-footer {
  226.     border-top: 1px solid #a7d7f9;
  227.     padding: 22px 17px 1.25em 17px;
  228.   }
  229.   .skin-vector-max-width .mw-header {
  230.     z-index: 2;
  231.   }
  232.     .skin-vector-max-width #mw-panel {
  233.     left: -176px;
  234.   }
  235.   .skin-vector-max-width.skin-vector-search-header .mw-page-container {
  236.      overflow-y: unset;
  237.   }
  238.   body {
  239.     overflow-y: unset;
  240.   }
  241.   #mw-panel {
  242.     font-size: 96%;
  243.   }
  244.   /*.vector-menu-portal .body {
  245.     margin-left: 1.5em;
  246.   }*/
  247.   /* french wiki style indent*/
  248.   /*.vector-menu-portal .body ul {
  249.     margin-left: 1.35em !important;
  250.   }
  251.   */
  252.   .skin-vector-max-width.skin-vector-search-header .mw-article-toolbar-container {
  253.      max-width: none;
  254.     margin-left: auto;
  255.     margin-right: auto;
  256.   }
  257.   .vector-menu-portal {
  258.    padding: 0
  259.   }
  260.   .skin-vector-max-width #mw-panel {
  261.     margin-top: 109px;
  262.   }
  263.     .mw-header {
  264.     background-color: #fbfbfb;
  265.     background-image: -webkit-gradient(linear,right top,right bottom,color-stop(50%,#ffffff),color-stop(100%,#f6f6f6));
  266.     background-image: -webkit-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
  267.     background-image: -moz-linear-gradient(top,#ffffff 50%,#f6f6f6 100%);
  268.     background-image: linear-gradient(to bottom,#ffffff 50%,#f6f6f6 100%);
  269.     background-position: bottom left;
  270.     height: 5em;
  271.     margin-left: -193px;
  272.     padding-left: 193px;
  273.   }
  274.   .skin-vector-max-width .mw-page-container {
  275.  background-color: unset !important;
  276.   }
  277.   #content {
  278.     background-color: white;
  279.   }
  280.   .skin-vector-max-width .mw-body {
  281.      padding: 1.5em 1.5em 1.5em 1.5em !important;
  282.   }
  283.   .skin-vector-max-width .mw-page-container-inner {
  284.     top: -11px;
  285.   }
  286.   .skin-vector-max-width.skin-vector-search-header .mw-workspace-container {
  287.     top: -51px;
  288.    
  289.   }
  290.   .skin-vector-search-header #p-search{
  291.     visibility: unset;
  292.     transform: translateX(483px) translateY(2px);
  293.     z-index: 5;
  294.     direction: rtl;
  295.     height: 1px;
  296.   }
  297.   #p-personal {
  298.     transform: translateY(-25px) translateX(-15px);
  299.   }
  300.   .skin-vector-search-header #p-personal {
  301.     flex-grow: 0 !important;
  302.     flex-basis: unset !important;
  303.   }
  304.   .skin-vector-search-header #p-search #searchform {
  305.     max-width: 320px !important;
  306.   }
  307. /*  .skin-vector-max-width.skin-vector-search-header .mw-article-toolbar-container {margin-right: 341px;}*/
  308.   .vector-menu-tabs ul {
  309.      margin: 0px 341px 0px 0px;
  310.   }
  311.   body {
  312.     overflow-x: hidden;
  313.   }
  314.   .skin-vector-max-width.action-history .mw-checkbox-hack-checkbox:checked ~ .mw-workspace-container .mw-content-container, .skin-vector-max-width.ns-special .mw-checkbox-hack-checkbox:checked ~ .mw-workspace-container .mw-content-container {
  315.     margin-left: initial;
  316.   }
  317. }
  318.  
  319. @-moz-document domain("fr.wikipedia.org") {
  320.   .mw-logo-icon {
  321.     background: url(https://en.wikipedia.org/static/images/project-logos/frwiki.png) no-repeat !important;
  322.   }
  323. }
  324.  
  325. @-moz-document domain("eu.wikipedia.org") {
  326.   .mw-logo-icon {
  327.     background: url(https://en.wikipedia.org/static/images/project-logos/euwiki.png) no-repeat !important;
  328.   }
  329.   .skin-vector-search-header #p-search{
  330.     transform: translateX(443px) translateY(2px) !important;
  331.   }
  332.   #ca-nstab-txikipedia.new a {
  333.     padding-top: 5em;
  334.   }
  335. }
  336.  
  337. @-moz-document domain("he.wikipedia.org") {
  338.   .mw-logo-icon {
  339.     background: url(https://en.wikipedia.org/static/images/project-logos/hewiki.png) no-repeat !important;
  340.   }
  341. }
  342.  
  343. @-moz-document domain("fa.wikipedia.org") {
  344.   .mw-logo-icon {
  345.     background: url(https://en.wikipedia.org/static/images/project-logos/fawiki.png) no-repeat !important;
  346.   }
  347. }
  348.  
  349. @-moz-document domain("fr.wiktionary.org") {
  350.   .mw-logo-icon {
  351.     background: url(https://en.wikipedia.org/static/images/project-logos/frwiktionary.png) no-repeat !important;
  352.   }
  353. }
  354.  
  355. @-moz-document domain("pt.wikiversity.org") {
  356.   .mw-logo-icon {
  357.     background: url(https://en.wikipedia.org/static/images/project-logos/ptwikiversity.png) no-repeat !important;
  358.   }
  359. }
  360.  
  361. @-moz-document domain("office.wikimedia.org") {
  362.   .mw-logo-icon {
  363.     background: url(https://en.wikipedia.org/static/images/project-logos/officewiki.png) no-repeat !important;
  364.   }
  365. }
Add Comment
Please, Sign In to add comment