Template:Box: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
--box-text-weight-impl: var(--box-text-weight, 500); | --box-text-weight-impl: var(--box-text-weight, 500); | ||
--box-border-color-impl: {{{borderColor|{{{color|var(-- | --box-border-color-impl: {{{borderColor|{{{color|var(--box-border-color, var(--border-color-base))}}}}}}; | ||
--box-border-size-impl: var(--box-border-size, 1px); | --box-border-size-impl: var(--box-border-size, 1px); | ||
--box-border-radius-impl: var(--box-border-radius, 0.5rem); | --box-border-radius-impl: var(--box-border-radius, 0.5rem); | ||
--box-padding-impl: {{{padding|var(--box-padding, 1.2rem)}}}; | --box-padding-impl: {{{padding|var(--box-padding, 1.2rem)}}}; | ||
--box-margin-impl: {{{margin|var(--box-margin, 10px) 0}}}; | |||
--box-wiki-content-padding-top: calc(var(--box-padding-impl) - 1em); | |||
--box-wiki-content-padding-bottom: calc(var(--box-padding-impl) - 0.8em); | |||
--box-wiki-content-padding: var(--box-wiki-content-padding-top) var(--box-padding-impl) var(--box-wiki-content-padding-bottom) var(--box-padding-impl); | |||
display: flex; | display: flex; | ||
background: var(--box-background-impl); | background: var(--box-background-impl); | ||
color: var(--box-color-impl); | color: var(--box-color-impl); | ||
padding: var(--box-padding-impl); | padding: {{#ifeq: {{{wikiContent|no}}}|yes|var(--box-wiki-content-padding)|var(--box-padding-impl)}}; | ||
margin: | margin: var(--box-margin-impl); | ||
border: var(--box-border-size-impl) solid var(--box-border-color-impl); | border: var(--box-border-size-impl) solid var(--box-border-color-impl); | ||
border-radius: var(--box-border-radius-impl); | border-radius: var(--box-border-radius-impl); | ||
{{{extraStyle|}}} | |||
"> | "> | ||
<div class="box-content" style="flex-grow: 1;">{{{1}}}</div> | <div class="box-content" style="{{#if:{{{display|}}}|display: {{{display}}};|}} flex-grow: 1;">{{{1}}}</div> | ||
</div></includeonly><noinclude> | </div></includeonly><noinclude>{{Documentation}}</noinclude> | ||
{{ | |||
</noinclude> |
Latest revision as of 16:19, 14 June 2025
Template Documentation [edit source| uses| help]
This template is used to generate boxes that can hold content. In particular, boxes are used for notices. An example of a box holding content:
This is a box with some text content
Usage
Simply feed in your content as the first argument to the template:
{{Box|This is a box with some text content}}
If you need content that is styled via MediaWiki syntax, you might need to place your content on a new line. You can also set the wikiContent
argument in order to adjust the padding of the box to fit the content in a more visually appealing manner:
{{Box|wikiContent=yes|
== Heading ==
Some content
}}
Heading
Some content