Actions

Template

Difference between revisions of "Grid"

From Gulf of Fallen Stars

(Created page with "<noinclude> === Parameters === '''type(required):''' begin / div / end '''cols(default 3):''' number of columns on widest screen '''border(default false):''' whether the box...")
 
Line 6: Line 6:
  
 
'''border(default false):''' whether the box should have a border
 
'''border(default false):''' whether the box should have a border
 +
 +
'''background(default transparent):''' the background of the grid cell. Defaults to white if border is true.
  
 
'''center(default false):''' center the text in the div
 
'''center(default false):''' center the text in the div
Line 16: Line 18:
 
-->{{#ifeq: {{#var:cols}}|4|{{#vardefine:width|24%}}{{#vardefine:minwidth|262px}}}}<!--
 
-->{{#ifeq: {{#var:cols}}|4|{{#vardefine:width|24%}}{{#vardefine:minwidth|262px}}}}<!--
  
-->{{#if:{{{border|}}}|{{#vardefine:boxstyle|background-color:#ffffff;border:1px solid #DDDDDD;margin:4px;}}|{{#vardefine:boxstyle|}}}}<!--
+
-->{{#if:{{{border|}}}<!--
 +
-->|{{#vardefine:boxstyle|border:1px solid #DDDDDD;margin:4px;}}{{#vardefine:background|#ffffff}}<!--
 +
-->|{{#vardefine:boxstyle|}}{{#vardefine:background|#00ffffff}}<!--
 +
-->}}<!--
 +
 
 +
-->{{#if:{{{background|}}}|{{#vardefine:background|{{{background|}}}}}}}<!--
  
 
-->{{#if:{{{center|}}}|{{#vardefine:textstyle|text-align:center;padding:20px;}}|{{#vardefine:textstyle|padding:10px;}}}}<!--
 
-->{{#if:{{{center|}}}|{{#vardefine:textstyle|text-align:center;padding:20px;}}|{{#vardefine:textstyle|padding:10px;}}}}<!--
  
-->{{#ifeq:{{{type}}}|begin|<div style="display:inline-table;width:{{#var:width}};min-width:{{#var:minwidth}};{{#var:boxstyle}}{{#var:textstyle}}">|}}<!--
+
-->{{#ifeq:{{{type}}}|begin|<div style="display:inline-table;width:{{#var:width}};min-width:{{#var:minwidth}};{{#var:boxstyle}}background-color:{{#var:background}};{{#var:textstyle}}">|}}<!--
-->{{#ifeq:{{{type}}}|div|</div><div style="display:inline-table;width:{{#var:width}};min-width:{{#var:minwidth}};{{#var:boxstyle}}{{#var:textstyle}}">|}}<!--
+
-->{{#ifeq:{{{type}}}|div|</div><div style="display:inline-table;width:{{#var:width}};min-width:{{#var:minwidth}};{{#var:boxstyle}}background-color:{{#var:background}};{{#var:textstyle}}">|}}<!--
 
-->{{#ifeq:{{{type}}}|end|</div>|}}
 
-->{{#ifeq:{{{type}}}|end|</div>|}}

Revision as of 09:37, 20 January 2020

Parameters

type(required): begin / div / end

cols(default 3): number of columns on widest screen

border(default false): whether the box should have a border

background(default transparent): the background of the grid cell. Defaults to white if border is true.

center(default false): center the text in the div