* @license MIT License */ /** * 默认自定义 CSS。 * * 历史沿革:这些规则原本放在主题目录下的一个 custom 子目录里,是该主题早期的 * 「自定义样式」入口。改成配置项后,把它作为默认值,保证切换瞬间站点外观 * 完全不变;同时 `恢复默认` 也能拿回这套样式。 * * 想彻底清掉:在后台把「自定义 CSS」清空保存即可(空值会覆盖这里的默认值)。 */ function yang_default_custom_css() { return <<<'CSS' .article .content p{ text-indent:2em } .k-main .details .article .content h2 { margin: 16px -16px; padding: 0 10px; border-left: 5px solid #00a2ff; background-color: rgba(243, 243, 243, 0.7); font-size: 20px; line-height: 41px; } ul{ margin-left:2em; } ol{ margin-left:2em; } ol > li{ line-height: 1.8; } ul > li{ line-height: 1.8; } CSS; } /** * 取自定义 CSS(未设置时回退到默认值) */ function yang_custom_css() { $css = kratos_option('g_custom_css', yang_default_custom_css()); return is_string($css) ? $css : ''; } /** * 取自定义 JS(未设置时为空) */ function yang_custom_js() { $js = kratos_option('g_custom_js', ''); return is_string($js) ? $js : ''; }