More actions
m | are no brackets. |
Proton One (talk | contribs) Adding design variable colors |
||
| 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|# | ::; 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. | ||
Latest revision as of 03:25, 3 December 2025
- Description
- This template is used to color some text.
- Parameters
-
- text color
- Sets the text color. Default value is "inherit"[1]. Text color is passed through {{design var}} to automatically interpret and replace select color names with design variables. Colors can be given either by color name[2] (e.g. red or green) or values[3] (like #FF0000).
- background color
- Sets the background color. Default value is "inherit". For valid values see text color.
- text
- The text to be colored.
- Sample
gives ...{{co|red|This text isn't yellow.}} - This text isn't yellow.
gives ...{{co||green|This text has a green background.}} - This text has a green background.
gives ...{{co|black|lightyellow|Text and background color.}} - Text and background color.
gives ...{{co|#0033CC|This text uses an hex color code.}} - This text uses an hex color code.
- References
- ^ inherit - The color used by the HTML parent element.
- ^ https://www.w3schools.com/colors/colors_names.asp [2022-05-29]
- ^ https://www.w3schools.com/colors/colors_hex.asp [2022-05-29]