由Grandom提出的对Template:Navbox、Template:Navbox subgroup、MediaWiki:Gadget-desktop-styles.css和MediaWiki:Gadget-mobile-styles.css的编辑请求:
平时编辑过程中陆续注意到navbox里的一些小问题,但考虑到其在全站大面积使用也就没急着提交。前阵子注意到模块化navbox取得了一些进展,所以这次集中请求编辑,希望在完全模块化之前解决这些问题。
由于涉及页面较多,内容较长,所以单开了一个讨论页来申请。这里召唤两位熟悉的前辈@AnnAngela和@サンムル帮助审核,也欢迎其他大佬给出建议。
所有修改一共分成四部分,可以使用右侧的切换按钮分别显示每部分修改与下方的说明。
{{Ptl}}模板已弃用。
grouppadding | 不显示不显示显示显示 |
title居中 | 不显示不显示显示显示 |
移动端绿条 | 不显示不显示显示显示 |
其他问题 | 不显示不显示显示显示 |
Template:Navbox ---Title and Navbar--- -->{{#if:{{{title|}}}|<tr>{{#if:{{{titlegroup|}}}|<!-- --><td class="navbox-group" style="{{{basestyle|}}};{{Ptl}}模板已弃用。{{{groupstyle|}}};{{{titlegroupstyle|}}}">{{{titlegroup|}}}</td><!-- --><th style="border-left:2px solid #fdfdfd;width:100%;|<th style="}}{{{basestyle|}}};{{{titlestyle|}}}" <!-- -->colspan={{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}{{#if:{{{titlegroup|}}}|-1}}}} <!-- -->class="navbox-title"><!-- -->{{#if:{{#switch:{{{navbar|}}}|plain|off=1}}<!-- -->{{#if:{{{name|}}}||{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=1}}}}|<!-- -->{{#ifeq:{{{navbar|}}}|off|{{#ifeq:{{{state|}}}|plain|<div style="float:right;width:Lua错误:attempt to compare string with number。em;"> </div>}}|<!-- -->{{#ifeq:{{{state|}}}|plain||<div style="float:left; width:Lua错误:attempt to compare string with number。em;text-align:left;"> </div>}}}}|<!-- --><div style="float:left; width:Lua错误:attempt to compare string with number。em;text-align:left;">{{Ptl}}模板已弃用。<!-- -->{{Navbar|{{{name}}}|fontstyle={{{basestyle|}}};{{{titlestyle|}}};border:none;|mini=1}}<!-- --></div>{{#ifeq:{{{state|}}}|plain|<div style="float:right;width:Lua错误:attempt to compare string with number。em;"> </div>}}}}<!-- --><span style="font-size:{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=100|#default=110}}%;"><!-- -->{{{title}}}</span></th></tr>}}<!-- 需要对每个group进行修改: -->{{#if:{{{list2|}}}|<!-- -->{{#if:{{{title|}}}{{{above|}}}{{{list1|}}}|<tr style="height:2px"><td></td></tr>}}<tr><!-- -->{{#if:{{{group2|}}}|<td class="navbox-group" style="{{{basestyle|}}};{{Ptl}}模板已弃用。{{{groupstyle|}}};{{{group2style|}}}"><!-- -->{{{group2}}}</td><td style="text-align:left;border-left:2px solid #fdfdfd;|<td colspan=2 style="}}<!-- -->width:100%;padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list2style|}}}" <!-- -->class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}"><!-- --><div style="padding:{{{listpadding|0em 0.25em}}}">{{{list2}}}</div></td></tr>}}<!-- |
MediaWiki:Gadget-desktop-styles.css .navbox-group { font-weight: 700; Lua错误:attempt to compare string with number。 white-space: nowrap; } Lua错误:attempt to compare string with number。 |
MediaWiki:Gadget-mobile-styles.css html > body.skin-minerva .navbox { border: 1px solid #aaa; clear: both; padding: 1px; text-align: center; width: 100%; {{Ptl}}模板已弃用。} {{Ptl}}模板已弃用。 html > body.skin-minerva .navbox-subgroup .navbox-group{{Ptl}}模板已弃用。 { background: #e6f6e6; } Lua错误:attempt to compare string with number。 @media screen and (max-width: 640px) { html > body.skin-minerva .navbox-group{{Ptl}}模板已弃用。 { display: block; {{Ptl}}模板已弃用。 } html > body.skin-minerva .navbox-group+* { Lua错误:attempt to compare string with number。Lua错误:attempt to compare string with number。Lua错误:attempt to compare string with number。 } Lua错误:attempt to compare string with number。{{Ptl}}模板已弃用。} |
|
Template:Navbox subgroup |border = {{#if:{{{border|}}}|{{{border}}}|Lua错误:attempt to compare string with number。}} Lua错误:attempt to compare number with string。 Lua错误:attempt to compare number with string。 Lua错误:attempt to compare number with string。 Lua错误:attempt to compare number with string。 Lua错误:attempt to compare number with string。 Lua错误:attempt to compare number with string。 Lua错误:attempt to compare number with string。 |style = Lua错误:attempt to compare string with number。{{{style|}}}{{Ptl}}模板已弃用。{{{bodystyle|}}} |groupstyle = Lua错误:attempt to compare string with number。{{{groupstyle|}}} |{{#if:{{{evenodd|}}}|evenodd|void1}} = {{{evenodd|}}} |{{#if:{{{listpadding|}}}|listpadding|void2}} = {{{listpadding|}}} {{Ptl}}模板已弃用。 需要对每个group进行修改: |group1 = Lua错误:attempt to compare string with number。{{{group1{{Ptl}}模板已弃用。}}}Lua错误:attempt to compare string with number。 |
listpadding
不同,grouppadding
目前是一个仅供{{Navbox subgroup}}使用的参数,而且是以“先用0覆盖样式表的默认值,再套一层div并规定其左右边距”这种迂回的方式修改了其默认值,而且会与groupstyle
发生冲突。这里将这一参数整合进{{Navbox}}中。值得一提的是,修改后的{{Navbox subgroup}}与{{Navbox|subgroup}}已经完全一致,英文维基则已经用后者完全代替并删除了前者。collapseButton
,导致规定的宽度失效。nomobile
,所以将样式表中的display:none
删除,并效仿空白div添加一个mobileonly
的空格使移动版标题也居中。src
属性未被列入白名单。src
属性未被列入白名单。src
属性未被列入白名单。src
属性未被列入白名单。src
属性未被列入白名单。src
属性未被列入白名单。以上所有更改已应用在…/naubox、…/naubox subgroup、…/desktop.css和…/mobile.css中,并利用…/宝可梦系列角色、…/fripSide和在数十个大家族模板中以预览的方式进行测试。
待进一步审核确认后,我也会提供四个页面修改后的完整代码用于编辑。—— Grandom 2020年12月8日 (二) 03:03 (CST)回复
被转换成正常空格了。没注意<pre>不能防止其转换。My bad… —— Grandom这此的更改和上次的就麻烦@サンムル同步到模块:nav了。
另外提报个模块:nav collapsible groups的bug:这里的liststyle
应该只提交给子navbox的list,父navbox的list无需自定义样式参数,模块里多提交给了父navbox的list:
{{navbox with collapsible groups|style=display:inline-table;width:50%;vertical-align:top|name=test|title=模板:navbox with collapsible groups|group1=group1|list1=list1|state1=mw-uncollapsed|group2=group2|list2=list2 list2style="font-size:150%"|list2style=font-size:150%|state2=mw-uncollapsed}} {{#invoke:nav|box|collapsible groups|style=display:inline-table;width:50%;vertical-align:top|name=test|title=模块:nav{{!}}box{{!}}collapsible groups|group1=group1|list1=list1|state1=mw-uncollapsed|group2=group2|list2=list2 list2style="font-size:150%"|list2style=font-size:150%|state2=mw-uncollapsed}}
P.S.修复后会将示例删除消除隐藏分类 —— Grandom 2020年12月10日 (四) 22:28 (CST)回复
140px
,现在为fit-content !important
,详见Special:差异/955613/4585025。—— Grandomfit-content
属性同样可以解决新版Wikiplus的换行问题,建议添加至小工具,或者干脆将该条转移至全站桌面版CSS。@AnnAngela —— Grandom