Template:Msgbox: Difference between revisions
Created page with "<div style="border: 1px solid {{{border|var(--border-color-base, #a2a9b1)}}}; border-left: 10px solid {{{accent|var(--border-color-progressive, #36c)}}}; background-color: {{{bg|var(--background-color-neutral-subtle, #f8f9fa)}}}; color: var(--color-base, #202122); padding: 8px 12px; margin-bottom: 1em; line-height: 1.5; box-sizing: border-box;"> '''{{{issue|{{{1|}}}}}}''' {{{fix|{{{2|}}}}}} </div><noinclude> <div style="border: 1px solid var(--border-color-base, #a2a9b1)..." Tag: 2017 source edit |
No edit summary Tag: 2017 source edit |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<div style="border: 1px solid {{{border|var(--border-color-base, #a2a9b1)}}}; border-left: 10px solid {{{accent|var(--border-color-progressive, #36c)}}}; background-color: {{{bg|var(--background-color-neutral-subtle, #f8f9fa)}}}; color: var(--color-base, #202122); padding: 8px 12px; margin-bottom: 1em; line-height: 1.5; box-sizing: border-box;"> | <div style="border: 1px solid {{{border|var(--border-color-base, #a2a9b1)}}}; border-left: 10px solid {{{accent|var(--border-color-progressive, #36c)}}}; background-color: {{{bg|var(--background-color-neutral-subtle, #f8f9fa)}}}; color: var(--color-base, #202122); padding: 8px 12px; margin-bottom: 1em; line-height: 1.5; box-sizing: border-box; display: flex; align-items: center; gap: 10px;"> | ||
<div style="flex-shrink: 0; font-size: 24px;">{{{icon|}}}</div> | |||
<div>{{#if:{{{text|}}}|{{{text|}}}|{{{issue|{{{1|}}}}}} {{{fix|{{{2|}}}}}} }}</div> | |||
</div><noinclude> | </div><noinclude> | ||
<div style="border: 1px solid var(--border-color-base, #a2a9b1); background-color: var(--background-color-success-subtle, #ecfcf4); padding: 1em; margin-top: 1em;"> | <div style="border: 1px solid var(--border-color-base, #a2a9b1); background-color: var(--background-color-success-subtle, #ecfcf4); padding: 1em; margin-top: 1em;"> | ||
| Line 8: | Line 9: | ||
== Basic usage == | == Basic usage == | ||
=== Simple (issue + fix) === | |||
<pre> | <pre> | ||
{{Msgbox | {{Msgbox | ||
|issue=Describe the problem. | |icon=ℹ️ | ||
|issue='''Describe the problem.''' | |||
|fix=Describe what the editor should do. | |fix=Describe what the editor should do. | ||
}} | }} | ||
| Line 19: | Line 23: | ||
{{Msgbox | {{Msgbox | ||
|issue=Describe the problem. | |icon=ℹ️ | ||
|issue='''Describe the problem.''' | |||
|fix=Describe what the editor should do. | |fix=Describe what the editor should do. | ||
}} | |||
=== Rich text (text parameter) === | |||
Use <code>text</code> instead of <code>issue</code>/<code>fix</code> when you need lists, multiple paragraphs, or any complex wikitext: | |||
<pre> | |||
{{Msgbox | |||
|icon=⚠️ | |||
|accent=var(--border-color-warning, #edab00) | |||
|bg=var(--background-color-warning-subtle, #fef6e7) | |||
|text='''This article has multiple issues.''' Please help [[Rollerskating Wiki:Contributing|improve it]] or discuss these issues on the [[{{TALKPAGENAME}}|talk page]]. | |||
* This article '''may contain original research.''' | |||
* This article '''needs additional citations''' for verification. | |||
}} | |||
</pre> | |||
Renders as: | |||
{{Msgbox | |||
|icon=⚠️ | |||
|accent=var(--border-color-warning, #edab00) | |||
|bg=var(--background-color-warning-subtle, #fef6e7) | |||
|text='''This article has multiple issues.''' Please help [[Rollerskating Wiki:Contributing|improve it]] or discuss these issues on the [[{{TALKPAGENAME}}|talk page]]. | |||
* This article '''may contain original research.''' | |||
* This article '''needs additional citations''' for verification. | |||
}} | }} | ||
| Line 28: | Line 59: | ||
! Parameter !! Required !! Description | ! Parameter !! Required !! Description | ||
|- | |- | ||
| <code>issue</code> or <code>1</code> || | | <code>text</code> || No || Freeform rich content. Overrides <code>issue</code> and <code>fix</code> when provided. Supports any wikitext: bold, links, lists, multiple paragraphs. | ||
|- | |||
| <code>issue</code> or <code>1</code> || No || Problem statement (add <code><nowiki>'''bold'''</nowiki></code> in calling templates). Used when <code>text</code> is not provided. | |||
|- | |||
| <code>fix</code> or <code>2</code> || No || What should be done to fix it. Appended after <code>issue</code>. Used when <code>text</code> is not provided. | |||
|- | |- | ||
| <code> | | <code>icon</code> || No || Emoji or image shown to the left of the text. Default: none. | ||
|- | |- | ||
| <code>accent</code> || No || Left border color (CSS value or Codex token). Default: progressive blue | | <code>accent</code> || No || Left border color (CSS value or Codex token). Default: progressive blue. | ||
|- | |- | ||
| <code>bg</code> || No || Background color. Default: neutral subtle | | <code>bg</code> || No || Background color. Default: neutral subtle. | ||
|- | |- | ||
| <code>border</code> || No || Outer border color. Default: base | | <code>border</code> || No || Outer border color. Default: base. | ||
|} | |} | ||
| Line 48: | Line 83: | ||
<pre> | <pre> | ||
{{Msgbox|issue=This is a notice.|fix=No action needed.}} | {{Msgbox|icon=ℹ️|issue='''This is a notice.''' |fix=No action needed.}} | ||
</pre> | </pre> | ||
{{Msgbox|issue=This is a notice.|fix=No action needed.}} | {{Msgbox|icon=ℹ️|issue='''This is a notice.''' |fix=No action needed.}} | ||
=== Warning (content and style issues) === | === Warning (content and style issues) === | ||
| Line 58: | Line 93: | ||
<pre> | <pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=⚠️ | |||
|accent=var(--border-color-warning, #edab00) | |accent=var(--border-color-warning, #edab00) | ||
|bg=var(--background-color-warning-subtle, #fef6e7) | |bg=var(--background-color-warning-subtle, #fef6e7) | ||
|issue=This article needs additional citations. | |issue='''This article needs additional citations.''' | ||
|fix=Please help improve it by adding reliable sources. | |fix=Please help improve it by adding reliable sources. | ||
}} | }} | ||
</pre> | </pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=⚠️ | |||
|accent=var(--border-color-warning, #edab00) | |accent=var(--border-color-warning, #edab00) | ||
|bg=var(--background-color-warning-subtle, #fef6e7) | |bg=var(--background-color-warning-subtle, #fef6e7) | ||
|issue=This article needs additional citations. | |issue='''This article needs additional citations.''' | ||
|fix=Please help improve it by adding reliable sources. | |fix=Please help improve it by adding reliable sources. | ||
}} | }} | ||
| Line 77: | Line 114: | ||
<pre> | <pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=❌ | |||
|accent=var(--border-color-error, #d33) | |accent=var(--border-color-error, #d33) | ||
|bg=var(--background-color-error-subtle, #fee7e6) | |bg=var(--background-color-error-subtle, #fee7e6) | ||
|issue=This article has been proposed for deletion. | |issue='''This article has been proposed for deletion.''' | ||
|fix=Discuss on the talk page. | |fix=Discuss on the talk page. | ||
}} | }} | ||
</pre> | </pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=❌ | |||
|accent=var(--border-color-error, #d33) | |accent=var(--border-color-error, #d33) | ||
|bg=var(--background-color-error-subtle, #fee7e6) | |bg=var(--background-color-error-subtle, #fee7e6) | ||
|issue=This article has been proposed for deletion. | |issue='''This article has been proposed for deletion.''' | ||
|fix=Discuss on the talk page. | |fix=Discuss on the talk page. | ||
}} | }} | ||
| Line 96: | Line 135: | ||
<pre> | <pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=✅ | |||
|accent=var(--border-color-success, #14866d) | |accent=var(--border-color-success, #14866d) | ||
|bg=var(--background-color-success-subtle, #ecfcf4) | |bg=var(--background-color-success-subtle, #ecfcf4) | ||
|issue=This issue has been resolved. | |issue='''This issue has been resolved.''' | ||
|fix=You may remove this notice. | |fix=You may remove this notice. | ||
}} | }} | ||
</pre> | </pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=✅ | |||
|accent=var(--border-color-success, #14866d) | |accent=var(--border-color-success, #14866d) | ||
|bg=var(--background-color-success-subtle, #ecfcf4) | |bg=var(--background-color-success-subtle, #ecfcf4) | ||
|issue=This issue has been resolved. | |issue='''This issue has been resolved.''' | ||
|fix=You may remove this notice. | |fix=You may remove this notice. | ||
}} | }} | ||
| Line 115: | Line 156: | ||
<pre> | <pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=🔀 | |||
|accent=var(--border-color-progressive, #36c) | |accent=var(--border-color-progressive, #36c) | ||
|bg=var(--background-color-progressive-subtle, #eaf3ff) | |bg=var(--background-color-progressive-subtle, #eaf3ff) | ||
|issue=It has been suggested that this article be merged. | |issue='''It has been suggested that this article be merged.''' | ||
|fix=Discuss on the talk page. | |fix=Discuss on the talk page. | ||
}} | }} | ||
</pre> | </pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=🔀 | |||
|accent=var(--border-color-progressive, #36c) | |accent=var(--border-color-progressive, #36c) | ||
|bg=var(--background-color-progressive-subtle, #eaf3ff) | |bg=var(--background-color-progressive-subtle, #eaf3ff) | ||
|issue=It has been suggested that this article be merged. | |issue='''It has been suggested that this article be merged.''' | ||
|fix=Discuss on the talk page. | |fix=Discuss on the talk page. | ||
}} | }} | ||
| Line 134: | Line 177: | ||
<pre> | <pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=🔒 | |||
|accent=var(--border-color-base, #a2a9b1) | |accent=var(--border-color-base, #a2a9b1) | ||
|bg=var(--background-color-neutral-subtle, #f8f9fa) | |bg=var(--background-color-neutral-subtle, #f8f9fa) | ||
|issue=This article is semi-protected. | |issue='''This article is semi-protected.''' | ||
|fix=Only autoconfirmed users may edit. | |fix=Only autoconfirmed users may edit. | ||
}} | }} | ||
</pre> | </pre> | ||
{{Msgbox | {{Msgbox | ||
|icon=🔒 | |||
|accent=var(--border-color-base, #a2a9b1) | |accent=var(--border-color-base, #a2a9b1) | ||
|bg=var(--background-color-neutral-subtle, #f8f9fa) | |bg=var(--background-color-neutral-subtle, #f8f9fa) | ||
|issue=This article is semi-protected. | |issue='''This article is semi-protected.''' | ||
|fix=Only autoconfirmed users may edit. | |fix=Only autoconfirmed users may edit. | ||
}} | }} | ||
| Line 197: | Line 242: | ||
== Shortcut templates == | == Shortcut templates == | ||
These templates wrap <code><nowiki>{{Msgbox}}</nowiki></code> with preset styles: | These templates wrap <code><nowiki>{{Msgbox}}</nowiki></code> with preset styles and icons: | ||
{| class="wikitable" | {| class="wikitable" | ||
! Template !! Style !! Usage | ! Template !! Icon !! Style !! Usage | ||
|- | |||
| <code><nowiki>{{Stub}}</nowiki></code> || 📝 || Notice (blue) || Article is too short | |||
|- | |||
| <code><nowiki>{{Citation needed}}</nowiki></code> || 📚 || Warning (orange) || Needs sources | |||
|- | |- | ||
| <code><nowiki>{{ | | <code><nowiki>{{Cleanup}}</nowiki></code> || 🧹 || Warning (orange) || Formatting/quality issues | ||
|- | |- | ||
| <code><nowiki>{{ | | <code><nowiki>{{Original research}}</nowiki></code> || ⚠️ || Warning (orange) || Unverified claims | ||
|- | |- | ||
| <code><nowiki>{{ | | <code><nowiki>{{Under construction}}</nowiki></code> || 🚧 || Notice (blue) || Work in progress | ||
|- | |- | ||
| <code><nowiki>{{ | | <code><nowiki>{{Merge}}</nowiki></code> || 🔀 || Progressive (blue) || Merge proposal | ||
|- | |- | ||
| <code><nowiki>{{ | | <code><nowiki>{{Delete}}</nowiki></code> || ❌ || Error (red) || Deletion proposal | ||
|- | |- | ||
| <code><nowiki>{{ | | <code><nowiki>{{Fact checked}}</nowiki></code> || ✅ || Success (green) || Verified content | ||
|- | |- | ||
| <code><nowiki>{{ | | <code><nowiki>{{Unverified}}</nowiki></code> || 🔍 || Warning (orange) || Not yet fact-checked | ||
|} | |} | ||
== See also == | == See also == | ||
* [[Rollerskating Wiki:Guidelines]] | * [[Rollerskating Wiki:Contributing Guidelines]] | ||
* [[Rollerskating Wiki:Contributing]] | * [[Rollerskating Wiki:Contributing]] | ||
* [https://doc.wikimedia.org/codex/latest/design-tokens/ Codex Design Tokens documentation] | * [https://doc.wikimedia.org/codex/latest/design-tokens/ Codex Design Tokens documentation] | ||
</div> | </div> | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "A message box for article notices, warnings, and maintenance tags. Supports both simple (issue/fix) and freeform (text) modes. Uses Codex design tokens for automatic light/dark theme support.", | |||
"params": { | |||
"text": { | |||
"label": "Text", | |||
"description": "Freeform rich content. Overrides issue and fix when provided. Supports any wikitext: bold, links, lists, paragraphs.", | |||
"type": "content", | |||
"required": false | |||
}, | |||
"issue": { | |||
"label": "Issue", | |||
"description": "Short problem statement. Used when text is not provided.", | |||
"type": "content", | |||
"required": false, | |||
"aliases": ["1"] | |||
}, | |||
"fix": { | |||
"label": "Fix", | |||
"description": "What should be done to fix the issue. Appended after issue. Used when text is not provided.", | |||
"type": "content", | |||
"required": false, | |||
"aliases": ["2"] | |||
}, | |||
"icon": { | |||
"label": "Icon", | |||
"description": "Emoji or image shown to the left of the text.", | |||
"type": "string", | |||
"required": false, | |||
"suggestedvalues": ["ℹ️", "⚠️", "❌", "✅", "🔀", "🔒", "📝", "📚", "🧹", "🚧"] | |||
}, | |||
"accent": { | |||
"label": "Accent color", | |||
"description": "Left border color. Use a Codex design token for automatic dark mode support.", | |||
"type": "string", | |||
"required": false, | |||
"default": "var(--border-color-progressive, #36c)", | |||
"suggestedvalues": [ | |||
"var(--border-color-progressive, #36c)", | |||
"var(--border-color-warning, #edab00)", | |||
"var(--border-color-error, #d33)", | |||
"var(--border-color-success, #14866d)", | |||
"var(--border-color-base, #a2a9b1)" | |||
] | |||
}, | |||
"bg": { | |||
"label": "Background color", | |||
"description": "Background color. Use a Codex design token for automatic dark mode support.", | |||
"type": "string", | |||
"required": false, | |||
"default": "var(--background-color-neutral-subtle, #f8f9fa)", | |||
"suggestedvalues": [ | |||
"var(--background-color-neutral-subtle, #f8f9fa)", | |||
"var(--background-color-warning-subtle, #fef6e7)", | |||
"var(--background-color-error-subtle, #fee7e6)", | |||
"var(--background-color-success-subtle, #ecfcf4)", | |||
"var(--background-color-progressive-subtle, #eaf3ff)" | |||
] | |||
}, | |||
"border": { | |||
"label": "Border color", | |||
"description": "Outer border color.", | |||
"type": "string", | |||
"required": false, | |||
"default": "var(--border-color-base, #a2a9b1)" | |||
} | |||
}, | |||
"format": "block", | |||
"paramOrder": ["icon", "text", "issue", "fix", "accent", "bg", "border"] | |||
} | } | ||
</templatedata></noinclude> | </templatedata> | ||
[[Category:Template documentation]] | |||
</noinclude> | |||