Template:Notify: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(23 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{high-use}}
{{Doc}}
{{Doc}}
<includeonly><onlyinclude>{{#switch:{{{mode|}}}
| inline = <{{#if:{{{text|{{{1|}}}}}}|div|span}} style="{{Offsetable|offset={{{offset|0}}}}}{{{root_inline_style|}}}display:{{#if:{{{text|{{{1|}}}}}}|flex|inline-flex}}; {{#if:{{{text|{{{1|}}}}}}|gap:4px;|}} background:linear-gradient(90deg, rgba({{{color|240,240,240}}},.07) 0%, transparent 100%); border-left:2px solid rgb({{{color|240,240,240}}}); border-radius:2px; font-size:12px; padding:{{#if:{{{text|{{{1|}}}}}}|6px 0 4px 12px|2px 0 0 8px}}; margin:{{#if:{{{text|{{{1|}}}}}}|.5em 0|0}}"><!--


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


--><span style="{{{span2_inline_style|}}}display:table-cell">{{{text|{{{1|}}}}}}</span></{{#if:{{{text|{{{1|}}}}}}|div|span}}>
<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({{{color|240,240,240}}}); border-radius:2px; padding:{{#if:{{{text|{{{1|}}}}}}|6px 0 4px 12px|2px 0 0 8px}};|<!-- Empty -->}} {{{root_inline_style|}}}"><!--


| #default = <div style="{{{inline_style|}}}background-color:rgba(159,159,159,.05); border:1px solid rgba(159,159,159,.3); border-left:4px solid #9F9F9F; border-radius:3px; padding:10px 12px; margin-bottom:6px">{{{text|{{{1|}}}}}}</div>
-->{{#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>|}}<!--


}}</onlyinclude></includeonly>
--><span style="display:table-cell; {{{text style|}}}">{{{text|{{{1|}}}}}}</span></{{#if:{{{text|}}}{{{1|}}}|div|span}}>
 
| #default = <div style="{{{style:default|}}}background-color:rgba(159,159,159,.05); border:1px solid rgba(159,159,159,.3); border-left:4px solid #9F9F9F; border-radius:3px; padding:10px 12px; margin-bottom:6px">{{{text|{{{1|}}}}}}</div>
 
}}</onlyinclude>
 
</includeonly>

Latest revision as of 13:16, 5 April 2025

Warning icon.png
This template is used on many pages and changes may be widely noticed.
Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage.
Consider discussing changes on the talk page before implementing them.
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!
  2. Important template.pngImportant:Hello, World!
  3. Important template.pngImportant:Hello, World!
  4. Important template.pngImportant:Hello, World!
  5. Important template.pngImportant:Hello, World!
  6. Important template.pngImportant:Hello, World!
  7. Important template.pngImportant:Hello, World!

Custom styles

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

Special Subpages

See also