Template talk:Userbox
| This is the talk page for discussing improvements to the Userbox template. |
|
| Archives: 1, 2Auto-archiving period: 3 months |
| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
| To help centralize discussions and keep related topics together, Module talk:Userbox redirects here. |
Template glitch
[edit]Hello. There seems to be a glitch with the template as only the header appears not the userboxes themselves. Spectritus (talk) 13:26, 5 April 2025 (UTC)
- Spectritus, could you please be more specific? On which page and which template are you trying to use? —andrybak (talk) 20:25, 12 September 2025 (UTC)
TemplateStyles support
[edit]@Matrix, regarding your "vibe coded" Special:Diff/1310987093. The new function hasValue at the very top of the diff is useless, because Module:Arguments takes care of empty strings. The whole purpose of using Module:Arguments is to avoid having to implement extra checks in the way function hasValue is used. —andrybak (talk) 20:55, 12 September 2025 (UTC)
- @Andrybak: yeah fair enough, I kinda just checked if it worked on the testcases. I'll fix it tomorrow, but I'll check with you first. —Matrix ping mewhen u reply (t? - c) 21:11, 12 September 2025 (UTC)
- @Matrix While you're at it, maybe check if it's possible that the edit (or the creation of Template:Userbox/styles.css? I don't know much about stylesheets etc.) caused an issue with an id/logo background appearing on the right, when none has been defined. I just noticed there were grey squares all over my user page (see this userbox, this one, and this one; none of these normally have a grey square on the right). As I said, I don't know much about module editing or stylesheets, but Template:Userbox hasn't been edited in nearly a year and there aren't any other templates or modules involved, so I feel like it might well be these edits that have caused the issue. (I would try and fix the problem myself but I wouldn't know where to start, and I'm not a template editor anyway.) Pineapple Storage (talk) 00:45, 13 September 2025 (UTC)
- In retrospect, you should've tested your vibe coding on the sandbox version of the module, or at least previewed it so that you would've seen the problem (good thing the page has a table that demonstrates how userboxes appear) and not have published those changes to begin with. – MrPersonHumanGuy (talk) 02:08, 13 September 2025 (UTC)
- @MrPersonHumanGuy: I did test it on the sandboxed version, and checked testcases, and everything looked fine. Maybe I missed something? Either way, I'll go back and check. —Matrix ping mewhen u reply (t? - c) 10:29, 13 September 2025 (UTC)
Template-protected edit request on 13 September 2025
[edit]This edit request to Module:Userbox has been answered. Set the |answered= parameter to no to reactivate your request. |
Simply revert Module:Userbox to this revision so that userboxes affected by a recent edit will appear normal again. – MrPersonHumanGuy (talk) 02:01, 13 September 2025 (UTC)
- This happened to my userboxes too! It's annoying to see the gray square on the right (even there is no "id") and borders left uncoloured being present too... Uo・ェ・oU MatchaMint (talk) 04:29, 13 September 2025 (UTC)
- Done. @Matrix: Please investigate and test proposed changes. Johnuniq (talk) 04:45, 13 September 2025 (UTC)
- Hmmm, testcases seemed to work perfectly. I'll add more testcases and check again. —Matrix ping mewhen u reply (t? - c) 10:25, 13 September 2025 (UTC)
- Ok, I got the grey square on the right to disappear, now let me try to figure out why the border colour/width aren't working. —Matrix ping mewhen u reply (t? - c) 10:38, 13 September 2025 (UTC)
- @MrPersonHumanGuy, MatchaMint, and Johnuniq: it should work now (see testcases), can you guys confirm? —Matrix ping mewhen u reply (t? - c) 10:54, 13 September 2025 (UTC)
- I've added some testing of the float parameter. When left out the sandbox version does not match. See Template:Userbox/testcases#Multiple_boxes_together. Another issue is that the colors are different. Was this a deliberate choice? -- WOSlinker (talk) 10:58, 13 September 2025 (UTC)
- @WOSlinker: Fixed the float issue, I forgot to add it to the templatestyles. The colours was a deliberate choice, so that it is closer to Codex. I don't mind changing the colours back to the same ones if it is a problem and adding some
html.skin-theme-clientpref-nights. —Matrix ping mewhen u reply (t? - c) 11:12, 13 September 2025 (UTC)- If no one objects, I'm gonna assume I have a silent consensus to go ahead (and change the colours slightly). —Matrix ping mewhen u reply (t? - c) 14:16, 14 September 2025 (UTC)
- @WOSlinker: Fixed the float issue, I forgot to add it to the templatestyles. The colours was a deliberate choice, so that it is closer to Codex. I don't mind changing the colours back to the same ones if it is a problem and adding some
- I've added some testing of the float parameter. When left out the sandbox version does not match. See Template:Userbox/testcases#Multiple_boxes_together. Another issue is that the colors are different. Was this a deliberate choice? -- WOSlinker (talk) 10:58, 13 September 2025 (UTC)
|
- @Matrix: Can we change the colors back to the way it was before? It is causing some userboxes to appear different colors where previously they were the same color, compare e.g. the admin and checkuser userboxes (see right). If there is a good reason to change the colors beyond just personal preference (e.g. some accessibility concern), I am also open to the option of modifying the {{User rights}} template (which {{User wikipedia/CheckUser}} is based on) to use the new colors. (Though it looks like the new colors make the admin userbox hard to read in dark mode, so it might need some more tinkering.) Mz7 (talk) 08:03, 16 September 2025 (UTC)
- @Mz7: sure, done, it was a silent consensus after all. Yes, it does need further tinkering and maybe bot work. I made some temporary changes at Template:Userbox/styles.css. —Matrix ping mewhen u reply (t? - c) 17:05, 16 September 2025 (UTC)
- @Matrix: Can we change the colors back to the way it was before? It is causing some userboxes to appear different colors where previously they were the same color, compare e.g. the admin and checkuser userboxes (see right). If there is a good reason to change the colors beyond just personal preference (e.g. some accessibility concern), I am also open to the option of modifying the {{User rights}} template (which {{User wikipedia/CheckUser}} is based on) to use the new colors. (Though it looks like the new colors make the admin userbox hard to read in dark mode, so it might need some more tinkering.) Mz7 (talk) 08:03, 16 September 2025 (UTC)
EmDashUser002 – Dark mode error
[edit]Issue Description
[edit]Changing text colour without adjusting according to background significantly reduces contrast. For example, on Template:Userbox, most userbox info—especially the exemplars near the bottom of the page—are barely legible.
I understand that "Color" is still in beta, but I hope this matter will be reasonably addressed.
Cordially.
EmDashUser002 (Talk | Contribs) @ 07:16, 3 November 2025 (UTC)
Edit request: new arg 'bodymargin'
[edit]Please implement new arg 'bodymargin' to avoid jamming a floated user box up against wrapping page text. The current module sandbox revision 1320512121 of 03:46, 5 November 2025 (diff) is designed to solve this by: a) allowing the user to specify the desired separation, and b) providing a minimum separation by default for floated boxes. Normal flow (unfloated) is not affected.
The Module sandbox is invoked by the Template sandbox, and new tests at Template:Userbox/testcases#Body margin all pass. I had considered an alternative, broader design with a new param 'bodystyle' instead of 'bodymargin' which would encompass any css property, including margin, but decided it was too broad and this was better at least for now, as this resolves an actual existing problem with userboxes, and it's not clear if being able to add general style to the box is needed right now.
This is only my second or maybe third attempt at making changes to a Module, so extra eyeballs here would be worthwhile. As a postscript: regardless if this is accepted or not, any comments on the code with respect to style, best practices, or other ways to improve the code would be appreciated. I left more extensive in-line comments in the sandbox than I think are needed for live, so feel free to abridge or drop them if they appear superfluous. Mathglot (talk) 04:38, 5 November 2025 (UTC)