Difference between revisions of "Template:Admonition"

From ThresholdRPG Wiki
Line 1: Line 1:
<includeonly>{| style="margin: 1.5em 0; padding: 0; border-left: 4px solid {{#switch: {{{type|note}}}
+
<includeonly>
  | note = #448aff
+
<div style="border-radius: 4px; border-left: 4px solid {{#switch: {{{type|note}}}|note=#448aff|warning=#ff9100|tip=#00bfa5|important=#ff1744|#default=#448aff}}; background: #444444; margin: 1em 0; border-radius: 3px;">
  | warning = #ff9100
+
<div style="background: {{#switch: {{{type|note}}}|note=#448aff33|warning=#ff910033|tip=#00bfa533|important=#ff174433|#default=#448aff33}}; padding: 8px 12px; font-weight: bold;">{{#switch: {{{type|note}}}|note=📝|warning=⚠️|tip=💡|important=❗|#default=📝}} {{{title|{{#switch: {{{type|note}}}|note=Note|warning=Warning|tip=Tip|important=Important|#default=Note}}}}}
  | tip = #00bfa5
+
</div>
  | important = #ff1744
+
<div style="padding: 12px;">{{{1}}}</div>
  | info = #2196f3
+
</div>
  | question = #9c27b0
 
  | caution = #ff5722
 
  | #default = #448aff
 
}}; background-color: #f8f9fa; width: 100%;"
 
! 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}}}
 
|}
 
 
</includeonly>
 
</includeonly>
 
<noinclude>
 
<noinclude>

Revision as of 02:53, 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

📝 Note
This is a default note.



⚠️ Warning
This is a warning message.



💡 Pro Tip!
This is a custom-titled tip.