Difference between revisions of "Template:Card"

From Epic Paths
Jump to navigation Jump to search
(Created page with "<noinclude> == Usage == Parameters: [Title] | [TitleSize] | [CardWidth] | [Color] | Body Title, TitleSize, CardWidth and Color are optional. {| class="wikitable" |- ! Numbe...")
 
 
(2 intermediate revisions by the same user not shown)
Line 19: Line 19:
| 1|| -|| -|| -|| -|| 1
| 1|| -|| -|| -|| -|| 1
|}
|}
'''border:''' explicit border css (defaults "1px solid #DDDDDD")


Example:
Example:


  <nowiki>{{Card|Title|2|W|hint|This is the body}}</nowiki>  
  <nowiki>{{Card|Title|2|W|hint|This is the body|border=1px solid #DD00DD}}</nowiki>  
or
or
  <nowiki>{{Card|Title|This is the body}}</nowiki>
  <nowiki>{{Card|Title|This is the body}}</nowiki>
Line 118: Line 120:
{{#vardefine:color|#ffffff}}
{{#vardefine:color|#ffffff}}
|}}
|}}
}}<div style="display:inline-table;max-width:{{#var:width}};margin:10px;background-color:{{#var:color}};padding:.8em;border:1px solid #DDDDDD;">
}}<div style="display:inline-table;max-width:{{#var:width}};margin:10px;background-color:{{#var:color}};padding:.8em;{{#if:{{{border|}}}|border:{{{border}}};}}">
{{#if: {{#varexists:title}}|
{{#if: {{#varexists:title}}|
{{#ifeq: {{#var:titlesize}}|2|
{{#ifeq: {{#var:titlesize}}|2|
Line 129: Line 131:
}}
}}
}}
}}
}}
}}{{#var:body}}
{{#var:body}}
</div></includeonly>
</div></includeonly>

Latest revision as of 22:40, 20 January 2022

Usage

Parameters: [Title] | [TitleSize] | [CardWidth] | [Color] | Body

Title, TitleSize, CardWidth and Color are optional.

Number Parameters Title TitleSize CardWidth Color Body
5 1 2 3 4 5
4 1 2 3 - 4
3 1 2 - - 3
2 1 - - - 2
1 - - - - 1

border: explicit border css (defaults "1px solid #DDDDDD")

Example:

	{{Card|Title|2|W|hint|This is the body|border=1px solid #DD00DD}} 

or

	{{Card|Title|This is the body}}

Title: If no title text is given, the card is created without a header. If title is 'none' card will also be created without a header.

TitleSize: Titlesize defaults to Level 3. It accepts '2', '3' and '4' as values.

CardWidth: CardWidth defaults to '300px'. It accepts any css compatible width value. It also accepts the enum values below. Contributors are encouraged to use the default or enum values. If another value seems widely needed, a discussion should be started on whether another static value is needed.

Enum Value
'S' 200px
'M' 300px
'W' 450px
'VW' 650px
'XW' 945px

Color: Color defaults to transparent. It accepts any css compatible color value. It also accepts

Enum Value
'hint' #f8f9fa
'white' #ffffff