Difference between revisions of "Template:Navbox style/doc"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Some basic docs.)
 
(Rewrite the docs to reflect the new purpose of this template. Preserve the history in the docs, in case it's useful to someone in the future. (And yeah, I know the italics don't work in <pre>…))
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<includeonly>{{high-risk}}</includeonly>
+
<includeonly>{{high-use}}</includeonly>
 
<!-- Please place categories where indicated at the bottom of this page -->
 
<!-- Please place categories where indicated at the bottom of this page -->
 
== Usage ==
 
== Usage ==
 
'''''This template is not used directly, it is intended for a very specific use, to generate parameters for another highly complex template.'''''
 
'''''This template is not used directly, it is intended for a very specific use, to generate parameters for another highly complex template.'''''
  
This template is currently only a temporary workaround for the CSS missing from [[MediaWiki:Common.css]] which is needed to properly support the use of {{tlb|Navbox}}.  Due to the nature of CSS, it can never be a perfect solution, and is the wrong way to specify the actual layout. The style options being passed to {{tl|Navbox}} exceed the original design of it, as those options were only ever intended for minor adjustments such as changing the color schemeDespite that, the current usage does provide a short term acceptable solution until the correct CSS is in place. The visual result is broadly similar to that achieved with the correct CSS stylesheet in place.  Inline style via the "style" attribute on HTML elements is never a full or correct replacement for a CSS stylesheet, and contains a number of limitations not present for a stylesheet.
+
This template provides a mechanism for standard style customisation of {{tlxb|Navbox}} templates.  The site default style comes from [[MediaWiki:Common.css]], and navbox templates should generally use the site default unless they have a good reason to use something else.  Currently the <code>''style''</code> parameter below can be set one of the following:
 +
 
 +
* {{para|color|red}}
 +
* {{para|color|green}}
 +
* {{para|color|blue}} (the current site default, and only included for completeness)
 +
 
 +
e.g. {{Tlx|{{BASEPAGENAME}}|color{{=}}green|title}}
 +
 
 +
It is currently intended to only be used for relatively minor re-styling, such as alternate color schemesMajor changes to the style should really be done via the site CSS.
 +
 
 +
'''''If you do not wish to customise the style of a navbox, it should not contain any reference to this template.'''''
  
 
=== Top level navboxes ===
 
=== Top level navboxes ===
 
<pre>
 
<pre>
| bodystyle      = {{Navbox style|body}}
+
{{Navbox
| innerstyle     = {{Navbox style|inner}}
+
 
| titlestyle      = {{Navbox style|title}}
+
...
| abovestyle      = {{Navbox style|above}}
+
 
| belowstyle      = {{Navbox style|below}}
+
| titlestyle     = {{Navbox style|''style''|title}}
| groupstyle      = {{Navbox style|group}}
+
| abovestyle      = {{Navbox style|''style''|above}}
| liststyle      = {{Navbox style|list}}
+
| belowstyle      = {{Navbox style|''style''|below}}
| evenstyle      = {{Navbox style|even}}
+
| groupstyle      = {{Navbox style|''style''|group}}
| oddstyle        = {{Navbox style|odd}}
+
 
| navbarstyle    = {{Navbox style|navbar}}
+
...
| navbarfontstyle = {{Navbox style|navbarfont}}
+
 
 +
}}
 
</pre>
 
</pre>
  
 
=== Subgroup / child navboxes ===
 
=== Subgroup / child navboxes ===
 
<pre>
 
<pre>
| bodystyle      = {{Navbox style|child|body}}
+
{{Navbox|child
  | titlestyle      = {{Navbox style|child|title}}
+
 
  | abovestyle      = {{Navbox style|child|above}}
+
...
  | belowstyle      = {{Navbox style|child|below}}
+
 
  | groupstyle      = {{Navbox style|child|group}}
+
  | titlestyle      = {{Navbox style|''style''|child|title}}
| liststyle      = {{Navbox style|child|list}}
+
  | abovestyle      = {{Navbox style|''style''|child|above}}
| evenstyle      = {{Navbox style|child|even}}
+
  | belowstyle      = {{Navbox style|''style''|child|below}}
| oddstyle        = {{Navbox style|child|odd}}
+
  | groupstyle      = {{Navbox style|''style''|child|group}}
 +
 
 +
...
 +
}}
 
</pre>
 
</pre>
 +
 +
=== History ===
 +
 +
This template was originally a temporary workaround for the CSS missing from [[MediaWiki:Common.css]] which was needed to properly support the use of {{tlb|Navbox}}.  Due to the nature of CSS, it can never be a perfect solution, and is the wrong way to specify the actual layout.  The style options being passed to {{tl|Navbox}} exceeded the original design of it, as those options were only ever intended for minor adjustments such as changing the color scheme.  Despite that, the usage did provide a short term acceptable solution until the correct CSS was in place.  The visual result was broadly similar to that achieved with the correct CSS stylesheet in place.  Inline style via the "style" attribute on HTML elements is never a full or correct replacement for a CSS stylesheet, and contains a number of limitations not present for a stylesheet.
 +
 +
The original approximation of the full CSS for {{tl|Navbox}} has been stripped out, but can be found in the template's change history.  Remember, it was an imperfect solution, and was only ever intended to be a temporary workaround.  It was removed from this template to avoid both current and future conflicts with changes made to the site CSS.
  
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |

Revision as of 17:46, 11 June 2015

Usage

This template is not used directly, it is intended for a very specific use, to generate parameters for another highly complex template.

This template provides a mechanism for standard style customisation of {{Navbox}} templates. The site default style comes from MediaWiki:Common.css, and navbox templates should generally use the site default unless they have a good reason to use something else. Currently the style parameter below can be set one of the following:

  • |color=red
  • |color=green
  • |color=blue (the current site default, and only included for completeness)

e.g. {{Navbox style|color=green|title}}

It is currently intended to only be used for relatively minor re-styling, such as alternate color schemes. Major changes to the style should really be done via the site CSS.

If you do not wish to customise the style of a navbox, it should not contain any reference to this template.

Top level navboxes

{{Navbox

...

| titlestyle      = {{Navbox style|''style''|title}}
| abovestyle      = {{Navbox style|''style''|above}}
| belowstyle      = {{Navbox style|''style''|below}}
| groupstyle      = {{Navbox style|''style''|group}}

...

}}

Subgroup / child navboxes

{{Navbox|child

...

 | titlestyle      = {{Navbox style|''style''|child|title}}
 | abovestyle      = {{Navbox style|''style''|child|above}}
 | belowstyle      = {{Navbox style|''style''|child|below}}
 | groupstyle      = {{Navbox style|''style''|child|group}}

...
}}

History

This template was originally a temporary workaround for the CSS missing from MediaWiki:Common.css which was needed to properly support the use of {{Navbox}}. Due to the nature of CSS, it can never be a perfect solution, and is the wrong way to specify the actual layout. The style options being passed to {{Navbox}} exceeded the original design of it, as those options were only ever intended for minor adjustments such as changing the color scheme. Despite that, the usage did provide a short term acceptable solution until the correct CSS was in place. The visual result was broadly similar to that achieved with the correct CSS stylesheet in place. Inline style via the "style" attribute on HTML elements is never a full or correct replacement for a CSS stylesheet, and contains a number of limitations not present for a stylesheet.

The original approximation of the full CSS for {{Navbox}} has been stripped out, but can be found in the template's change history. Remember, it was an imperfect solution, and was only ever intended to be a temporary workaround. It was removed from this template to avoid both current and future conflicts with changes made to the site CSS.