Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Co/doc: Difference between revisions

Template page
m Fix typo. Add Parameter section.
Proton One (talk | contribs)
Adding design variable colors
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:


:; Parameters
:; Parameters
::; text color : Sets the text color. Default value is "inherit"<ref>inherit - The color used by the HTML parent element.</ref>. Colors can be given either by color name<ref>https://www.w3schools.com/colors/colors_names.asp [2022-05-29]</ref> (e.g. {{Co|red|red}} or {{Co|green|green}}) or values<ref>https://www.w3schools.com/colors/colors_hex.asp [2022-05-29]</ref> (like {{Co|#0000FF|#FF0000}}).
::; text color : Sets the text color. Default value is "inherit"<ref>inherit - The color used by the HTML parent element.</ref>. Text color is passed through {{t|design var}} to automatically interpret and replace select color names with design variables. Colors can be given either by color name<ref>https://www.w3schools.com/colors/colors_names.asp [2022-05-29]</ref> (e.g. {{Co|red|red}} or {{Co|green|green}}) or values<ref>https://www.w3schools.com/colors/colors_hex.asp [2022-05-29]</ref> (like {{Co|#FF0000|#FF0000}}).
::; background color : Sets the background color. Default value is "inherit". For valid values see text color.
::; background color : Sets the background color. Default value is "inherit". For valid values see text color.
::; text : The text to be colored.
::; text : The text to be colored.
Line 18: Line 18:
: {{co||green|This text has a green background.}}<br>
: {{co||green|This text has a green background.}}<br>


{{Note|Note the double brackets <nowiki>||</nowiki> which means that that section is empty. The background color parameter may be safely omitted without the use of double brackets, but double brackets must be used if only a background color is desired.}}
{{Note|Note the double pipe char <nowiki>||</nowiki> which means that that section is empty. The background color parameter may be safely omitted without the use of double pipes, but double pipes must be used if only a background color is desired.}}


: {{code|<nowiki>{{co|black|lightyellow|Text and background color.}}</nowiki>}} gives ...
: {{code|<nowiki>{{co|black|lightyellow|Text and background color.}}</nowiki>}} gives ...