Template talk:Highlight
Add topic| Template:Highlight is indefinitely protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
Default date qualifier
[edit]Otheus (talk · contribs) created this neat template a few years ago and left, I suppose, a note to self to "Add default date qualifier -- if it's after so many days, the hilite goes away" within the edit window. I thought this was a great idea; Otheus hasn't been active in a while, so if anyone is watching this page, would anyone know the code to create a date qualifier? – Kerαunoςcopia◁galaxies 18:21, 8 June 2010 (UTC)
- Okay done.
{{hilite|text|color|expiry date}}
- Neato, thank you! Now my questions are:
Is it possible to make it so that if no color is specified (like the original template was), yellow becomes the default? (The template is being used at, for example, Wikipedia:Help_desk#General_of_Division_Aristide_Razu, but now no coloring appears.)Should the expiry date be optional as well?- What exactly is the expiry date function supposed to be written as? I tried "1" thinking it would disappear after one day, but that didn't seem to work. I tried deciphering the code, but my knowledge on template coding is pretty limited.
- – Kerαunoςcopia◁galaxies 23:13, 8 June 2010 (UTC)
- Fixed yellow bit (proud of myself!), and I linked to the wrong discussion anyway, oi. – Kerαunoςcopia◁galaxies 23:34, 8 June 2010 (UTC)
- Neato, thank you! Now my questions are:
- Okay, I'm seeing it... "if expression", so the expiry date is optional then. – Kerαunoςcopia◁galaxies 23:36, 8 June 2010 (UTC)
- Hmm... I also found the /core page. I'm using Wikipedia:Help_desk#article_about_General_Aristide_Razu_deleted.3F as the test discussion (correct link). If I add "yellow" to parameter 2, the highlighting returns, but without the "yellow", the highlighting disappears. Maybe /core isn't needed then? – Kerαunoςcopia◁galaxies 23:44, 8 June 2010 (UTC)
- Okay, nevermind. I removed the "/core" from the code just to try it: adding {{hilite|foo}} on the main page still worked, but the link above showed a "Template:Loop error detected" (or similar). So... reverted my edits. I guess now I'm not understanding why /core is required, but "yellow" still needs to be added. – Kerαunoςcopia◁galaxies 23:54, 8 June 2010 (UTC)
Wow so confused. Changing the font color on /core to red, my sandbox {{hilite}} had red font, but the above link didn't, even after reloading the page. Mysteries. – Kerαunoςcopia◁galaxies 00:07, 9 June 2010 (UTC)
- You need to purge the page that you're using the template on after changing the template to see the new changes. Also, I added template documentation with examples. Gary King (talk) 00:22, 9 June 2010 (UTC)
- Ah, okay. Absolutely wonderful, thank you so much for taking the time to do this. – Kerαunoςcopia◁galaxies 00:33, 9 June 2010 (UTC)
mark
[edit]Should we update from <span> to <mark> which "represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context."
| Markup | Renders as |
|---|---|
<mark>HyperText Markup Language</mark> |
HyperText Markup Language |
<mark style="background:lightblue">HyperText Markup Language</mark> |
HyperText Markup Language |
Semi-protected edit request on 28 April 2015
[edit]This edit request to Template:Hilite has been answered. Set the |answered= parameter to no to reactivate your request. |
Samuelcala (talk) 23:29, 28 April 2015 (UTC)
Not done as you have not requested a change. Please mention the specific changes in a "change X to Y" format. --I am k6ka Talk to me! See what I have done 23:39, 28 April 2015 (UTC)
Requested move 18 December 2015
[edit]- The following is a closed discussion of the proposal. Please do not modify it. Subsequent comments should be made in a new section on the talk page. No further edits should be made to this section.
The result of the proposal was move per request. Certainly the vastly more common spelling and thus more likely for users to immediately grok what the template's function might be. Because it is unclear whether the existing and redirected template at the target title was partially merged here, I will do a history swap.--Fuhghettaboutit (talk) 20:22, 27 December 2015 (UTC)
Template:Hilite → Template:Highlight – The correct spelling is "Highlight". GeoffreyT2000 (talk) 00:37, 18 December 2015 (UTC)
- The above discussion is preserved as an archive of the proposal. Please do not modify it. Subsequent comments should be made in a new section on this talk page. No further edits should be made to this section.
Template-protected edit request on 23 June 2025 Suggestion for Template:Highlight/core
[edit]This edit request to Template:Highlight/core has been answered. Set the |answered= parameter to no to reactivate your request. |
The "span" should be replaced with "mark" for semantic HTML purposes. The appearance will not change, but editors using a screen reader configured to sound out semantic attributes will be made aware of what is happening. Artoria2e5 🌉 08:44, 23 June 2025 (UTC)
Template-protected edit request on 17 July 2026
[edit]This edit request to Template:Highlight/core has been answered. Set the |answered= parameter to no to reactivate your request. |
For stylizing purposes (to be able to solve issues in dark mode, which for example were reported here) move styles into Template:Highlight/core/style.css stylesheet by creating it with next content:
.text-highlight { color: black; background: yellow; }
and change this template by substituting
style="color:black;background:{{{2|yellow}}}"
with
class="text-highlight" {{#if:{{{2|}}}|style="background:{{{2|}}}"}} }}
IamNikita (talk) 21:50, 17 July 2026 (UTC)
- Using
style="background:{{{2|}}}"without a specified color will cause a Linter error. Please revise the code, putting it in Template:Highlight/sandbox for testing at Template:Highlight/testcases. – Jonesey95 (talk) 22:11, 17 July 2026 (UTC)- To editor Jonesey95: not sure what issues in dark mode the requestor is up against, but I'm not seeing any difference on the [test cases] page, light or dark mode. I think I've done this right; you might want to double check it. I created Template:Highlight/core/sandbox/style.css and Template:Highlight/core/sandbox, then I altered Template:Highlight/sandbox to use the /core/sandbox. If I've done this right, and you also don't see a difference, then maybe editor IamNikita can add test cases that show their issues/problems/challenges they're having? P.I. Ellsworth , ed. – welcome! – 07:30, 19 July 2026 (UTC)
- I agree that the testcases page looks good in both light and dark mode. I have marked this request as answered pending feedback from the requester. – Jonesey95 (talk) 13:25, 19 July 2026 (UTC)
- Thank you for checking! I see the **Linter error** thrown by Template:Highlight/sandbox in the "Page information". We certainly don't wanna make that a permanent thing! P.I. Ellsworth , ed. – welcome! – 14:19, 19 July 2026 (UTC)
- Sorry, I didn't see a response, I wasn't subscribed for the thread for some unknown reason.
- The proposed change doesn't change any visuals because it wasn't supposed to. I wanted the change to be as less opinionated as possible, only to prepare technical side of things. The lint error already exists, isn't it? It's also a false-positive with the change I proposed because we set default text color in css.
- Anyway, I made the changes to be functional, Template:Highlight/testcases now shows changes for empty and yellow color parameters in dark mode. The yellow replacement background color in Codex seems to be too dim, I've used a search highlight color from a dark theme of an IDE I have installed, it looks dimmer then I would like but it has very high contrast ratio (passes WCAG AAA). Linter issue also should be fixed. IamNikita (talk) 21:46, 19 July 2026 (UTC)
- To editor IamNikita: sorry for moving slowly, I've been very busy with offline medical concerns. Thank you for fixing the lint error! I'm still a little confused by
The proposed change doesn't change any visuals
andonly to prepare technical side of things
. What does that mean? If your edit is not an improvement to the yellow visual, then what does it improve exactly? P.I. Ellsworth , ed. – welcome! – 14:08, 24 July 2026 (UTC)- You've missed last paragraph of the message.
- Wish you quick recovery. I'm also sorry for late reply, busy with some other stuff. IamNikita (talk) 21:38, 27 July 2026 (UTC)
- Thank you very much for your good wishes! And sorry, I did not miss the last paragraph of the message. It's just that I don't understand, for example, you say the changes are functional, that the test cases page now shows changes for empty and yellow color parameters in dark mode. But I don't see those changes. I cannot sanction what I cannot see. Perhaps another template editor will be able to see the changes and approve them? P.I. Ellsworth , ed. – welcome! – 04:43, 29 July 2026 (UTC)
- To editor IamNikita: sorry for moving slowly, I've been very busy with offline medical concerns. Thank you for fixing the lint error! I'm still a little confused by
- I agree that the testcases page looks good in both light and dark mode. I have marked this request as answered pending feedback from the requester. – Jonesey95 (talk) 13:25, 19 July 2026 (UTC)
- To editor Jonesey95: not sure what issues in dark mode the requestor is up against, but I'm not seeing any difference on the [test cases] page, light or dark mode. I think I've done this right; you might want to double check it. I created Template:Highlight/core/sandbox/style.css and Template:Highlight/core/sandbox, then I altered Template:Highlight/sandbox to use the /core/sandbox. If I've done this right, and you also don't see a difference, then maybe editor IamNikita can add test cases that show their issues/problems/challenges they're having? P.I. Ellsworth , ed. – welcome! – 07:30, 19 July 2026 (UTC)