Difference between revisions of "Template:Admonition"
From ThresholdRPG Wiki
(Created page with "<includeonly>{{#switch: {{{type|note}}} | note = {{#vardefine: icon|π}}{{#vardefine: color|#448aff}}{{#vardefine: title|Note}} | warning = {{#vardefine: icon|β οΈ}}{{...") |
|||
Line 1: | Line 1: | ||
β | <includeonly>{{#switch: {{{type|note}}} | + | <includeonly>{| style="margin: 1.5em 0; padding: 0; border-left: 4px solid {{#switch: {{{type|note}}} |
β | | note = | + | | note = #448aff |
β | | warning = | + | | warning = #ff9100 |
β | | tip = | + | | tip = #00bfa5 |
β | | important = | + | | important = #ff1744 |
β | | info = | + | | info = #2196f3 |
β | | question = | + | | question = #9c27b0 |
β | | caution = | + | | caution = #ff5722 |
β | + | | #default = #448aff | |
β | + | }}; background-color: #f8f9fa; width: 100%;" | |
β | ! style="padding: 8px 12px; background-color: {{# | + | ! style="padding: 8px 12px; background-color: {{#switch: {{{type|note}}} |
+ | | note = #448aff15 | ||
+ | | warning = #ff910015 | ||
+ | | tip = #00bfa515 | ||
+ | | important = #ff174415 | ||
+ | | info = #2196f315 | ||
+ | | question = #9c27b015 | ||
+ | | caution = #ff572215 | ||
+ | | #default = #448aff15 | ||
+ | }}; font-weight: bold;" | {{#switch: {{{type|note}}} | ||
+ | | note = π | ||
+ | | warning = β οΈ | ||
+ | | tip = π‘ | ||
+ | | important = β | ||
+ | | info = βΉοΈ | ||
+ | | question = β | ||
+ | | caution = π§ | ||
+ | | #default = π | ||
+ | }} {{{title|{{#switch: {{{type|note}}} | ||
+ | | note = Note | ||
+ | | warning = Warning | ||
+ | | tip = Tip | ||
+ | | important = Important | ||
+ | | info = Info | ||
+ | | question = Question | ||
+ | | caution = Caution | ||
+ | | #default = Note | ||
+ | }}}}} | ||
|- | |- | ||
| style="padding: 12px;" | {{{1}}} | | style="padding: 12px;" | {{{1}}} | ||
Line 37: | Line 64: | ||
=== Examples === | === Examples === | ||
β | <nowiki> | + | <pre> |
β | {{Admonition|This is a default note.}} | + | <nowiki>{{Admonition|This is a default note.}}</nowiki> |
β | + | <nowiki>{{Admonition|type=warning|This is a warning message.}}</nowiki> | |
β | {{Admonition|type=warning|This is a warning message.}} | + | <nowiki>{{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}}</nowiki> |
β | + | <nowiki>{{Admonition|type=important|This is important information.}}</nowiki> | |
β | {{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}} | + | <nowiki>{{Admonition|type=info|This is additional information.}}</nowiki> |
β | + | <nowiki>{{Admonition|type=question|Have you considered this?}}</nowiki> | |
β | {{Admonition|type=important|This is important information.}} | + | <nowiki>{{Admonition|type=caution|Proceed with caution.}}</nowiki> |
β | + | </pre> | |
β | {{Admonition|type=info|This is additional information.}} | ||
β | |||
β | {{Admonition|type=question|Have you considered this?}} | ||
β | |||
β | {{Admonition|type=caution|Proceed with caution.}} | ||
β | </ | ||
=== Live Examples === | === Live Examples === |
Revision as of 02:44, 6 February 2025
Usage
This template creates admonition boxes (highlighted message boxes) with different styles based on type.
Syntax
{{Admonition|type=TYPE|text}}
or
{{Admonition|type=TYPE|title=CUSTOM TITLE|text}}
Available Types
- note (default) - For general information
- warning - For warning messages
- tip - For helpful tips
- important - For crucial information
- info - For additional information
- question - For questions or FAQs
- caution - For careful consideration
Examples
{{Admonition|This is a default note.}} {{Admonition|type=warning|This is a warning message.}} {{Admonition|type=tip|title=Pro Tip!|This is a custom-titled tip.}} {{Admonition|type=important|This is important information.}} {{Admonition|type=info|This is additional information.}} {{Admonition|type=question|Have you considered this?}} {{Admonition|type=caution|Proceed with caution.}}
Live Examples
- 448aff; background-color: #f8f9fa; width: 100%;"
style="padding: 8px 12px; background-color:
|
---|
This is a default note. |
- ff9100; background-color: #f8f9fa; width: 100%;"
style="padding: 8px 12px; background-color:
|
---|
This is a warning message. |
- 00bfa5; background-color: #f8f9fa; width: 100%;"
style="padding: 8px 12px; background-color:
|
---|
This is a custom-titled tip. |