3.2.29: 把「自定义 CSS」里的站点样式并入主题公共样式 assets/css/site.css(段落缩进/h2 蓝条/列表缩进与行距),配置项默认置空并一次性清库迁移;自定义 CSS 内联输出改挂 kratos-site 以保持在最末
This commit is contained in:
+7
-1
@@ -53,6 +53,10 @@ function theme_autoload()
|
||||
wp_enqueue_style('animate', ASSET_PATH . '/assets/css/animate.min.css', array(), '3.7.2');
|
||||
}
|
||||
wp_enqueue_style('kratos', ASSET_PATH . '/assets/css/kratos.min.css', array(), THEME_VERSION);
|
||||
// 站点级公共样式:原「自定义 CSS」的内容已并入本文件(3.2.29)。
|
||||
// 依赖 kratos ⇒ 一定排在主题样式之后,才压得住主题里的同名规则;
|
||||
// 它自己也作为「自定义 CSS」的挂载点,保证站长临时覆盖仍排在最末。
|
||||
wp_enqueue_style('kratos-site', ASSET_PATH . '/assets/css/site.css', array('kratos'), THEME_VERSION);
|
||||
if (kratos_option('g_adminbar', true)) {
|
||||
$admin_bar_css = "
|
||||
@media screen and (max-width: 782px) {
|
||||
@@ -72,9 +76,11 @@ function theme_autoload()
|
||||
}
|
||||
// 自定义样式:存在主题选项里(数据库),排在主题样式之后,优先级最高。
|
||||
// 放选项而非主题目录,是为了让它在主题升级(升级会清空主题目录)后依然存在。
|
||||
// 挂在 kratos-site 上(而非 kratos):站点公共样式 site.css 排在 kratos 之后,
|
||||
// 自定义 CSS 必须继续排在 site.css 之后,否则临时覆盖会被公共样式反压。
|
||||
$custom_css = yang_custom_css();
|
||||
if (trim($custom_css) !== '') {
|
||||
wp_add_inline_style('kratos', $custom_css);
|
||||
wp_add_inline_style('kratos-site', $custom_css);
|
||||
}
|
||||
// js
|
||||
wp_deregister_script('jquery');
|
||||
|
||||
Reference in New Issue
Block a user