Jump to content

Template:Box: Difference between revisions

From Wiki - Scioly.org
m Updated `margin` specifications.
m Turned if-statement into ifeq to make all left floats follow `display: inline-block;`.
 
Line 1: Line 1:
{| cellspacing="0" style="width: 238px; background: {{{info-background|#fff}}}; {{#if: {{{float|}}} | float: {{{float}}}; margin: 0 5px; | display: inline-block; }} border: {{{border-width|1}}}px {{{border-style|solid}}} {{{border-color|#000}}};"
{| cellspacing="0" style="width: 238px; background: {{{info-background|#fff}}}; {{#ifeq: {{{float|}}} | right | float: right; margin-left: 5px; | display: inline-block; }} border: {{{border-width|1}}}px {{{border-style|solid}}} {{{border-color|#000}}};"
| style="width: 45px; height: 45px; background: {{{logo-background|#ccc}}}; text-align: center; font-size: {{{logo-size|{{{5|12}}}}}}pt; color: {{{logo-color|#000}}};" | '''{{{logo}}}'''
| style="width: 45px; height: 45px; background: {{{logo-background|#ccc}}}; text-align: center; font-size: {{{logo-size|{{{5|12}}}}}}pt; color: {{{logo-color|#000}}};" | '''{{{logo}}}'''
| style="font-size:{{{info-size|8}}}pt; padding:4pt; line-height:1.25em; color:{{{info-color|#000}}};" | {{{info-text}}}
| style="font-size:{{{info-size|8}}}pt; padding:4pt; line-height:1.25em; color:{{{info-color|#000}}};" | {{{info-text}}}

Latest revision as of 17:55, 13 October 2020

{{{logo}}} {{{info-text}}}
Template documentation

The Box template is a template used to generate a customizable userbox. All parameters are optional, except for logo and info-text.

Parameters

Info

info-text - the userbox's main text
info-background - the color of the userbox (white by default)
info-size - the size of the userbox's text in points, written in the form of an integer (8 by default)
info-color - the userbox's text color color (black by default)

Border

border-width - the width of the userbox's border in pixels, written in the form of an integer (1 by default}
border-style - sets the userbox's border style (solid by default)
border-color - sets the userbox's border color (black by default)

Logo

logo - the userbox's logo, seen to the left. May be an image or text.
logo-background - the logo's background color (gray by default)
logo-size - the logo's size in points, written in the form of an integer (12 by default. Use only for text logos - if the logo is an image, specify the size in pixels like in the examples below.)
logo-color - the logo's color (black by default)

Other

float - sets the userbox's float css property. (unassigned by default with display: inline-block; set instead)

Examples

For more examples of userboxes that use this template, see Category:User Templates.

Code Result
{{box
|logo=[[File:MOScioly_Logo.png|45px]]
|info-text=This user is boring.}}
This user is boring.
{{box
|logo=C
|logo-background=#87e35f
|info-size=12
|info-text=This user competes in Division C.}}
C This user competes in Division C.
{{box
|border-style=dashed
|border-size=2
|logo=π
|logo-size=15
|logo-background=#bd19ba
|info-background=#fffed1
|info-text=This user likes to eat pi.}}
π This user likes to eat pi.
{{box
|info-text=This user is flashy.
|info-background=#7d0000
|info-size=15
|info-color=#1cecff
|border-width=5
|border-style=groove
|border-color=#2cf239
|logo=❕
|logo-size=18
|logo-background=#fb00ff
}}
This user is flashy.