MediaWiki:Common.css: This page contains “CSS” code, which controls how the MEpedia interface displays to users. This includes the placement, color, size, and font of buttons, links, windows, and text. The CSS code that controls the MEpedia interface is stored in three locations:
The ‘skin’ contains most of the CSS code, and this basic ‘skin’ code can not be changed. However, an MEpedia user can select from a list of different skins in their user preferences. For example, a user can select either the standard “Vector” skin or the light-sensitive “Timeless” skin.
The MediaWiki:Common.css page contains MEpedia-specific changes to the CSS code that will apply to ALL skins available at MEpedia.
Each skin has a page that contains MEpedia-specific changes to the CSS code that will apply to ONLY that skin. For example, MediaWiki:Timeless.css.
Changes to MediaWiki:Common.css are critical and immediately affect everyone. When updating this page, please review the following checklist:
Before making changes to this page, test your changes in your own "common.css" page, such as User:Pyrrhus/common.css
Any changes should be tested in the standard Vector skin, as well as the Timeless skin. (You can see how a page looks in the Timeless skin by adding "&useskin=timeless" to the end of the URL in the address bar.) Note that different skins use different fonts, which can slightly alter layout or readability.
Any changes should be tested in a desktop interface, as well as a mobile interface. Mobile views may not need all features- less crowded improves readability. To test different device sizes, you can use a tool like http://www.infobyip.com/testwebsiteresolution.php
Any changes should be tested in at least 2 different browsers. If you must use any uncommon CSS, you can check browser compatibility at https://caniuse.com or search for answers at https://css-tricks.com (CSS3-only features should be avoided)
Any additions to this page should include brief documentation explaining who made the addition, when the addition was made, what the function of the addition is, and if the code has been copied, the original source of the code.
Any changes to existing sections should be well explained in the edit summary.
If possible, avoid specifying colors in MediaWiki:Common.css, since the colors must work with all skins. If you must specify colors, be sure to check the end-result in the Timeless skin and make any compensating changes in MediaWiki:Timeless.css. Timeless is a higher contrast / low vision / accessible skin, using specific shades to avoid common color blindness issues, and AA contrast where possible (calculated contrast 4.5 or higher). See Wikipedia's Color Guidance and dark and light palettes for recommendations and colors to avoid.
If you are creating a new CSS class, make sure your class name won't be used by any other part of the MEpedia interface. Consider using a naming convention such as found in existing MediaWiki class names and ids. (These cover many templates, such as infoboxes, features like wrap/nowrap and plainlinks. Standard ones include ns-, ca-, p- and others. Extras may appear in Vector but not in other skins.)
You can validate any new CSS code using the w3c css validator (vendor extension and "same color" errors can be ignored).
The effect of this is to set the style of the border on MediaWiki:Sitenotice so that it is blue, but in a class so can be changed to white for anyone using the Timeless skin, using the class already in MediaWiki:Timeless.css. Thank you ~Njt (talk) 10:45, August 10, 2022 (UTC)
Code from wikipedia to prevent long references breaking the page layout. User:Kmdenmark Can you please add to the end of the existing code. Thanks ~Njt (talk) 11:34, October 16, 2020 (UTC)
/* smaller sitenotice for logged in users */
.mw-dismissable-notice-body {
font-size: smaller;
}
It needs to go near the end of the page, immediately after the line: /* Mobiles and small screens - bullets and numbering */
This reduces the space the site notice takes up on mobile screens only. Thank you. ~Njt (talk) 09:59, October 15, 2020 (UTC)
Can you make this change by adding this code User:Kmdenmark. Ideally this should go at the very bottom. This developer code should resolve the Google search engine usability errors (see Slack for info), plus merges in changes by User:Notjusttired to improve category banners on mobiles and reduce indents for bullet points on mobiles, and make the width of the dismissable site notice larger so it goes over less lines on small screens. Thanks. ~Njt (talk) 22:52, September 14, 2020 (UTC)
Now done ~Njt (talk) 23:06, September 28, 2020 (UTC)
Can this be added to the end of the existing code, it will allow several colors of text that will change to a lighter shade on this skin. User:Kmdenmark. See related changed at MediaWiki_talk:Common.css. This will be useful in some tables and for positive / negative symbols, possibly for viruses and bacteria. Thank you ~Njt (talk) 01:36, August 22, 2020 (UTC)
Can we please have some standards agreed before more changes are made here? Changes here are critical and immediately affect everyone.
I would like to agree some standards going forward to minimize future issues, perhaps add a ticklist before changes are made. I think this will help avoid errors and act as a prompt for us to consider different choices, and more opportunity to have different people feedback on suggested changes. I suggest these below. User:PyrrhusUser:KmdenmarkUser:JaimeSUser:JenB ~Njt (talk) 18:58, November 12, 2019 (EST)
Color changes: should only be made here in exceptional circumstances, and with dark skin alternatives added to MediaWiki:Timeless.css at the same time, otherwise they should go on the relevant skin's page only. Our dark Timeless is a higher contrast / low vision / accessible skin, using specific shades to avoid common color blindness issues, and AA contrast where possible (calculated contrast 4.5 or higher). See Wikipedia's Help:Colours and dark and light palettes for recommendations and colors to avoid.
Images or icons: should not be added if possible, given that alternatives will be needed for dark skins like Timeless. It may be possible to use symbols from HTML instead, or we could look into font awesome icons (lazy load - at the end of the css - for less frequently used images). Images affect layout and color contrast. Grayscale / white / black are best.
Some changes may be best suited only to desktop users, or only to certain skins. Media screen queries for screen size already exist to target tablets, or mobile devices. Mobile views may not need all features, less crowded improves readability.
Images: must use external URLs, not use relative paths, except when we are waiting for those files to server's https://www.me-pedia.org/resources/assets - this should be marked as an outstanding issue on the talk page. This is because the relative paths can easily change in future or images may be accidentally changed or deleted by other editors.
Icon images must have a fallback, typically icons should be svg with fallback to png format. Converters are available online.
Design principles should be followed as per Wikipedia, with MEpedia red and blue shades for branding, some screens show the same color code very differently.
Changes should be infrequent, and not be made here without being tested elsewhere first eg on a user's own common.css, to minimize needing to make corrections on the same day.
Test on all skins: Changes must be tested on all skins first, eg using a "useskin" link or changing user preferences
New classes: Careful thought should go into introducing new class names. Existing MediaWiki class names and ids cover many templates eg infoboxes, features like wrap / nowrap and plainlinks. Standard ones include ns-, ca-, p- and others. Extras may appear in Vector but not in other skins.
Less common CSS can cause issues browser compatibility issues, eg the :before pseudoclass is ignored on old Safari and IE browsers. Caniuse.com or css-tricks can check this. CSS3-only features should be avoided.
Images included by MediaWiki can be found by searching Github
Particular issues with colors exist when colored backgrounds are used in tables, eg Notable studies, and on Portal boxes.
Different skins use different fonts, which can slightly alter layout or readability.
System messages: should not refer to position of things on the screen or screen colors, as per MediaWiki standards. Avoid referring to "the red button", "the first option". These may be more longer or shorter when translated.
Use detailed comments in the edit summary to describe all changes. This makes uncommon problems much easier to trace when the problem has not been noticed until several edits later.
Code snippets from elsewhere should be referred to either in the code or on the talk page.
Comments welcome ~Njt (talk) 18:58, November 12, 2019 (EST)
Thank you for all the work you are doing to improve this site. I don't have the technical knowledge to response to any of the points outlined. I will graciously defer to other techies. Kmdenmark (talk) 10:14, November 14, 2019 (EST)
I have adapted the above checklist and included it in the interface explanation at the top of this page.
Please copy the code below to MediaWiki:Common.css (but without the "pre" tags). This makes collapsible lists work, improves file upload from mobiles by making things fit in the screen better, and means the "Read more" feature on this page should work now, and hide completed requests unless you click "read more". notjusttired (talk) 20:28, June 3, 2019 (EDT)
I’m going to add a small bit to this request, in order to center the donate button in the sidebar. I have tested this on all installed skins. If you have a chance, User:Kmdenmark, please add the following code to the END of this page. Please let us know if you have any questions. Thanks!
/* Collapsible list or collapsible elements eg buttons */
/* move list toggle to left for list */
.collapsed span.mw-collapsible-toggle, .collapse ul.mw-collapsible-toggle, .collapse div.mw-collapsible-toggle,
.collapsed span.mw-collapsible-toggle expanded {
float: left;
}
/** Lifted from wikipedia - Sandbox/CollapsibleDemo.css
Toggles between right arrow and up arrow images for collapsible elements - lists or bullets
See Wikipedia Manual:Collapsible_elements/Demo/Advanced **/
#collapse-pre-one .mw-collapsible-toggle .up,
#collapse-pre-one.mw-collapsed .mw-collapsible-toggle .down {
display: none;
}
#collapse-pre-one .mw-collapsible-toggle .down,
#collapse-pre-one.mw-collapsed .mw-collapsible-toggle .up {
display: block;
}
/* Lifted from WikiMedia
Make sure the license dropdown of the upload form doesn't extend beyond the browser's
window, even if there are some long license descriptions. (If that happens, the description
box *also* goes beyond the right edge of the window.)
*/
#wpLicense {
width: 100%;
overflow: hidden;
}
/* Give the upload form a little breathing space. */
#upload * td {
padding-bottom: 8px;
}
#mw-upload-table * td {
padding-bottom: 8px;
}
/* end of WikiMedia code */
/* Copied from Wikipedia shared.css for Read more template */
/* hide initially collapsed collapsable tables */
table.collapsed tr.collapsable {
display: none;
}
/* end of Wikipedia code
*/
/*
* What: Center donate button in sidebar
* Who: Pyrrhus
* When: 8 june 2019
*/
#n-donate {
text-align: center;
}
User:KmdenmarkUser:JaimeS Please add the following code to the start of MediaWiki:Common.css, without the <pre> tags.
This will allow for a #MEpedia logo without it needing embedding in an image. It won't work unless on the first line. Thanks notjusttired (talk) 16:41, May 24, 2019 (EDT) - edited May 30th for permanent marker
@import url(https://fonts.googleapis.com/css?family=Oswald);
@import url(https://fonts.googleapis.com/css?family=Permanent+Marker);
/* fonts must go on top line only */
/* #MEpedia logo fonts and classes */
.logo-me {
font-family: Oswald, sans-serif;
font-style: italic;
font-variant: normal;
}
section#middle-nav .title a {
font-family: Oswald, sans-serif;
font-style: italic;
font-variant: small-caps;
}
.logo-pedia {
font-family: Oswald, sans-serif;
font-style: normal;
font-variant: small-caps;
padding-left: 0.15em;
}
User:Kmdenmark Please add the code below (except for the "pre) bits. This should create a twitter type icon, so we can have a Cite tweet if we want at some point. notjusttired (talk) 17:03, July 7, 2019 (EDT)
/* Not sure what these settings are for */
table.ambox{...
This is styling for all article message boxes, eg Cleanup templates, and is used by Template:Ambox, anything calling (invoking) Module:Ambox, and anything calling Module:Mbox on articles. Hope this helps. ~Njt (talk) 18:59, October 26, 2019 (EDT)
Please add the following to the end of the existing code. This allows for tables to have different colors when the new classes "alternance" are used in a table. ~Njt (talk) 08:42, October 24, 2019 (EDT)
(please leave in place for testing on different skins)
content hidden
class wikitable alternance
Header text
Header text
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
class alternance2
col2
col3
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
class wikitable alternance2
col2
col3
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Temporary holiday notice problem (dark skin) -- ~Njt (talk) 18:22, December 22, 2019 (EST)[edit source | reply | new]
The code for the temporary notice sets the font color to black without setting the background color in mw-dismissable-notice. This means on the dark Timeless skin it's black text over very very dark grey background. I suggest taking out the font color line (which should allow it to be inherited, and default to nearly black except on Timeless which should default to off-white). I made suggestions earlier on this page of a ticklist that should help spit possible issues. Unfortunately I've now dismissed the notice so not sure how to test the changes. User:Pyrrhus
Re: Temporary holiday notice problem (dark skin) -- DariusC (talk) 12:07, December 23, 2019 (EST)[edit source | reply | new]
I've commented out the colour property of the temporary fundraising site notice. I've switched to "Timeless" to check and it looks good, very readable. It's light grey (#ccc) on dark grey (almost black #333). If you notice any other issue here, let me know.
Thank you Darius. ~Njt (talk) 16:14, December 28, 2019 (EST)
Category banner size (mobiles and tablets) -- ~Njt (talk) 14:48, February 23, 2020 (EST)[edit source | reply | new]
Can the code below please be added to improve mobile usability? User:Kmdenmark ~Njt (talk) 14:50, September 11, 2020 (UTC)
In addition to the minor changes I suggested in MediaWiki_talk:Common.js, can the following be added to the end of Common.css to shrink the banner for all mobiles and tablets. Currently this link this link to Responsinator shows different mobile layouts using the Potential comorbidities banner for testing (vector skin). This means that the banner used for Potential treatments / Potential comorbidities / Medical hypothesis will have smaller text and won't have a full black line above and below (on mobiles this doubles the height of the banner). See Slack for before / after screenshots. New code, please copy from source view:
Dismissable site notice on mobiles and tablets -- ~Njt (talk) 15:54, February 23, 2020 (EST)[edit source | reply | new]
See Zsolt request from Sep 14 2020, which includes this also
. ~Njt (talk) 20:56, September 14, 2020 (UTC)
Can the following code by made, assuming it looks ok. The idea is to use the gap on the left of the notice for text on snake screens (left to right languages only - the gap on the right is for the word "dismiss"). Small changes like less indentation for numbering too. User:Pyrrhus I hope this is ok since very foggy now. I don't know why but I can't seem to nest the ul and ol list code inside the top ltr- statement. Possibly causing issues with rtl languages. I am not sure how many will be using those though - possibly nobody right now? I am not sure if right to left is recognized for those without accounts. Hebrew is one language that could be tested. ~Njt (talk) 15:54, February 23, 2020 (EST)
content hidden
The dismissable site notice code is now being done by the developers, so just add the bullet and numbering code and category banners please. ~Njt (talk) 16:33, September 11, 2020 (UTC)