Template talk:Legend
Add topic
| This is the talk page for discussing Legend and anything related to its purposes and tasks. |
|
| Archives: 1Auto-archiving period: 3 months |
Protected edit request on 18 August 2025
[edit]This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Import a new "invert" feature from the template sandbox. –LaundryPizza03 (dc̄) 18:35, 18 August 2025 (UTC)
- This has been completed. GauchoDude (talk) 18:58, 18 August 2025 (UTC)
- @LaundryPizza03, this does not appear to change or invert anything using the built-in dark mode, just the older dark mode gadget. Is that the intended behavior? Rjjiii (talk) 03:26, 23 August 2025 (UTC)
- I can't reproduce this issue. You need to use the parameter
invertto use it. –LaundryPizza03 (dc̄) 03:29, 23 August 2025 (UTC) - @Rjjiii I don't know what is happening; it is meant to disable "mw-no-invert". Is there a different procedure for the built-in dark mode? –LaundryPizza03 (dc̄) 03:31, 23 August 2025 (UTC)
- @LaundryPizza03, can you try out the built-in dark mode? It's available to logged-out editors too, so if you just open a tab in private/incognito mode then it'll be available. I understand that the
|invert=parameter is necessary; it just doesn't change anything for me on the built-in dark mode, Rjjiii (talk) 03:36, 23 August 2025 (UTC)- @Rjjiii: I can verify this issue now. A look at Periodic table found that some colors are never inverted in the built-in dark mode. –LaundryPizza03 (dc̄) 03:38, 23 August 2025 (UTC)
- @Rjjiii: I implemented a test of the feature that inverts in the built-in dark mode at the sandbox, but it just changes everything to black/white and I don't know why. red. –LaundryPizza03 (dc̄) 03:53, 23 August 2025 (UTC)
- This edit makes everything black/white. The fallback color is only used when the CSS variable
--color-baseis unavailable. Rjjiii (talk) 04:05, 23 August 2025 (UTC)- I can't find any tokens in the list that inverts a given color. I've observed that unlike the dark-mode gadget, built-in dark mode does not invert table or font colors by default. Light red. –LaundryPizza03 (dc̄) 04:11, 23 August 2025 (UTC)
- It doesn't really invert anything. Those tokens are variables with a dark mode and light mode value. TemplateStyles can also define a light mode and dark mode value for a template. Rjjiii (talk) 04:15, 23 August 2025 (UTC)
- I guess I don't have to do anything for this template. –LaundryPizza03 (dc̄) 04:22, 23 August 2025 (UTC)
- It doesn't really invert anything. Those tokens are variables with a dark mode and light mode value. TemplateStyles can also define a light mode and dark mode value for a template. Rjjiii (talk) 04:15, 23 August 2025 (UTC)
- I can't find any tokens in the list that inverts a given color. I've observed that unlike the dark-mode gadget, built-in dark mode does not invert table or font colors by default. Light red. –LaundryPizza03 (dc̄) 04:11, 23 August 2025 (UTC)
- This edit makes everything black/white. The fallback color is only used when the CSS variable
- @LaundryPizza03, can you try out the built-in dark mode? It's available to logged-out editors too, so if you just open a tab in private/incognito mode then it'll be available. I understand that the
- I can't reproduce this issue. You need to use the parameter
- @LaundryPizza03, this does not appear to change or invert anything using the built-in dark mode, just the older dark mode gadget. Is that the intended behavior? Rjjiii (talk) 03:26, 23 August 2025 (UTC)
Template-protected edit request on 23 August 2025
[edit]This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Can we change
| <span class="legend-text" style="{{#if:{{{alt|}}}|color:{{{1|}}};}}font-family: monospace, monospace;">{{If empty|{{{alt|}}}|{{{text|}}}| }}</span>| }}
to
| <span class="legend-text" style="{{#if:{{{alt|}}}|color:{{{1|}}};}}{{#ifeq:{{{no-monospace|}}}|yes||font-family: monospace, monospace;}}">{{If empty|{{{alt|}}}|{{{text|}}}| }}</span>| }}
This allows for an option no-monospace to be specified and if it is yes then it does not render the text in the legend as monospace. This is an issue largely with US auto racing articles, for example, 2025 NASCAR Craftsman Truck Series#Schedule, where just an "O" displays a lot like a 0 in monospace font, but I'm sure there's also other uses for it. If this is changed, ping me and I can update the documentation as well. I tested it in my sandbox and it worked fine. Casablanca 🪨(T) 01:36, 23 August 2025 (UTC)
|no-monospace=yesis confusing. How about|monospace=no, which is easier to parse? Also, please demonstrate an example of how this change would be useful by editing Template:Legend/testcases. – Jonesey95 (talk) 12:06, 24 September 2025 (UTC)- Jonesey95, Sounds good! I've made those changes as you've requested. Thank you for reviewing this. Casablanca 🪨(T) 23:04, 25 September 2025 (UTC)
Protected edit request on 11 February 2026
[edit]This edit request to Template:Legend and Template:Legend inline has been answered. Set the |answered= parameter to no to reactivate your request. |
As the edit request from 18 August 2025 pointed out, inverting does not currently work for built-in dark mode. The fix for this is rather simple, it is simply missing a skin-invert class for when the |invert= parameter is supplied; I have made this change in {{legend/sandbox}} and {{legend inline/sandbox}} already, and am requesting them to be implemented:
{{legend|green|Green|invert=y}}
{{legend/sandbox|green|Green|invert=y}}
| − | class="legend-color {{#if: | + | class="legend-color {{#if:{{{invert|}}}|skin-invert|mw-no-invert}}" |
{{legend inline|red|Red|invert=y}}
{{legend inline/sandbox|red|Red|invert=y}}
Red
Red
| − | class="legend-color | + | class="legend-color {{#if:{{{invert|}}}|skin-invert|mw-no-invert}}" |
Thanks! ~ oklopfer (💬) 17:03, 11 February 2026 (UTC)
Done phuzion (talk) 12:36, 12 February 2026 (UTC)
- It may be better and more future-proof to use
|class=here. That is typically what we do in infobox templates where images may need to have one or more classes applied. – Jonesey95 (talk) 04:02, 15 February 2026 (UTC)
- It may be better and more future-proof to use
Template-protected edit request on 8 November 2026
[edit]This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Insert -->{{#if:{{{opacity|}}}|opacity:{{{opacity}}};}}<!-- in line 9 to match c:Template:Legend support for opacity w/ new |opacity= param, if not controversial/plss? Testcases look ok, I think? Asdfjrjjj (talk) 02:24, 8 November 2026 (UTC)
Done make sure to update the documentation. Vestrian24Bio 03:09, 10 November 2026 (UTC)