Difference between revisions of "Template:Highlighter"
From Maths
(Created page with "<span style="background-color:{{{bgcol|#FAFAFA}}};padding-left:5px;padding-right:5px;<!-- -->{{#if:{{{marktext|}}}||border-left:5px solid {{{markcol|#DADADA}}};}}<!-- -->"><...") |
m (Markcol now uses an if so defaults can be found and s does bgcol) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | <span style="background-color:{{{bgcol|#FAFAFA | + | <span style="background-color:{{#if:{{{bgcol|}}}|{{{bgcol|}}}|#FAFAFA}};padding-left:5px;padding-right:5px;<!-- |
| − | -->{{#if:{{{marktext|}}}||border-left:5px solid {{{markcol|#DADADA | + | -->{{#if:{{{marktext|}}}||border-left:5px solid {{#if:{{{markcol|}}}|{{{markcol|}}}|#DADADA}};}}<!-- |
-->"><!-- | -->"><!-- | ||
-->{{#if:{{{marktext|}}}<!-- | -->{{#if:{{{marktext|}}}<!-- | ||
| − | -->|<span style="padding-left:5px;padding-right:5px;margin-right:5px;background-color:{{{markcol|#DADADA | + | -->|<span style="padding-left:5px;padding-right:5px;margin-right:5px;background-color:{{#if:{{{markcol|}}}|{{{markcol|}}}|#DADADA}};">{{{marktext|}}}</span><!-- |
-->|<!-- | -->|<!-- | ||
-->}}<!-- | -->}}<!-- | ||
| − | --><span style=" | + | --><span style="">{{#if:{{{msg|}}}|{{{msg|}}}|{{{default|}}}}}</span><!-- |
--></span><noinclude> | --></span><noinclude> | ||
| + | ==Todo:== | ||
| + | {{XXX|There's a span tag with an empty style around the thing actually highlighted only (not the rest) - this could be used with {{C|border-bottom}} to achieve an underline-like effect, this is needed if the background is white say, so don't forget to mess with that}} | ||
==Parameters== | ==Parameters== | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
| Line 21: | Line 23: | ||
! Comment | ! Comment | ||
|- | |- | ||
| − | ! | + | ! {{C|msg}} |
| ''(nothing)'' | | ''(nothing)'' | ||
| the text to highlight | | the text to highlight | ||
| Line 28: | Line 30: | ||
! {{C|default}} | ! {{C|default}} | ||
| ''(nothing)'' | | ''(nothing)'' | ||
| − | | the text to highlight in the absence of {{C|msg | + | | the text to highlight in the absence of a {{C|msg}} |
|- | |- | ||
! {{C|bgcol}} | ! {{C|bgcol}} | ||
Latest revision as of 06:54, 13 December 2016
Todo:
TODO: There's a span tag with an empty style around the thing actually highlighted only (not the rest) - this could be used with border-bottom to achieve an underline-like effect, this is needed if the background is white say, so don't forget to mess with that
Parameters
| Name | Default | Description | Comment |
|---|---|---|---|
| msg | (nothing) | the text to highlight | msg is dominant (if present text will be ignored) |
| default | (nothing) | the text to highlight in the absence of a msg | |
| bgcol | #FAFAFA | background colour | |
| markcol | #DADADA | background colour of left border or mark text if given | |
| marktext | (nothing) | Use this if you want Caveat: or Note: to appear before the body of whatever is highlight, by default it is absent |