Difference between revisions of "Template:Infobox/themes/style"

From Twinsuniverse
Jump to: navigation, search
m
(added missing parameter in example + usage of templatelink)
Line 5: Line 5:
 
  | #default:
 
  | #default:
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
This template produces one of three styles for particular <nowiki>{{</nowiki>[[Template:infobox/themes|infobox/themes]]<nowiki>}}</nowiki>, in the form of CSS.
+
This template produces one of three styles for particular {{templatelink|infobox/themes}}, in the form of CSS.
  
 
==Parameters==
 
==Parameters==
Line 25: Line 25:
  
  
This template would then output style for either of the following parameters for the <nowiki>{{</nowiki>[[Template:Infobox/core|Infobox/core]]<nowiki>}}</nowiki> template:
+
This template would then output style for either of the following parameters for the {{templatelink|Infobox/core}} template:
 
* '''mainstyle''': The theme style for the infobox' main table
 
* '''mainstyle''': The theme style for the infobox' main table
 
* '''headstyle''': The theme style for the infobox' headers (title, subtitle, headings)
 
* '''headstyle''': The theme style for the infobox' headers (title, subtitle, headings)
Line 31: Line 31:
  
 
==Syntax==
 
==Syntax==
  <nowiki>{{Infobox/themes/style
+
  <nowiki>{{Infobox/themes/style|style
 
  |b=
 
  |b=
 
  |bg=
 
  |bg=
Line 39: Line 39:
  
 
==Example==
 
==Example==
  <nowiki>{{Infobox/themes/style
+
  <nowiki>{{Infobox/themes/style|main
 
  |b=red
 
  |b=red
 
  |bg=#efe
 
  |bg=#efe
Line 46: Line 46:
 
}}</nowiki>
 
}}</nowiki>
  
The output would be pure CSS, acceptable for the HTML '''style''' attribute.
+
The output would be pure CSS, acceptable for the HTML '''style''' attribute, in this case the specific attributes required for the 'main' element.
  
 
[[Category:System Templates]]
 
[[Category:System Templates]]
 
</noinclude>
 
</noinclude>

Revision as of 11:42, 24 May 2014

This template produces one of three styles for particular {{infobox/themes}}, in the form of CSS.

Parameters

This template uses abbreviated parameter names, to allow for short single lines when calling this template repetitively.

  • b: The border colour
  • bg: The main background colour
  • bgh: The background colour of headers
  • txt: The text colour in headers


Note: The colours may be in any CSS accepted format, that is #RGB, #RRGGBB, rgb(xxx,xxx,xxx) or string literal.


  1. The particular style that should be formed is also required (no parameter name, case insensitive), should be one of the following:
    • main
    • head
    • data
    • any other value results in an empty string as output.


This template would then output style for either of the following parameters for the {{Infobox/core}} template:

  • mainstyle: The theme style for the infobox' main table
  • headstyle: The theme style for the infobox' headers (title, subtitle, headings)
  • datastyle: The theme style for the infobox' plain data cells

Syntax

{{Infobox/themes/style|style
 |b=
 |bg=
 |bgh=
 |txt=
}}

Example

{{Infobox/themes/style|main
 |b=red
 |bg=#efe
 |bgh=#ababab
 |txt=rgb(50,60,70)
}}

The output would be pure CSS, acceptable for the HTML style attribute, in this case the specific attributes required for the 'main' element.