MediaWiki:Common.css:修订间差异
MediaWiki界面页面
更多操作
创建css规则 |
小 添加图片来源域支持 |
||
| 第12行: | 第12行: | ||
/* 其他字重定义(结构相同,路径不同) */ | /* 其他字重定义(结构相同,路径不同) */ | ||
/* 注:此处省略其他@font-face规则,保持原样 */ | |||
@font- | |||
/* 等宽字体定义 */ | /* 等宽字体定义 */ | ||
| 第51行: | 第50行: | ||
/* ===== 图片响应式系统 ===== */ | /* ===== 图片响应式系统 ===== */ | ||
img[src*="cdn.guohao.asia"] { | /* 修改:同时匹配cdn和www域名 */ | ||
img[src*="cdn.guohao.asia"], | |||
img[src*="www.guohao.asia"] { | |||
height: auto; | height: auto; | ||
display: block; | display: block; | ||
| 第63行: | 第64行: | ||
/* JS控制的类 - 增加特异性 */ | /* JS控制的类 - 增加特异性 */ | ||
img[src*="cdn.guohao.asia"].img-auto { | /* 修改:同时匹配cdn和www域名 */ | ||
img[src*="cdn.guohao.asia"].img-auto, | |||
img[src*="www.guohao.asia"].img-auto { | |||
width: auto !important; | width: auto !important; | ||
max-width: none !important; | max-width: none !important; | ||
} | } | ||
img[src*="cdn.guohao.asia"].img-responsive { | img[src*="cdn.guohao.asia"].img-responsive, | ||
img[src*="www.guohao.asia"].img-responsive { | |||
width: var(--img-desktop-width) !important; | width: var(--img-desktop-width) !important; | ||
} | } | ||
| 第79行: | 第83行: | ||
} | } | ||
/* 移动端覆盖规则 */ | /* 移动端覆盖规则 - 修改:同时匹配cdn和www域名 */ | ||
img[src*="cdn.guohao.asia"].img-responsive { | img[src*="cdn.guohao.asia"].img-responsive, | ||
img[src*="www.guohao.asia"].img-responsive { | |||
width: 100% !important; | width: 100% !important; | ||
} | } | ||
2025年10月17日 (五) 09:12的最新版本
/* 这里放置的CSS将应用于所有皮肤 */
/* ===== 字体定义 ===== */
@font-face {
font-family: 'LXGWWenKaiLite';
src: url('https://cdn.guohao.asia/cdn/font/lxgw-wenkai-lite/LXGWWenKaiLite-Light.woff2') format('woff2'),
url('https://cdn.guohao.asia/cdn/font/lxgw-wenkai-lite/LXGWWenKaiLite-Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
font-display: swap;
cross-origin: anonymous; /* 修正属性名:crossOrigin → cross-origin */
}
/* 其他字重定义(结构相同,路径不同) */
/* 注:此处省略其他@font-face规则,保持原样 */
/* 等宽字体定义 */
@font-face {
font-family: 'LXGWWenKaiMonoLite';
src: url('https://cdn.guohao.asia/cdn/font/lxgw-wenkai-lite/LXGWWenKaiMonoLite-Regular.woff2') format('woff2'),
url('https://cdn.guohao.asia/cdn/font/lxgw-wenkai-lite/LXGWWenKaiMonoLite-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
font-display: swap;
}
/* ===== 全局样式 ===== */
:root {
--font-primary: 'LXGWWenKaiLite', system-ui, -apple-system, sans-serif;
--font-code: 'LXGWWenKaiMonoLite', 'Courier New', monospace;
--img-desktop-width: min(80%, 1200px); /* 桌面端限制 */
}
body {
font-family: var(--font-primary);
line-height: 1.6;
}
#content h1, #content h2 {
font-family: var(--font-primary);
font-weight: 500; /* 明确使用Medium字重 */
}
code, pre, tt {
font-family: var(--font-code);
line-height: 1.5;
padding: 0.2em 0.4em;
background: #f8f9fa;
border-radius: 3px;
}
/* ===== 图片响应式系统 ===== */
/* 修改:同时匹配cdn和www域名 */
img[src*="cdn.guohao.asia"],
img[src*="www.guohao.asia"] {
height: auto;
display: block;
margin: 0 auto;
transition: width 0.3s ease; /* 平滑过渡效果 */
/* 移动端默认样式 */
width: 100%;
max-width: 100%;
}
/* JS控制的类 - 增加特异性 */
/* 修改:同时匹配cdn和www域名 */
img[src*="cdn.guohao.asia"].img-auto,
img[src*="www.guohao.asia"].img-auto {
width: auto !important;
max-width: none !important;
}
img[src*="cdn.guohao.asia"].img-responsive,
img[src*="www.guohao.asia"].img-responsive {
width: var(--img-desktop-width) !important;
}
/* ===== 媒体查询 ===== */
@media (max-width: 600px) {
.ev-video {
width: 100%;
height: auto;
}
/* 移动端覆盖规则 - 修改:同时匹配cdn和www域名 */
img[src*="cdn.guohao.asia"].img-responsive,
img[src*="www.guohao.asia"].img-responsive {
width: 100% !important;
}
}
/* 调整版权图标大小 */
.copyright-icon img {
width: auto; /* 宽度设置为 30 像素 */
height: 30px; /* 高度设置为 30 像素 */
border: 2px solid #333; /* 边框宽度为 2 像素,颜色为深灰色 */
border-radius: 5px; /* 圆角半径为 5 像素 */
display: block;
margin: 0 auto; /* 水平居中对齐 */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* 水平偏移 0,垂直偏移 0,模糊半径 10 像素,阴影颜色为半透明黑色 */
}
/* 处理版权图标加载失败时的样式 - 增强选择器 */
.copyright-icon img[src=""],
.copyright-icon img:not([src]) {
display: none; /* 处理空src或缺失src的情况 */
}