Template:Callout: Difference between revisions

From Space Station 14 Wiki
(image param improved)
(moved styles to templatestyles)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><templatestyles src="Template:Callout/styles.css" /><!--
-->{{#switch: {{#vardefineecho: callout_type|{{lc: {{{1}}}}}<!--/vardefine-->}}
-->{{#switch: {{#vardefineecho: callout_type|{{lc: {{{1}}}}}<!--/vardefine-->}}
|info =
|info =
Line 43: Line 45:


--><div class="callout-wrapper" style="
--><div class="callout-wrapper" style="
    display: flex;
     justify-content: {{#var:callout_align}};
     justify-content: {{#var:callout_align}};
    margin-top: .5em;
">
">
<div class="callout" style="
<div class="callout" style="
      --strip-size: 10px;
    /* size of the left border 'strip' */
     
--strip-size: 10px;
      box-sizing: border-box;
     
        display: flex;
        flex-direction: row;
      
      
        width: fit-content;
         min-width: {{#var:callout_min_width}};
         min-width: {{#var:callout_min_width}};
padding: .5rem;
         border-color: {{#var: callout_strip_color}};
          
       
        background-color: var(--bg-color-light-x2);
clip-path: polygon(
       
0 0,  
        border: 1px solid {{#var: callout_strip_color}};
border-left: 10px solid {{#var: callout_strip_color}};
100% 0,  
       
        clip-path: polygon(
100% 100%,  
            0 0,  
           
calc(var(--strip-size) / 2) 100%,  
            100% 0,  
0 calc(100% - var(--strip-size) / 2)
           
);
            100% 100%,  
           
            calc(var(--strip-size) / 2) 100%,  
            0 calc(100% - var(--strip-size) / 2)
        );
><!--
><!--
         --><div class="callout-images" style="grid-column: 1; grid-row: 1 / span 2;"><!--
         --><div class="callout-images"><!--
             -->{{#if: {{#vardefineecho: image_1|{{{image1|{{{image|{{{i|}}}<!--/2-->}}}<!--/1-->}}}}}
             -->{{#if: {{#vardefineecho: image_1|{{{image1|{{{image|{{{i|}}}<!--/2-->}}}<!--/1-->}}}}}
             |[[File:{{#var:image_1}}|80px]]
             |[[File:{{#var:image_1}}|80px]]
Line 85: Line 75:
         --></div><!--
         --></div><!--
          
          
         --><div class="callout-header-content-container" style="
         --><div class="callout-header-content-container"><!--
            display: flex;
             --><div class="callout-header">{{#var:callout_header}}</div><!--
            flex-direction: column;
        "><!--
             --><div class="callout-header" style="
                font-weight: bold;
                font-size: large;
            ">{{#var:callout_header}}</div><!--
              
              
--><div class="callout-content-container" style="
--><div class="callout-content-container"><!--
display: flex;
align-items: center;
               
                height: 100%;
"><!--
--><div class="callout-content">{{{2}}}</div><!--
--><div class="callout-content">{{{2}}}</div><!--
--></div><!--
--></div><!--
Line 105: Line 84:
--></div><!--
--></div><!--
--></div></includeonly><noinclude>
--></div></includeonly><noinclude>
{{docs}}
{{docs|bb=
{{uses template styles}}
}}


[[Category:Notice templates]]
[[Category:Notice templates]]

Revision as of 10:01, 15 August 2024

Template documentation
view or edit this documentation about template documentation
Uses template styles
This template uses template styles found in:

Examples

Types

Caption text
Type Syntax Result
Info {{Callout|Info|An informative message.}}
Info
An informative message.
Warning {{Callout|Warning|Something to be warned about.}}
Warning
Something to be warned about.
Danger {{Callout|Danger|The clown is closing in.}}
Danger
The clown is closing in.
Tip {{Callout|Tip|When walking over slippery surfaces, hold {{button|Shift}} to slow down and not slip (in most cases).}}
Tip
When walking over slippery surfaces, hold Shift to slow down and not slip (in most cases).
Example {{Callout|Example|An example for something.}}
Example
An example for something.

Header label

{{Callout|Info|header=Notice|Bla-bla-bla, lorem ipsum...}}
or
{{Callout|Info|h=Notice|Bla-bla-bla, lorem ipsum...}}

Notice
Bla-bla-bla, lorem ipsum...

or

Notice
Bla-bla-bla, lorem ipsum...

Alignment

Left

The default.

Center

{{Callout|Info|align=center|Bla-bla-bla, lorem ipsum...}}
or
{{Callout|Info|a=center|Bla-bla-bla, lorem ipsum...}}

Info
Bla-bla-bla, lorem ipsum...

or

Info
Bla-bla-bla, lorem ipsum...

Right

{{Callout|Info|align=right|Bla-bla-bla, lorem ipsum...}}

Info
Bla-bla-bla, lorem ipsum...

Images

{{Callout
| Info
| header = Work in Progress
| align = center
| This page is unfinished.
| image = Wired Frame.png
| image2 = Wrench.png
}}

Work in Progress
This page is unfinished.

Stacked callouts

Sets the callout to a predefined width, making all callouts with the same class appear with the same width.

Callouts will be stacked to the right and will require {{clear}} after to not overflow with the content that goes after.

{{Callout|stacked=1|Info|An informative message. An informative message. An informative message.}}
{{Callout|stacked=1|Info|Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum...}}
{{Clear}}

Info
An informative message. An informative message. An informative message.
Info
Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum...

Wrapper classes

Allows to add custom classes to the wrapper element.

{{Callout|wrapper class=hello|Info|An informative message.}}

Info
An informative message.

A template for producing various notices.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Type1

Type of the callout. Select from the suggested values. Any casing is supported.

Suggested values
Info Warning Danger Example Tip
Linerequired
Content2

Content of the callout.

Stringrequired
Header labelheader h

Header text of the callout. By default, depends on the type.

Linesuggested
Alignalign a

Alignment of the callout. When "Center" is used, the callout will span almost across the full width of a page.

Suggested values
Left Center Right
Default
Left
Linesuggested
Imageimage image1 i

An image to add inside the callout at the start.

Filesuggested
Second imageimage2 i2

A second image to add inside the callout to the left, after the first one.

Filesuggested