Difference between revisions of "Template:BubbleBox"

From WikiMe @ iroiro.io
Jump to: navigation, search
ink>GuyPerfect
(Adding collapsed parameter)
ink>GuyPerfect
(Setting default background to a lighter version of the border color. Also broke the bubbles last time, so shame on me.)
Line 1: Line 1:
<includeonly><div {{#ifeq:{{{background|}}}|bubbles|class="bubbleboxbg"}} style="box-shadow: 0px 0px 15px #ffffff inset; border-width: 10px 1px 10px 1px; border-style: solid; border-color: rgb({{#if:{{{border|}}}|{{{border}}}|{{SiteColor|Generic}}}}); border-radius: 10px; padding: 15px; margin: 4px; {{#ifeq:{{{background|}}}|bubbles||background-color: {{#if:{{{background|}}}|{{{background}}}|white}};}} {{{style|}}}" class="{{#if:{{{collapsed|}}}|mw-collapsible}} {{#ifeq:{{{collapsed|}}}|true|mw-collapsed}}">{{#if:{{{collapsed|}}}|{{{1}}}<div class="mw-collapsible-content">|{{#ifeq:{{{1|}}}|open||{{{1}}}</div>}}}}</includeonly><noinclude>__NOTOC__
+
<includeonly><div class="{{#ifeq:{{{background|}}}|bubbles|bubbleboxbg}} {{#if:{{{collapsed|}}}|mw-collapsible}} {{#ifeq:{{{collapsed|}}}|true|mw-collapsed}}" style="box-shadow: 0px 0px 15px #ffffff inset; border-width: 10px 1px 10px 1px; border-style: solid; border-color: rgb({{#if:{{{border|}}}|{{{border}}}|{{SiteColor|Generic}}}}); border-radius: 10px; padding: 15px; margin: 4px; {{#ifeq:{{{background|}}}|bubbles||background-color: {{#if:{{{background|}}}|{{{background}}}|rgba({{#if:{{{border|}}}|{{{border}}}|{{SiteColor|Generic}}}}, 0.25)}};}} {{{style|}}}">{{#if:{{{collapsed|}}}|{{{1}}}<div class="mw-collapsible-content">|{{#ifeq:{{{1|}}}|open||{{{1}}}</div>}}}}</includeonly><noinclude>__NOTOC__
 
Produces a site-standard content container.
 
Produces a site-standard content container.
  
Line 7: Line 7:
 
|<code>content</code>||Unnamed.||The content of the container, or "open" to leave the container as an unterminated <nowiki><div></nowiki> element.
 
|<code>content</code>||Unnamed.||The content of the container, or "open" to leave the container as an unterminated <nowiki><div></nowiki> element.
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
|<code>background</code>||Optional.||A CSS color value to use as the background for the content portion of the container, or "bubbles" for the site-standard bubble background. The default color is white.
+
|<code>border</code>||Optional.||An RGB triplet to use as the border color of the container. The default color is {{SiteColor|Generic}}, defined in [[Template:SiteColor|SiteColor]] as "Generic".
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
|<code>border</code>||Optional.||An RGB triplet to use as the border color of the container. The default color is {{SiteColor|Generic}}, defined in [[Template:SiteColor|SiteColor]] as "Generic".
+
|<code>background</code>||Optional.||A CSS color value to use as the background for the content portion of the container, or "bubbles" for the site-standard bubble background. The default color is rgba(<code>border</code>, 0.25).
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
|<code>style</code>||Optional.||A CSS property list to apply to the container.
 
|<code>style</code>||Optional.||A CSS property list to apply to the container.

Revision as of 20:55, 3 August 2017

Produces a site-standard content container.

Parameters

content Unnamed. The content of the container, or "open" to leave the container as an unterminated <div> element.
border Optional. An RGB triplet to use as the border color of the container. The default color is 0, 153, 255, defined in SiteColor as "Generic".
background Optional. A CSS color value to use as the background for the content portion of the container, or "bubbles" for the site-standard bubble background. The default color is rgba(border, 0.25).
style Optional. A CSS property list to apply to the container.
collapsed Optional. If present, the container becomes collapsible and two nested, unterminated <div> elements. content will appear before the collapsible region. Must be one of the following:
  • "true" - The collapsible region is collapsed by default.
  • "false" - The collapsible region is expanded by default.

Example

Markup

{{BubbleBox|background=rgba({{SiteColor|Splatoon}}, 0.25)|border={{SiteColor|Splatoon}}|Sample text 1}}
{{BubbleBox|Sample text 2}}
{{BubbleBox|border={{SiteColor|Splatoon 2}}|Sample text 3}}
{{BubbleBox|open|background=bubbles|border={{SiteColor|NIWA}}}}Sample text 4</div>
{{BubbleBox|collapsed=false|border=192,192,192|Static content}}Collapsible content</div></div>

Output

Sample text 1
Sample text 2
Sample text 3
Sample text 4
Static content
Collapsible content