Template:Notify: Difference between revisions

From Open Fortress Wiki
Jump to navigation Jump to search
(Created page with "{{Doc}} <includeonly> <onlyinclude>{{#switch:{{{mode|}}} | inline = <{{#if:{{{text|}}}{{{1|}}}|div|span}} style="margin:{{#if:{{{text|{{{1|}}}}}}|.5em 0|0}}; margin-{{text-dir|ltr=left|rtl=right}}:calc(2em * {{#expr:{{{offset|0}}}.}}); display:{{#if:{{{text|{{{1|}}}}}}|flex|inline-flex}}; {{#if:{{{text|{{{1|}}}}}}|gap:4px;|}}{{#if:{{{text|{{{1|}}}}}}|background:linear-gradient(90deg, rgba({{{color|240,240,240}}},.04) 0%, transparent 100%); border-left:2px solid rgb({{{...")
 
No edit summary
 
Line 6: Line 6:
| inline = <{{#if:{{{text|}}}{{{1|}}}|div|span}} style="margin:{{#if:{{{text|{{{1|}}}}}}|.5em 0|0}}; margin-{{text-dir|ltr=left|rtl=right}}:calc(2em * {{#expr:{{{offset|0}}}.}}); display:{{#if:{{{text|{{{1|}}}}}}|flex|inline-flex}}; {{#if:{{{text|{{{1|}}}}}}|gap:4px;|}}{{#if:{{{text|{{{1|}}}}}}|background:linear-gradient(90deg, rgba({{{color|240,240,240}}},.04) 0%, transparent 100%); border-left:2px solid rgb({{{color|240,240,240}}}); border-radius:2px; padding:{{#if:{{{text|{{{1|}}}}}}|6px 0 4px 12px|2px 0 0 8px}};|<!-- Empty -->}} {{{root_inline_style|}}}"><!--
| inline = <{{#if:{{{text|}}}{{{1|}}}|div|span}} style="margin:{{#if:{{{text|{{{1|}}}}}}|.5em 0|0}}; margin-{{text-dir|ltr=left|rtl=right}}:calc(2em * {{#expr:{{{offset|0}}}.}}); display:{{#if:{{{text|{{{1|}}}}}}|flex|inline-flex}}; {{#if:{{{text|{{{1|}}}}}}|gap:4px;|}}{{#if:{{{text|{{{1|}}}}}}|background:linear-gradient(90deg, rgba({{{color|240,240,240}}},.04) 0%, transparent 100%); border-left:2px solid rgb({{{color|240,240,240}}}); border-radius:2px; padding:{{#if:{{{text|{{{1|}}}}}}|6px 0 4px 12px|2px 0 0 8px}};|<!-- Empty -->}} {{{root_inline_style|}}}"><!--


-->{{#if:{{{type|}}}|<strong style="display:table-cell; color:rgb({{{color|240,240,240}}}); white-space:nowrap; {{{type style|}}}"><span style="user-select:none; {{{img style|}}}">{{#if:{{{img|}}}|<span style="margin-right:4px;">[[File:{{{img|}}}|{{#if:{{{size|}}}|{{{size}}}{{!}}|}}link=]]</span>}}</span>{{{type|}}}{{{suff|:}}}</strong>|}}<!--
-->{{#if:{{{type|}}}|<strong style="display:table-cell; color:rgb({{{color|20,20,20}}}); white-space:nowrap; {{{type style|}}}"><span style="user-select:none; {{{img style|}}}">{{#if:{{{img|}}}|<span style="margin-right:4px;">[[File:{{{img|}}}|{{#if:{{{size|}}}|{{{size}}}{{!}}|}}link=]]</span>}}</span>{{{type|}}}{{{suff|:}}}</strong>|}}<!--


--><span style="display:table-cell; {{{text style|}}}">{{{text|{{{1|}}}}}}</span></{{#if:{{{text|}}}{{{1|}}}|div|span}}>
--><span style="display:table-cell; {{{text style|}}}">{{{text|{{{1|}}}}}}</span></{{#if:{{{text|}}}{{{1|}}}|div|span}}>

Latest revision as of 02:40, 4 January 2025

Template Documentation [edit]

Different types of notifications in one template. Created as a basis for other templates.

Copy and Paste

{{Notify | mode = inline | size = 10px | img = | text = | color = }}

Parameters and Examples

Shared

Parameter Description Example Preview
{{{1}}} or {{{text}}} Your text.
Important: Do not use {{{text}}} in other templates that are based on this template. The named parameter breaks the lists.
| Hello, World!
| text = Hello, World!
Hello, World!
Hello, World!
{{{mode}}} Switches the template modes. Avaliable modes: inline.
| mode = inline
Hello, World!

Inline mode

Parameter Description Example Preview
{{{img}}} Notification icon.
| img = Note.png
Hello, World!
{{{size}}} Notification icon size (Highly recommended to specify since most icons support high DPI.)
| size = 16px
File:Important template.pngImportant:Hello, World!
{{{type}}} Notification type.
| type = Warning
File:Important template.pngImportant:Hello, World!
{{{color}}} Notification color (RGB only).
RGBA may also work.
| color = 240,211,0
File:Important template.pngImportant:Hello, World!

Offset

  1. File:Important template.pngImportant:Hello, World!
  2. File:Important template.pngImportant:Hello, World!
  3. File:Important template.pngImportant:Hello, World!
  4. File:Important template.pngImportant:Hello, World!
  5. File:Important template.pngImportant:Hello, World!
  6. File:Important template.pngImportant:Hello, World!
  7. File:Important template.pngImportant:Hello, World!

Custom styles

  1. File:Important template.pngImportant:Hello, World!
  2. File:Important template.pngImportant:Hello, World!
  3. File:Important template.pngImportant:Hello, World!
  4. File:Important template.pngImportant:Hello, World!
  5. File:Important template.pngImportant:Hello, World!
  6. File:Important template.pngImportant:Hello, World!
  7. File:Important template.pngImportant:Hello, World!
  8. File:Important template.pngImportant:Hello, World!
  9. File:Important template.pngImportant:Hello, World!
  10. File:Important template.pngImportant:Hello, World!
  11. File:Important template.pngImportant:Hello, World!
  12. File:Important template.pngImportant:Hello, World!
  13. File:Important template.pngImportant:Hello, World!
  14. File:Important template.pngImportant:Hello, World!
  15. File:Important template.pngImportant:Hello, World!
  16. File:Important template.pngImportant:Hello, World!

Special Subpages

See also