Information: If you want to test this template, please use Sandbox.
This documentation is transcluded from Template:Color/doc.
Template:Color: Difference between revisions
From Elwiki
No edit summary |
No edit summary Tag: Manual revert |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#css:.custom-text a {color:inherit!important} | <includeonly>{{#css:.custom-text a {color:inherit!important} | ||
}}<span style="color: {{trim|{{{1|}}}}}; {{#if: {{{3|}}}|background-color: {{trim|{{{2|}}}}};}} {{#ifeq: {{{b|}}}|1|font-weight: | }}<span style="color: {{trim|{{{1|}}}}}; {{#if:{{{fw|}}}|font-weight: {{{fw|}}}; }} {{#if: {{{3|}}}|background-color: {{trim|{{{2|}}}}};}} {{#ifeq: {{{b|}}}|1|font-weight: 500;}} {{#ifeq: {{{i|}}}|1|font-style: italic;}} {{#if: {{{size|}}}|font-size: {{trim|{{{size|}}}}}px;}}" class="custom-text {{{class|}}}">{{#if: {{{link|}}}|[[{{#ifeq:{{{link|}}}|1||{{{link|}}}{{!}}}}{{trim|{{#if: {{{3|}}}|{{{3|}}}|{{{2|}}}}}}}]]|{{trim|{{#if: {{{3|}}}|{{{3|}}}|{{{2|}}}}}}}}}</span></includeonly><noinclude>{{Doc}}[[Category:Formats]]</noinclude> |
Latest revision as of 12:54, 12 January 2023
Usage
{{color|textcolor|bgcolor|text|link=1/link|size=number|b=1|i=1}}
Parameters
(colors accept any CSS3 colors)
- {{color|textcolor|bgcolor|text}} - color of the text (first parameter)
- {{color|textcolor|bgcolor|text}} - color of the background (second parameter)
- {{color|textcolor|bgcolor|text}} - content (second or third parameter, depending on whether bgcolor was provided)
- size - size of the font in pixels
- link - if 1 provided, creates a local link from the content provided. Any other parameter creates a local link from the link parameter itself (using normal markup still works)
- b - if 1, apply bold style (using normal markup still works)
- i - if 1, apply italic style (using normal markup still works)
- class - extra class name for the <span> element
Examples
{{color|teal|Lorem ipsum}}
result: Lorem ipsum
{{color|white|teal|Lorem ipsum}}
result: Lorem ipsum
{{color|teal|Lorem ipsum|b=1|i=1}}
result: Lorem ipsum
{{color|teal|Lorem ipsum|size=25}}
result: Lorem ipsum
{{color|purple|Aisha|link=1}}
result: Aisha
{{color|purple|Genius Magician|link=Aisha}}
result: Genius Magician