Template:Font color/doc: Difference between revisions
Jump to navigation
Jump to search
m 1 revision imported |
(No difference)
|
Latest revision as of 09:47, 16 August 2015
{{#ifeq:doc |doc
|
{{#ifeq:show |show
|
File:Edit-copy green.svg | This is a documentation subpage for Template:Font color. It contains usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if: | | {{#ifexist:Template:Font color | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | }} }} | }}
{{#if:| [[Image:|40px|Warning]] }} | {{#if:| {{{header}}} }}Links should clearly be identifiable as links to readers.Refrain from implementing colored links that may impede user ability to distinguish links from regular text, or color links for purely aesthetic reasons. See the guides to editing articles for accessibility at contrast, accessibility and navbox colors. |
Usage
Parameters
Use / description | Default | |
{{{1}}} | font color | default |
{{{2}}} | text | |
link | page link |
- Or
Use / description | Default | |
{{{1}}} | font color | default |
{{{2}}} | background color | default |
{{{3}}} | text | |
link | page link |
{{{{#if: |subst:}}font color{{#if:<text color> ||<text color>}}{{#if:<background color> ||<background color>}}{{#if:<text> ||<text>}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||…}}}}
Examples:
Markup | Renders as | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
{{font color|green|green text}}
|
{{ safesubst:#if: | {{ safesubst:#if: | yes | [[|]] | [[|]]
}} |
}} |
{{ safesubst:#if: | yes | green text | [[|green text]]
}} |
green text
}} }} |
{{font color|blue|do not style text as a link}}
|
{{ safesubst:#if: | {{ safesubst:#if: | yes | [[|]] | [[|]]
}} |
}} |
{{ safesubst:#if: | yes | do not style text as a link | [[|do not style text as a link]]
}} |
do not style text as a link
}} }} |
{{font color|white|black|white with black background}}
|
{{ safesubst:#if: white with black background | {{ safesubst:#if: | yes | white with black background | [[|white with black background]]
}} |
white with black background
}} |
{{ safesubst:#if: | yes | black | [[|black]]
}} |
black
}} }} |
{{font color||yellow|default text in yellow background}}
|
{{ safesubst:#if: default text in yellow background | {{ safesubst:#if: | yes | default text in yellow background | [[|default text in yellow background]]
}} |
default text in yellow background
}} |
{{ safesubst:#if: | yes | yellow | [[|yellow]]
}} |
yellow
}} }} |
The |{{#if:link|link=}}
parameter is useful where a link is placed in a colored header such as a navbox. For example, if the header was blue, you would leave the background color blank and set the font color to white. |{{#if:link|link=}}yes
sets the link to the text, otherwise it is set to the value of |{{#if:link|link=}}
.
Markup | Renders as | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
{{font color|white|blue|Wikipedia:Example|link=yes}}
|
{{ safesubst:#if: Wikipedia:Example | {{ safesubst:#if: yes | yes | Wikipedia:Example | Wikipedia:Example
}} |
Wikipedia:Example
}} |
{{ safesubst:#if: yes | yes | blue | blue
}} |
blue
}} }} |
{{font color|white|blue|Wikipedia:Example|link=Wikipedia:Sandbox}}
|
{{ safesubst:#if: Example | {{ safesubst:#if: Wikipedia:Sandbox | yes | Example | Example
}} |
Example
}} |
{{ safesubst:#if: Wikipedia:Sandbox | yes | blue | blue
}} |
blue
}} }} |
See also
- Web colors
- HTML color names
- List of colors
- Help: Link color
- {{color}}
- {{background color}}
- {{color contrast ratio}}
- {{hilite}}
- {{font}}
- {{tq}}
- {{xt}}