Template:Col head/doc

This template is for creating headings that are designed to work well with CSS columns, such as those generated by div col and columns-list. Using this template prevents the heading from being placed at the very bottom of a column, which is usually undesirable.

With the optional  parameter, you can also force a column break to occur immediately before this heading. This can be useful if you have two semi-related lists that you want to put in the same set of columns without allowing them to mi (for example, you might use it in a sports roster to separate the players from the staff).

Usage

 * Basic usage


 * All parameters

Parameters

 * 1st parameter
 * The text content of your heading


 * The type of heading to use. The value should be one of the following:
 * The type of heading to use. The value should be one of the following:


 * If set, it will try to force a column break to occur immediately before this heading. This means that the heading will appear at the start of the next column.
 * If set, it will try to force a column break to occur immediately before this heading. This means that the heading will appear at the start of the next column.


 * Additional CSS to be added to the heading element
 * Additional CSS to be added to the heading element


 * CSS class(es) to be added to the heading element
 * CSS class(es) to be added to the heading element

Known issues
there are no browsers with CSS support for, so this template uses a hacky workaround with   to emulate that behavior. This workaround results in two edge case bugs (though they're both unlikely to occur in normal use cases for this template).

Very short container
If the height of your columns container is less than 5em (equal to 70px at normal font size in the Vector theme), 5em=70px), the browser will think that your is taller than the container. Chrome handles this by simply making the container taller, which looks fine. Firefox, on the other hand, ends up placing subsequent elements in very weird positions on the page, which looks very bad.

In general, avoid using this template in very short columns boxes. It seems unlikely that you would need this template in such a scenario anyway; with so little content, you would likely be better off using fixed or float columns rather than CSS columns.

Tall next sibling
If a heading is immediately followed by an element that has a height of at least 5em and cannot have a break inside it (such as an element with ), it would likely cause the column breaks to be inserted in odd places (this has not been tested). This means this template may not play nicely with large unbreakable elements such as images, but most typically-formatted elements should be fine.

TemplateData
{	"params": { "1": {			"label": "Text", "description": "The text to be used for your heading", "type": "content", "required": true },		"type": { "label": "Type", "description": "The style of heading to use. Options: h1, h2, ..., h6, bold, term, none", "type": "line", "default": "bold" },		"force": { "label": "Force column break?", "description": "If set to any value, a column break will occur immediately before this heading (meaning this heading will be placed at the top of the next column)", "type": "boolean" },		"style": { "label": "Style", "description": "Additional CSS to apply to the heading tag", "example": "color:blue; text-align:center;", "type": "string" },		"class": { "label": "Class", "description": "Additional CSS class(es) to add to the heading tag", "type": "string" }	},	"description": "This template is for creating headings that are designed to work well with CSS columns, such as those generated by and . Using this template prevents the heading from being placed at the very bottom of a column, which is usually undesirable.", "paramOrder": [ "1",		"type", "force", "style", "class" ],	"format": "inline" }