Changes

Jump to navigation Jump to search
Wiki core CSS override reverted.
Line 1: Line 1:  
This page needs to be updated with content from [http://en.wikipedia.org/wiki/MediaWiki:Common.css Wikipedia's MediaWiki:Common.css] so that we can use table classes, like infoboxes.  Only an administrator can edit this page. --[[User:Spangineer1|Spangineer]] ([[User talk:Spangineer1|talk]]) 20:12, 11 September 2008 (UTC)
 
This page needs to be updated with content from [http://en.wikipedia.org/wiki/MediaWiki:Common.css Wikipedia's MediaWiki:Common.css] so that we can use table classes, like infoboxes.  Only an administrator can edit this page. --[[User:Spangineer1|Spangineer]] ([[User talk:Spangineer1|talk]]) 20:12, 11 September 2008 (UTC)
   −
Wikipedia updates their content about once/month. We should follow these updates, such as when the MediaWiki software isupdated. Be sure to add the prosilver header below.
+
We don't need to update this page as frequently as Wikipedia, perhaps when the MediaWiki software is updated. Be sure to add the prosilver header below.
 
<pre>
 
<pre>
 
/* Implement phpBB prosilver navbar */
 
/* Implement phpBB prosilver navbar */
Line 11: Line 11:  
}
 
}
 
</pre>
 
</pre>
--[[User:LadyGeek|LadyGeek]] 19:32, 20 November 2012 (CST)
+
--[[User:LadyGeek|LadyGeek]] 19:55, 20 November 2012 (CST)
 +
 
 +
The code is updated to match [[wikipedia:MediaWiki:Common.css | Wikipedia]], but for the version dated 02 November 2013 (not the latest). One of the editors has disabled the default nowrap behaviour for list items in horizontal lists, which is causing quite a discussion in the Talk page (to fix IE problems). I'll wait for the dust to settle.
 +
--[[User:LadyGeek|LadyGeek]] 17:05, 17 November 2013 (CST)
 +
 
 +
==Disable display on desktop==
 +
Added a class to ''disable'' content display for desktops. MobileFrontEnd does not load [[MediaWiki:Common.css]], so it won't see this class. See: [https://www.mediawiki.org/wiki/Thread:Extension_talk:MobileFrontend/Hiding_content_on_desktop_devices Topic on Extension talk:MobileFrontend]
 +
 
 +
<pre>
 +
/* Only for mobile devices */
 +
.onlymobile {
 +
display:none;
 +
}
 +
</pre>
 +
Use <code>class="nomobile"</code> in conjunction with <code>class="nomobile"</code> to show content only on the desktop. This class is needed on the main page to have one table version for the desktop, another version for mobile.
 +
--[[User:LadyGeek|LadyGeek]] 17:21, 17 April 2016 (EDT)
 +
 
 +
:The above description is incorrect (class is described twice) and was based on a 2012 support question. Currently, <code>class="nomobile"</code> will prevent display in a mobile device without modification to [[MediaWiki:Mobile.css]] (no need to change anything now, maybe later). Modification to [[MediaWiki:Common.css]] is still needed to block display in a desktop device.
 +
 
 +
:{| class="wikitable"
 +
!Class !! Display on Desktop !! Display on Mobile
 +
|-
 +
||nomobile||Y||N
 +
|-
 +
||onlymobile||N || Y
 +
|}
 +
:--[[User:LadyGeek|LadyGeek]] 14:04, 8 April 2020 (UTC)
 +
 
 +
==MediaWiki core CSS override==
 +
The upgrade to MediaWiki 1.35.0 introduced a breaking CSS change that is described in [https://www.mediawiki.org/wiki/Topic:Vcxxk5h088xsv9va .messagebox :only-child] (a topic in [[mw:User talk:Volker E. (WMF)|User talk:Volker E. (WMF)]]). MediaWiki is optimized for Wikipedia. We customize templates and styles for use here.
 +
 
 +
Wikipedia has taken the position that list items are "edge cases" and that the border issues are acceptable. In our case, the CSS within the MediaWiki core source code breaks [[Template:Ivory messagebox]] for list items and is not acceptable.
 +
 
 +
The relevant core CSS is in (path to wiki)/resources/src/mediawiki.skinning/messageBoxes.less.
 +
 
 +
<pre>.messagebox,
 +
.errorbox,
 +
.warningbox,
 +
.successbox {
 +
color: #000;
 +
-webkit-box-sizing: border-box;
 +
-moz-box-sizing: border-box;
 +
box-sizing: border-box;
 +
margin-bottom: 16px;
 +
border: 1px solid;
 +
padding: 12px 24px;
 +
word-wrap: break-word;
 +
/* Standard property is `overflow-wrap` */
 +
overflow-wrap: break-word;
 +
overflow: hidden;
 +
}
 +
 
 +
/* Ensure box inner spacing is not all over the place no matter what element is only child. */
 +
.messagebox :only-child,
 +
.errorbox :only-child,
 +
.warningbox :only-child,
 +
.successbox :only-child {
 +
margin: 0;
 +
}</pre>
 +
 
 +
Care should be taken to only make the minimum changes necessary to fix the issue. I have modified the CSS to add:
 +
<pre>/* Override MediaWiki core */
 +
.messagebox :only-child {
 +
margin: 0 0 0 16px;
 +
}</pre>
 +
Note that using other CSS ''margin'' properties, such as ''margin-bottom'', are different than ''margin'' and will not override the intended CSS. The exact property name must be used.
 +
 
 +
The mobile UI uses a different message box and is not affected. --[[User:LadyGeek|LadyGeek]] 12:46, 30 October 2020 (UTC)
 +
 
 +
:Due to formatting issues with [[Template:Ivory messagebox]], I have reverted this change. See: [[Template talk:Ivory messagebox]] --[[User:LadyGeek|LadyGeek]] 23:41, 31 October 2020 (UTC)

Navigation menu