Template:Callout: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
-->{{#switch: {{lc: {{{1}}}}} | -->{{#switch: {{#vardefineecho: callout_type|{{lc: {{{1}}}}}<!--/vardefine-->}} | ||
|info = | |info = | ||
{{#vardefine: callout_header|Info}} | {{#vardefine: callout_header|Info}} | ||
Line 24: | Line 24: | ||
}}<!-- | }}<!-- | ||
# override the header label if needed | |||
-->{{#if: {{#vardefineecho: callout_header_override|{{{header|{{{h|}}}}}}}} | -->{{#if: {{#vardefineecho: callout_header_override|{{{header|{{{h|}}}}}}}} | ||
|{{#vardefine: callout_header|{{#var:callout_header_override}}}} | |{{#vardefine: callout_header|{{#var:callout_header_override}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#vardefine: callout_align | |||
|{{lc: {{{align|{{{a|left}}}}}}}} | |||
}}<!-- | |||
-->{{#vardefine: callout_min_width | |||
|{{#ifeq: {{#var:callout_align}}|center<!-- | |||
# for centered callouts, turn them into a banner by spanning them the full page's width | |||
-->|80%<!-- | |||
# otherwise, keep it tidy | |||
-->|20rem<!-- | |||
-->}}<!-- | |||
-->}}<!-- | |||
--><div class="callout-wrapper" style=" | --><div class="callout-wrapper" style=" | ||
display: flex; | display: flex; | ||
justify-content: {{ | justify-content: {{#var:callout_align}}; | ||
"> | "> | ||
<div class="callout" style=" | <div class="callout" style=" | ||
width: fit-content; | width: fit-content; | ||
min-width: | min-width: {{#var:callout_min_width}}; | ||
padding: .5rem; | padding: .5rem; | ||
Revision as of 13:41, 14 August 2024
Examples
Types
Type | Syntax | Result |
---|---|---|
Info | {{Callout |
Info An informative message. |
Warning | {{Callout |
Warning Something to be warned about. |
Danger | {{Callout |
Danger The clown is closing in. |
Tip | {{Callout |
Tip When walking over slippery surfaces, hold Shift to slow down and not slip (in most cases). |
Example | {{Callout |
Example An example for something. |
Header label
{{Callout
or
{{Callout
↓
or
Alignment
Left
The default.
Center
{{Callout
or
{{Callout
↓
or
Right
{{Callout
↓
Images
| Info
| header = Work in Progress
| align = center
| This page is unfinished.
| image = Wired Frame.png
| image2 = Wrench.png
}}
↓
Stacked callouts
Sets the callout to a predefined width, making all callouts with the same class appear with the same width.
Callouts will be stacked to the right and will require {{clear}} after to not overflow with the content that goes after.
{{Callout
{{Callout
{{Clear}}
↓
Wrapper classes
Allows to add custom classes to the wrapper element.
{{Callout
↓
A template for producing various notices.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Type | 1 | Type of the callout. Select from the suggested values. Any casing is supported.
| Line | required |
Content | 2 | Content of the callout. | String | required |
Header label | header h | Header text of the callout. By default, depends on the type. | Line | suggested |
Align | align a | Alignment of the callout.
| Line | suggested |