Module talk:Box

From Puella Magi Wiki
Jump to navigation Jump to search

I foolishly went to use the default MediaWiki template module option for padding to try and improve the visual videlity of the Walpurgisnacht: Rising spoiler + missing info boxes, and it seems that padding isn't included in our version of Box? Can we use the upstream module of Box, or would something prohibit us from doing so? Alternately, I can see about porting over just the padding/CSS changes that it'd take to make the padding work. Thanks in advance! HomuraDidNothingWrong (talk) 00:47, 6 January 2026 (UTC)

The upstream box template is very heavy, and would require some 40+ related templates and modules to be imported as well, which is why I decided to create this one instead (as a more lightweight alternative, though it doesn't have all the features it has). I can implement padding changes to this one if that works for you (I assume top-right-bottom-left padding for inner and outer?). Do you have any other functionalities that you want to be ported over? -- 0x99 (talk) 04:37, 6 January 2026 (UTC)
Oh I had no idea it'd be such a big lift, apologies. If you could port padding (either per-side or overall would be fine). Inline CSS would also be nice, but is by no means a hard requirement. Thank you so much! HomuraDidNothingWrong (talk) 05:10, 7 January 2026 (UTC)

Gradient Color

Is it possible to add gradient colors for the box? just adding linear-gradient(smth) doesnt work but I think that's because it only accepts hex codes as colors. As of now the Kioku pages use the boxes for their descriptions, using the colors they use in the chamber of light (example), and I wanted the Magia Record unit pages to use those colors too, as now they seem pretty bare. BUT unlike Exedra, Record has dual units which can't just use one color because they have 2 characters. I think it would be really nice if this module was modified to somehow allow gradient colors, but I don't know how possible that is. - TheresaFrog421 (talk) 01:33, 12 February 2026 (UTC)

I'd be reluctant to endorse such a thing. Gradients are really bad at being involved in minimum contrast stuff. I've had enough issues ensuring that the content of some pages are visible with the minimum contrast between the foreground and background (theory boxes ran afoul of this iirc.) IMO it'd have to be used incredibly carefully. HomuraDidNothingWrong (talk) 23:22, 12 February 2026 (UTC)
I see what you mean, I'd personally use it like its used on the unit pages currently, only the outer border being there, so the text isnt affected by the color at all. But I do agree that it should be used sparingly... - TheresaFrog421 (talk) 13:30, 13 February 2026 (UTC)
Gradients should be possible; the key thing to understand with them is that they are a "procedurally-generated image", so you set them up the way you would set up a background image. But there's a good point about gradients complicating contrast – it really depends on the colours, of course, but it's something to be careful of. That said, that's a contrast problem that's fairly trivially solved by just adding an outline to the text. ~ Celtic Minstrel (talk) 19:10, 13 February 2026 (UTC)