用户反馈:「左侧标签栏和右侧设置框两个也不一样高,有一个高度差,看着
很别扭。」经测量纠正:不是高度不一样,是**顶边**位置不同 —— 左栏白
卡片 top=53、右栏白卡片 top=63,差 10px,左边高、右边低。
根因不在主题里,在 WordPress 后台自己的样式:
#wpbody-content .metabox-holder { padding-top: 10px }
这条是给「一路往下竖排的 metabox」留顶部间距用的。3.2.24 把标签列
float 到左边、变成两栏并排之后,这 10px 就没人跟它配对了:左栏
(h2.nav-tab-wrapper) 不带这层 padding,右栏 (#optionsframework-metabox)
还带着,于是右栏被压低 10px。
修法:两栏并排时把这 10px 清零。
#optionsframework-wrap > #optionsframework-metabox { padding-top: 0 }
只在 @media (min-width: 960px) 里清 —— 窄屏仍是标签横排在上一路往下,
那 10px 是该留的间距,不动。
没有采用「给左栏补 10px」的凑齐改法:那样左栏卡片内部会多出一段看不
见的空白,标签整体下移,问题只是从「两栏错位」变成「左栏内部偏空」。
底边仍不齐(左栏 467 固定、右栏 366~1276 随标签变),这是另一个问题,
本轮按用户界定不做,等确认后另开一单。
验证:
- _geo333_top.py 18/0(三档宽屏顶边差 0px;逐标签切 11 次顶边不变;
窄屏 700px 仍保留那 10px)
- _geo333_top_falsify.py 7/0(删规则/写成10px/补左栏padding/挪出媒体查询/
额外 margin/等价重写 0→0px,六种注入全部红对地方)
- _pkgcheck333.py 77/0 · _pkgcheck333_falsify.py 10/0
(C5 抓出真盲点:'float: left' in css 会命中别处,
判据改为锚在左栏块内部)
- 回归全绿:_admin330_tab_check 88/0 · _admin328_check 13/0 · _guard330 63/0
_toc330_logic 101/0 · _test_toc 53/0 · _geo330_rail 73/0
_geo331_inline 23/0,及对应六组 falsify 全部变红且红对地方
- 公网核验:md5 319d098f2fa5c5fb2764f25b8d55936c 本地/下载一致;
包内 Version=3.2.33;padding-top:0 出现 1 次且在 960 媒体查询内;
readme 24 条版本标题、历史 23 条全保留、ul/li/b/code 全配平
531 lines
14 KiB
CSS
531 lines
14 KiB
CSS
#optionsframework {
|
||
max-width: 855px;
|
||
background: #fff;
|
||
}
|
||
|
||
#optionsframework h3 {
|
||
margin: 0;
|
||
padding: 12px 10px;
|
||
border-bottom: 1px solid #ddd;
|
||
background-color: #f1f1f1;
|
||
cursor: default;
|
||
}
|
||
|
||
#optionsframework p {
|
||
margin-bottom: 0;
|
||
padding-bottom: 10px;
|
||
}
|
||
|
||
#optionsframework .section {
|
||
padding: 10px 10px 0;
|
||
}
|
||
|
||
#optionsframework .group {
|
||
padding-bottom: 40px;
|
||
}
|
||
|
||
#optionsframework .section .controls {
|
||
float: left;
|
||
padding-right: 2%;
|
||
width: 54%;
|
||
min-width: 350px;
|
||
}
|
||
|
||
#optionsframework .section .explain {
|
||
float: left;
|
||
max-width: 38%;
|
||
color: #777;
|
||
font-size: 12px;
|
||
line-height: 16px;
|
||
}
|
||
|
||
#optionsframework .section-checkbox .controls {
|
||
width: 98%;
|
||
}
|
||
|
||
#optionsframework .section-checkbox .explain {
|
||
max-width: 94%;
|
||
}
|
||
|
||
#optionsframework .controls input[type="text"],
|
||
#optionsframework .controls input[type="password"] {
|
||
width: 100%;
|
||
}
|
||
|
||
#optionsframework .controls input[type="text"].wp-color-picker {
|
||
width: 65px;
|
||
}
|
||
|
||
#optionsframework .controls select,
|
||
#optionsframework .controls textarea {
|
||
margin-bottom: 10px;
|
||
width: 100%;
|
||
}
|
||
|
||
#optionsframework .section-radio label,
|
||
#optionsframework .section-multicheck label {
|
||
float: left;
|
||
margin-bottom: 5px;
|
||
max-width: 90%;
|
||
line-height: 16px;
|
||
}
|
||
|
||
#optionsframework input.checkbox,
|
||
#optionsframework input.of-radio {
|
||
float: left;
|
||
clear: both;
|
||
margin: 0 10px 5px 0;
|
||
}
|
||
|
||
#optionsframework .section-typography .controls {
|
||
float: none;
|
||
width: auto;
|
||
}
|
||
|
||
#optionsframework .section-typography .explain {
|
||
float: none;
|
||
width: auto;
|
||
}
|
||
|
||
#optionsframework .controls .of-typography-size {
|
||
float: left;
|
||
width: 80px;
|
||
}
|
||
|
||
#optionsframework .controls .of-typography-unit {
|
||
float: left;
|
||
margin-left: 5px;
|
||
width: 50px;
|
||
}
|
||
|
||
#optionsframework .controls .of-typography-face {
|
||
float: left;
|
||
margin-left: 5px;
|
||
width: 100px;
|
||
}
|
||
|
||
#optionsframework .controls .of-typography-style {
|
||
float: left;
|
||
margin-right: 5px;
|
||
margin-left: 5px;
|
||
width: 80px;
|
||
}
|
||
|
||
#optionsframework .section-typography .wp-picker-container {
|
||
margin-top: 2px;
|
||
}
|
||
|
||
#optionsframework .of-background-properties {
|
||
clear: both;
|
||
margin-top: 18px;
|
||
}
|
||
|
||
#optionsframework .controls .of-background-repeat {
|
||
float: left;
|
||
margin-right: 5px;
|
||
width: 125px;
|
||
}
|
||
|
||
#optionsframework .controls .of-background-position {
|
||
float: left;
|
||
margin-right: 5px;
|
||
width: 125px;
|
||
}
|
||
|
||
#optionsframework .controls .of-background-attachment {
|
||
float: left;
|
||
margin-right: 5px;
|
||
width: 125px;
|
||
}
|
||
|
||
#optionsframework .section-background .wp-picker-container {
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
#optionsframework .controls .of-radio-img-img {
|
||
float: left;
|
||
display: none;
|
||
margin: 0 5px 10px 0;
|
||
border: 3px solid #f9f9f9;
|
||
cursor: pointer;
|
||
}
|
||
|
||
#optionsframework .controls .of-radio-img-selected {
|
||
border: 3px solid #ccc;
|
||
}
|
||
|
||
#optionsframework .controls .of-radio-img-img:hover {
|
||
opacity: 0.8;
|
||
}
|
||
|
||
#optionsframework .controls .of-border-width {
|
||
float: left;
|
||
width: 80px;
|
||
}
|
||
|
||
#optionsframework .controls .of-border-style {
|
||
float: left;
|
||
width: 120px;
|
||
}
|
||
|
||
#optionsframework .hide {
|
||
display: none;
|
||
}
|
||
|
||
#optionsframework .of-option-image {
|
||
margin: 3px 0 18px 0;
|
||
max-width: 340px;
|
||
}
|
||
|
||
#optionsframework .mini .controls select,
|
||
#optionsframework .section .mini .controls {
|
||
width: 140px;
|
||
}
|
||
|
||
#optionsframework .mini .controls input,
|
||
#optionsframework .mini .controls {
|
||
width: 140px;
|
||
min-width: 140px;
|
||
}
|
||
|
||
#optionsframework .mini .explain {
|
||
max-width: 74%;
|
||
}
|
||
|
||
#optionsframework .section-info {
|
||
padding-bottom: 7px;
|
||
}
|
||
|
||
#optionsframework .controls input.upload {
|
||
width: 80%;
|
||
}
|
||
|
||
#optionsframework .screenshot {
|
||
position: relative;
|
||
float: left;
|
||
margin-top: 3px;
|
||
margin-left: 1px;
|
||
width: 344px;
|
||
}
|
||
|
||
#optionsframework .screenshot img {
|
||
float: left;
|
||
margin-bottom: 10px;
|
||
padding: 4px;
|
||
max-width: 334px;
|
||
border-color: #ccc #eee #eee #ccc;
|
||
border-style: solid;
|
||
border-width: 1px;
|
||
background: #fafafa;
|
||
}
|
||
|
||
#optionsframework .screenshot .remove-image {
|
||
position: absolute;
|
||
bottom: 4px;
|
||
left: -4px;
|
||
float: left;
|
||
display: block;
|
||
padding: 0;
|
||
width: 16px;
|
||
height: 16px;
|
||
border: medium none;
|
||
background: url("../images/ico-delete.png") no-repeat;
|
||
text-indent: -9999px;
|
||
}
|
||
|
||
#optionsframework .screenshot .no_image .file_link {
|
||
margin-left: 20px;
|
||
}
|
||
|
||
#optionsframework .screenshot .no_image .remove-button {
|
||
bottom: 0px;
|
||
}
|
||
|
||
#optionsframework .reset-button {
|
||
float: left;
|
||
cursor: pointer;
|
||
}
|
||
|
||
#optionsframework-submit {
|
||
padding: 7px 10px;
|
||
border-top: 1px solid #ddd;
|
||
background-color: #f1f1f1;
|
||
}
|
||
|
||
#optionsframework .button-primary {
|
||
float: right;
|
||
}
|
||
|
||
#optionsframework .section:after {
|
||
display: table;
|
||
content: "";
|
||
}
|
||
|
||
#optionsframework .section:after {
|
||
clear: both;
|
||
}
|
||
|
||
#optionsframework .about-content {
|
||
padding: 10px 20px;
|
||
}
|
||
|
||
#optionsframework .about-content img {
|
||
width: 100%;
|
||
height: auto;
|
||
}
|
||
|
||
#optionsframework .about-content h4 {
|
||
margin-top: 20px;
|
||
margin-bottom: 16px;
|
||
padding-bottom: 0.3em;
|
||
border-bottom: 1px solid #eaecef;
|
||
font-weight: 600;
|
||
font-size: 18px;
|
||
line-height: 1.25;
|
||
}
|
||
|
||
#optionsframework .about-content ul {
|
||
padding-left: 0;
|
||
list-style: none;
|
||
font-size: 15px;
|
||
}
|
||
|
||
#optionsframework .about-content ul li {
|
||
line-height: 25px;
|
||
}
|
||
|
||
#optionsframework .about-content .notices {
|
||
color: #727777;
|
||
font-size: 14px;
|
||
}
|
||
|
||
#optionsframework .about-content .tips {
|
||
color: #333333;
|
||
text-align: center;
|
||
font-size: 16px;
|
||
}
|
||
|
||
#optionsframework .about-content .tips b {
|
||
margin-left: 3px;
|
||
}
|
||
|
||
/* ── 多选复选框组(multicheck)────────────────────────────────
|
||
框架原本没有这个类型的渲染分支,所以也没有配套样式。
|
||
不加样式的话,9 个纪念日会挤成一行流水文字,看不出是一个可勾选的清单。
|
||
这里做成两列表格状,并把说明文字压到第二行、颜色调淡,
|
||
让「名称」是视觉主体、「日期说明」是补充信息。 */
|
||
#optionsframework .of-multicheck {
|
||
margin: 0;
|
||
padding: 2px 0 0;
|
||
border: 0;
|
||
}
|
||
|
||
#optionsframework .of-multicheck-item {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 8px;
|
||
padding: 9px 12px;
|
||
margin: 0 0 2px;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
transition: background-color 0.15s ease;
|
||
}
|
||
|
||
#optionsframework .of-multicheck-item:hover {
|
||
background-color: #f3f5f7;
|
||
}
|
||
|
||
#optionsframework .of-multicheck-item input[type="checkbox"] {
|
||
margin: 3px 0 0;
|
||
flex: 0 0 auto;
|
||
}
|
||
|
||
/* 名称与说明两行文字共用的竖排容器 */
|
||
#optionsframework .of-multicheck-text {
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex: 1 1 auto;
|
||
}
|
||
|
||
#optionsframework .of-multicheck-label {
|
||
font-size: 14px;
|
||
color: #23282d;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
#optionsframework .of-multicheck-note {
|
||
font-size: 12px;
|
||
color: #727777;
|
||
line-height: 1.5;
|
||
margin-top: 3px;
|
||
}
|
||
|
||
/* ══════════════════════════════════════════════════════════════
|
||
3.2.24 设置页布局重排
|
||
用户反馈:"主题设置的样式不好看,把标签页按钮放左侧、上下排列,
|
||
功能项放在右侧,重新设置好看一点。"
|
||
|
||
实现:≥960px 时把 nav-tab-wrapper 浮到左侧成一列竖排导航,
|
||
内容区(含保存提示条)整体右移;窄屏回退 WP 默认的横向标签,
|
||
不在手机后台做特殊布局。切标签的 JS(options-custom.js)不动,
|
||
它只认 .nav-tab / .nav-tab-active / .group 这几个类。
|
||
══════════════════════════════════════════════════════════════ */
|
||
|
||
@media screen and (min-width: 960px) {
|
||
|
||
#optionsframework-wrap {
|
||
max-width: 1180px;
|
||
}
|
||
|
||
/* 浮动布局的收尾:否则 wrap 高度塌到标签列或面板较短的那个 */
|
||
#optionsframework-wrap::after {
|
||
display: table;
|
||
clear: both;
|
||
content: "";
|
||
}
|
||
|
||
/* ── 左侧标签列 ── */
|
||
#optionsframework-wrap h2.nav-tab-wrapper {
|
||
float: left;
|
||
box-sizing: border-box;
|
||
width: 190px;
|
||
margin: 0 20px 20px 0;
|
||
padding: 8px;
|
||
border: 1px solid #dcdcde;
|
||
border-radius: 6px;
|
||
background: #fff;
|
||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
||
}
|
||
|
||
#optionsframework-wrap .nav-tab-wrapper .nav-tab {
|
||
float: none;
|
||
display: block;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
margin: 0 0 2px;
|
||
padding: 9px 12px;
|
||
border: 0;
|
||
border-left: 3px solid transparent;
|
||
border-radius: 4px;
|
||
background: none;
|
||
color: #50575e;
|
||
line-height: 1.5;
|
||
cursor: pointer;
|
||
}
|
||
|
||
#optionsframework-wrap .nav-tab-wrapper .nav-tab:last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
#optionsframework-wrap .nav-tab-wrapper .nav-tab:hover {
|
||
border-left-color: transparent;
|
||
background: #f0f0f1;
|
||
color: #1d2327;
|
||
}
|
||
|
||
#optionsframework-wrap .nav-tab-wrapper .nav-tab-active,
|
||
#optionsframework-wrap .nav-tab-wrapper .nav-tab-active:hover {
|
||
border-left-color: #00a2ff;
|
||
background: #e8f5ff;
|
||
color: #0089db;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* ── 右侧内容区:面板 + 保存提示条都要让开左侧一列 ── */
|
||
#optionsframework-wrap > #optionsframework-metabox,
|
||
#optionsframework-wrap > .notice,
|
||
#optionsframework-wrap > .updated,
|
||
#optionsframework-wrap > .error {
|
||
margin-left: 210px;
|
||
}
|
||
|
||
/* ══════════════════════════════════════════════════════════
|
||
3.2.33 两栏顶边对齐
|
||
用户反馈:"左侧标签栏和右侧设置框两个也不一样高,有一个高度差,
|
||
看着很别扭。" —— 实际量下来不是高度,是**顶边**:左栏白卡片
|
||
top=53,右栏白卡片 top=63,差 10px,左边高、右边低。
|
||
|
||
病因在 WordPress 自己的后台样式:
|
||
#wpbody-content .metabox-holder { padding-top: 10px }
|
||
这条是给「一路往下排的 metabox」留顶部间距用的。3.2.24 把标签列
|
||
float 到左边、变成两栏并排之后,这 10px 就没人跟它配对了 ——
|
||
左栏(h2.nav-tab-wrapper)不带这层 padding,右栏带,于是错开。
|
||
|
||
修法:两栏并排时把那 10px 清零。**只在 ≥960px 里清** ——
|
||
窄屏仍是标签横排在上一路往下,那 10px 是该留的间距。
|
||
⚠️ 不能用 padding-top: 10px 补给左栏来"凑齐":那会让左栏白卡片
|
||
内部多出一段看不见的空白,标签整体下移 10px,与页面标题之间
|
||
出现空隙,问题只是从「两栏错位」变成「左栏内部偏下」。
|
||
══════════════════════════════════════════════════════════ */
|
||
#optionsframework-wrap > #optionsframework-metabox {
|
||
padding-top: 0;
|
||
}
|
||
|
||
#optionsframework-metabox #optionsframework {
|
||
border-radius: 6px;
|
||
}
|
||
}
|
||
|
||
/* ── 区块内部(宽窄屏都生效)────────────────────────────────
|
||
1. 分组标题:原来 `#optionsframework h3` 是给面板顶部那条用的
|
||
灰底横条,选择器太宽把每个分组标题也罩了进去,整页一排灰条。
|
||
这里把分组标题单独重排:去灰底、加重字重、压淡下边线。 */
|
||
#optionsframework .group > h3 {
|
||
margin: 0;
|
||
padding: 15px 18px 13px;
|
||
border-bottom: 1px solid #f0f0f1;
|
||
background: none;
|
||
font-size: 15px;
|
||
font-weight: 600;
|
||
color: #1d2327;
|
||
}
|
||
|
||
/* 2. 区块间距与分隔:原来 10px 的内边距太挤,项与项之间没有分界。
|
||
* 3.2.26 调整:16/8 → 14/12,并清掉 h4 标题的 WP 默认 margin(见下)
|
||
*
|
||
* 3.2.28:这里补上了 `display: flow-root` —— 本次真正的根因修复。
|
||
*
|
||
* 3.2.24 把标签列改成 float:left(宽 190px;标签多了以后整列约 400px 高),
|
||
* 而框架原本给 .section 留了 ::after{clear:both} 来清除内部浮动的
|
||
* .controls / .explain。问题在于 clear 的作用范围以**最近的 BFC** 为界:
|
||
* .section 只是普通块盒、不建 BFC,于是它末尾那个清除元素被要求避开
|
||
* **左侧整个浮动标签列**,把第一个配置项的下边界一直撑到标签列底部
|
||
* (实测 section 高 405px,而内容只占 43px)。
|
||
*
|
||
* 这也解释了 3.2.26 只收编 h4 的 margin 为什么完全无效 —— 多出来的不是
|
||
* 间距,是 section 自身的高度;空白也只出现在第一个配置项之后,因为后面
|
||
* 的 section 起点已经越过标签列底部,clear 不再起作用。
|
||
*
|
||
* 修法:让 .section 建立自己的 BFC,内部的清除就只在自身范围内生效。
|
||
* 不能用 overflow:hidden —— 那会把颜色选择器的弹出层裁掉。
|
||
* 原有的 ::after{clear:both}(见上面 .section:after)保留,
|
||
* 作为极老浏览器不支持 flow-root 时的兜底。 */
|
||
#optionsframework .section {
|
||
display: flow-root;
|
||
padding: 14px 18px 12px;
|
||
border-bottom: 1px solid #f6f7f7;
|
||
}
|
||
|
||
/* 3.2.26:配置项标题(h4.heading)继承 WP 后台 common.css 的
|
||
* 上下 margin ≈17px,与 section 的 padding 叠加后,相邻两个配置项
|
||
* 之间多出约 34px 的空隙(上下各 17px)。标题的内距统一由本条控制:
|
||
* 上边距清零(section 的 padding-top 负责),下边距 10px 压住控件。 */
|
||
#optionsframework .section > .heading {
|
||
margin: 0 0 10px;
|
||
}
|
||
|
||
/* 条件字段(如「自动插入位置」只在目录位置=正文中间时才有意义)
|
||
*
|
||
* 用 !important 的 display:none 而不是 jQuery 的 show()/hide(),原因见
|
||
* js/options-custom.js 里 yq_toggle_toc_anchor():.section 的 display 是
|
||
* flow-root,jQuery 会把行内 display 写成 block,等于回退 3.2.28 的修复。
|
||
* 这里只隐藏,不改变其它布局属性。 */
|
||
#optionsframework .section.yq-cond-hide {
|
||
display: none !important;
|
||
}
|
||
|
||
/* 3. 提交栏:与分组标题同一套留白 */
|
||
#optionsframework-submit {
|
||
padding: 12px 18px;
|
||
}
|