Template:Color label: Difference between revisions
From Space Station 14 Wiki
(Created page with "<includeonly><span> <span style="background-color: {{{1}}};"></span> <span>{{{2}}}</span> </span></includeonly><noinclude> {{docs}} <templatedata> { "params": { "1": { "label": "Color", "description": "A valid CSS color.", "example": "red", "type": "line", "required": true }, "2": { "label": "Label", "description": "A label.", "example": "Cool green", "type": "line", "required": true } }, "description": "Produces a little square...") |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><span> | <includeonly><!-- | ||
<span style="background-color: {{{1}}};"></span> | --><!--<templatestyles src="Color label/styles.css" />--><!-- | ||
<span>{{{ | |||
</span></includeonly><noinclude> | --><span class="color-label" style=" | ||
{{docs}} | display: inline-block; | ||
border: 1px solid var(--border-color); | |||
padding: 0px 3px 2px 4px; | |||
border-radius: 0.2rem; | |||
margin: -1px 0px -3px 0px; | |||
text-wrap: nowrap; | |||
"><!-- | |||
--><span class="color-label-label" style=" | |||
/* offset from the color rect */ | |||
margin-right: 0.3rem; | |||
">{{{2|}}}</span><!-- | |||
--><span class="color-label-color-square" style=" | |||
background-color: {{{1}}}; | |||
display: inline-block; | |||
vertical-align: middle; | |||
width: 1em; | |||
height: 1em; | |||
border-radius: 2px; | |||
margin-right: 0.15rem; | |||
"></span><!-- | |||
--><span class="color-label-code" style=" | |||
font-family: monospace; | |||
">{{{1}}}</span><!-- | |||
--></span></includeonly><noinclude> | |||
{{docs|bb= | |||
{{uses template styles}} | |||
}} | |||
<templatedata> | <templatedata> | ||
Line 17: | Line 43: | ||
"2": { | "2": { | ||
"label": "Label", | "label": "Label", | ||
"description": "A label.", | "description": "A custom label.", | ||
"example": "Cool green", | "example": "Cool green", | ||
"type": "line", | "type": "line", | ||
" | "suggested": true | ||
} | } | ||
}, | }, | ||
"description": "Produces a little square with given color and a label.", | "description": "Produces a little square with given color and a color code label. Can also add a custom label.", | ||
"paramOrder": [ | "paramOrder": [ | ||
"1", | "1", |
Latest revision as of 14:49, 9 August 2024
Uses template styles
This template uses template styles found in:
Examples
Hex color (gold): #FFD700
Predefined color (red): red
RGB color (orange) with a custom name: Sunset#FFD700
Produces a little square with given color and a color code label. Can also add a custom label.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Color | 1 | A valid CSS color.
| Line | required |
Label | 2 | A custom label.
| Line | suggested |