Skip to content

Commit 0ce5c20

Browse files
committed
修改版式
1 parent 6697cdb commit 0ce5c20

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

_includes/head-custom.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,27 @@
9696

9797
.spec-table table {
9898
width: 100%;
99-
table-layout: fixed;
100-
font-size: 0.8rem;
101-
line-height: 1.15;
99+
table-layout: auto;
100+
font-size: 0.82rem;
101+
line-height: 1.2;
102102
}
103103

104104
.spec-table th,
105105
.spec-table td {
106-
padding: 0.3rem 0.4rem;
107-
white-space: normal;
108-
word-break: break-word;
106+
padding: 0.3rem 0.45rem;
107+
white-space: nowrap;
109108
}
110109

111110
@media screen and (min-width: 64em) {
112111
.main-content {
113112
padding-right: 18rem;
114113
}
115114

115+
body.has-spec-table .main-content {
116+
max-width: 90rem;
117+
padding-right: 14rem;
118+
}
119+
116120
.toc-container {
117121
position: fixed;
118122
top: 1rem;
@@ -132,6 +136,17 @@
132136
.toc-container li {
133137
font-size: 0.85rem;
134138
}
139+
140+
body.has-spec-table .toc-container {
141+
width: 12rem;
142+
}
143+
}
144+
145+
@media screen and (max-width: 64em) {
146+
.spec-table th,
147+
.spec-table td {
148+
white-space: normal;
149+
}
135150
}
136151
</style>
137152
{% assign _seo_keywords = page.seo_keywords | default: "" | strip %}
@@ -143,6 +158,10 @@
143158
const main = document.querySelector('.main-content');
144159
if (!main) return;
145160

161+
if (document.querySelector('.spec-table')) {
162+
document.body.classList.add('has-spec-table');
163+
}
164+
146165
const overlay = document.createElement('div');
147166
overlay.className = 'lightbox-overlay';
148167
overlay.innerHTML = '<img alt=""><div class="caption"></div><div class="hint">点击任意位置或按 Esc 关闭</div>';

0 commit comments

Comments
 (0)