Jump to content

Template:Notice: Difference between revisions

From Consumer_Action_Taskforce
Expanding on notice capabilities
m Protected "Template:Notice" ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- Template:Notice -->
<div class="notice" style="background-color: var(--background-color-interactive-subtle, #f8f9fa); border: 1px solid #eaecf0; padding: 10px; margin: 10px 0;">
<includeonly>
<div class="notice" style="background-color: {{#switch: {{{severity|}}}
  | warning = #fff3cd
  | draft = #cfe2ff
  | error = #f8d7da
  | success = #d1e7dd
  | #f8f9fa
}}; border: 1px solid {{#switch: {{{severity|}}}
  | warning = #ffeeba
  | draft = #9ec5fe
  | error = #f5c2c7
  | success = #badbcc
  | #eaecf0
}}; padding: 10px; margin: 10px 0;">
{{{1}}}
{{{1}}}
</div>
</div>
</includeonly>
 
<noinclude>
<noinclude>
== Usage ==
== Usage ==
Basic usage (unchanged behavior):
Use this template to display important notices to readers.
 
<pre>
<pre>
{{Notice|Your notice text here}}
{{Notice|Your notice text here}}
</pre>
</pre>


With severity level:
== Preview ==
<pre>
This is how the notice will appear:
{{Notice|severity=warning|Your warning text here}}
{{Notice|severity=draft|Your draft notice here}}
{{Notice|severity=error|Your error message here}}
{{Notice|severity=success|Your success message here}}
</pre>
 
=== Severity Colors ===
* '''Default:''' Light gray background (#f8f9fa)
* '''Warning:''' Light yellow background (#fff3cd)
* '''Draft:''' Light blue background (#cfe2ff)
* '''Error:''' Light red background (#f8d7da)
* '''Success:''' Light green background (#d1e7dd)


[[Category:Templates]]
<div class="notice" style="background-color: var(--background-color-interactive-subtle, #f8f9fa); border: 1px solid #eaecf0; padding: 10px; margin: 10px 0;">
This is an example notice message.
</div>
[[Category:Alert templates]]
</noinclude>
</noinclude>

Latest revision as of 10:14, 1 March 2025

{{{1}}}


Usage

Use this template to display important notices to readers.

{{Notice|Your notice text here}}

Preview

This is how the notice will appear:

This is an example notice message.