MediaWiki:Common.css

From Cannabis
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* CSS placed here will be applied to all skins */

/* === Long image filenames in categories, etc. === 
/* Long filenames are the default setting on the Commons. Via a default gadget.
/* https://commons.wikimedia.org/wiki/Special:Preferences#mw-prefsection-gadgets 
/* https://commons.wikimedia.org/wiki/Special:Gadgets 
/* https://commons.wikimedia.org/wiki/MediaWiki:Gadget-Long-Image-Names-in-Categories.css 
/* More info: http://www.shoutwiki.com/wiki/Forum:Long_image_names_in_categories */

/* Long filenames on category pages */
#mw-category-media .galleryfilename-truncate,
/* Long filenames on special pages (new files etc.) */
.ns-special .galleryfilename-truncate {
    white-space: normal; 
    overflow: visible;
    display: inline;
}

#mw-category-media .galleryfilename-truncate:after,
.ns-special .galleryfilename-truncate:after {
    content: '\A';
    white-space: pre;
    white-space: pre-wrap; /* Workaround for Chromium bug which seems to apply the rule to the whole line, breaking text wrapping with 'pre' */
}

/* === Easy method of auto numbering of table rows === 
/* Just add class="sortable autonumber" to top line of table wikitext.
/* This is Yair_rand's CSS (slightly adapted). See his CSS and comment: 
/* See https://phabricator.wikimedia.org/T42618#434018 */

  table.autonumber > tbody {
    counter-reset: autonumbering;
  }
  table.autonumber > tbody > tr::before {
    counter-increment: autonumbering;
    content: counter(autonumbering);
  }
  table.autonumber > thead > tr::before {
    content: " ";
  }
  table.autonumber > thead > tr::before, table.autonumber > tbody > tr::before
{
    display: table-cell;
    padding: 0.2em;
    border: 1px solid;
    vertical-align: middle;
    text-align: center;
  }

/* === Automatic row numbering of some tables === 
/* This is the hard method. 
/* This method is no longer used here except in tests, sandboxes, etc.. 
/* This CSS is kept mainly so old revisions work for showing others. 
/* For example: 
/* http://cannabis.shoutwiki.com/w/index.php?title=2014list&oldid=21668 
/* http://cannabis.shoutwiki.com/w/index.php?title=GMMcities&oldid=6398
/* Add class=rownumber to top line of table. 
/* Add class=rownumber-value to first cell in each row. 
/* Info: en.wikipedia.org/wiki/User:Timeshifter/Sandbox33 
/* https://phabricator.wikimedia.org/T42618 */
 
table.rownumber {
        counter-reset: tablerownumber;
}
table.rownumber td.rownumber-value:before {
        content: counter(tablerownumber);
        counter-increment: tablerownumber;
}

/* === Navbox default skin for navigation boxes === 
/* From: cannabis.wikia.com/wiki/MediaWiki:Wikia.css 
/* Avoid using the "navbox" class. Remove it wherever I see it. 
/* Then remember to add text-align:left; to header. 
/* So header text is visible in narrow screens when expanded */

table.navbox {
    border: 1px solid;
    margin: 4px 0 0 0;
    padding: 2px;
}

table.navbox th {
    background-color: OldLace;
    color: black;
    padding-left: 2px;
    text-align: left;
}

@media print {
    .navbox {
        display: none;
    }
}

/* === Collapsible elements. Toggle-link margin. === 
/* See: community.wikia.com/wiki/Thread:499656 
/* community.wikia.com/wiki/Help:Collapsing 
/* cannabis.wikia.com/wiki/MediaWiki:Wikia.css */

.mw-collapsible-toggle { 
    margin-left: 1em; 
}