Jump to navigation
Jump to search
m (fixed a typo) Tags: Mobile edit Mobile web edit |
(Added a switch nested in an if statement, in case an editor wishes to change the align-items property to something other than stretch. It doesn't seem to effect already existing instances of CBC, so I'm saving this with cautious optimism.) Tag: Reverted |
||
Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:ContentBoxContainer/styles.css" /><div class="t-cb-container"></includeonly><noinclude> | <includeonly><templatestyles src="Template:ContentBoxContainer/styles.css" /><div class="t-cb-container" {{#if:{{{1|}}}|style="align-items:{{#switch:{{{1|}}}|flex-start=flex-start|center=center|flex-end=flex-end|stretch=stretch|stretch}}"}}> | ||
</includeonly><noinclude> | |||
{{TemplateStyles|Template:ContentBoxContainer/styles.css}} | {{TemplateStyles|Template:ContentBoxContainer/styles.css}} | ||
Template to contain boxes of content that flex. Should precede a series of <nowiki><div></nowiki> boxes with content inside them. | Template to contain boxes of content that flex. Should precede a series of <nowiki><div></nowiki> boxes with content inside them. | ||
After all boxes are defined, close the template with <nowiki></div></nowiki>. | After all boxes are defined, close the template with <nowiki></div></nowiki>. | ||
This template has one optional variable that can be used to change the <code>align-items</code> style property. If variable is not an acceptable property type, or if there is no variable, then the <code>stretch</code> property type is used as default. Here is a list of acceptable parameters: | |||
*<code>stretch</code>. The default parameter. Forces all items in the CBC to stretch to the size of the largest one, regardless of their contents. | |||
*<code>flex-start</code>. All items are attached to the top of the box. The size of each item depends on the contents of that item. | |||
*<code>flex-end</code>. All items are attached to the bottom of the box. | |||
*<code>center</code>. All items are attached to the center of the box; i.e. the center of each item is aligned with the center of the CBC. | |||
[[Category:Templates]]</noinclude> | [[Category:Templates]]</noinclude> |
Revision as of 21:28, 24 January 2024
Template to contain boxes of content that flex. Should precede a series of <div> boxes with content inside them.
After all boxes are defined, close the template with </div>.
This template has one optional variable that can be used to change the align-items
style property. If variable is not an acceptable property type, or if there is no variable, then the stretch
property type is used as default. Here is a list of acceptable parameters:
stretch
. The default parameter. Forces all items in the CBC to stretch to the size of the largest one, regardless of their contents.flex-start
. All items are attached to the top of the box. The size of each item depends on the contents of that item.flex-end
. All items are attached to the bottom of the box.center
. All items are attached to the center of the box; i.e. the center of each item is aligned with the center of the CBC.