Template:Notify: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Undo revision 439114 by Wisdurm (talk) of course it doesn't work)
Tag: Undo
m (Undo revision 439115 by Wisdurm (talk) maybe now?)
Tag: Undo
Line 1: Line 1:
{{Doc}}
{{Doc}}
<includeonly><onlyinclude>{{#switch:{{{mode|}}}
<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;|}} 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}}; {{{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|}}}:</strong>|}}<!--
-->{{#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|}}}{{#if:{{{text|{{{1|}}}}}}|:|}}</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}}>

Revision as of 13:13, 23 July 2024

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

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.
Icon-Important.pngImportant
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
Important template.pngImportant
Hello, World!
{{{type}}} Notification type.
| type = Warning
Important template.pngImportant
Hello, World!
{{{color}}} Notification color (RGB only).
RGBA may also work.
| color = 240,211,0
Important template.pngImportant
Hello, World!

Offset

  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!

Custom styles

  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!
  1. Important template.pngImportant
Hello, World!

Special Subpages

See also