Template:WrapCssVariableIfNeeded
Jump to navigation
Jump to search
{{{1}}}
Examples
{{WrapCssVariableIfNeeded|red}}
red
{{WrapCssVariableIfNeeded|--color-blue}}
var(--color-blue)
{{WrapCssVariableIfNeeded|#123456}}
- 123456
(converts to an ordered list, since wiki uses #
as a list marker)
Checks if the given string looks like a CSS variable. If so, wraps it in «var()» syntax, making it possible to use as CSS color value. Otherwise (if a string is not a css variable), returns it «as is».
Parameter | Description | Type | Status | |
---|---|---|---|---|
String | 1 | String to check.
| String | required |