style: remove code theme option

This commit is contained in:
yanglbme 2020-07-28 20:51:27 +08:00
parent d42f98bcf1
commit c5f570e391
2 changed files with 8 additions and 38 deletions

View File

@ -137,34 +137,14 @@ const WxRenderer = function (opts) {
numbers.push('<li></li>')
}
const lang = infoString || '';
const codeTheme = store.state.codeTheme;
let result;
switch (codeTheme) {
case 'wechat':
result = `
<section class="code-snippet__${codeTheme} code-snippet__js">
<ul class="code-snippet__line-index code-snippet__js">${numbers.join('')}</ul>
<pre class="code__pre code-snippet__js" data-lang="${lang}">
${codeLines.join('')}
</pre>
</section>
`;
break;
case 'github':
result = `
<section class="code-snippet__${codeTheme}">
<pre class="code__pre" data-lang="${lang}">
${codeLines.join('')}
</pre>
</section>
`;
break;
default:
break;
}
return result;
const codeTheme = 'github';
return `
<section class="code-snippet__${codeTheme}">
<pre class="code__pre" data-lang="${lang}">
${codeLines.join('')}
</pre>
</section>
`;
}
renderer.codespan = (text, infoString) => `<code ${getStyles('codespan')}>${text}</code>`
renderer.listitem = text => `<span ${getStyles('listitem')}><span style="margin-right: 10px;"><%s/></span>${text}</span>`

View File

@ -47,16 +47,6 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="selectCodeTheme" size="mini" placeholder="选择代码块样式" clearable @change="codeThemeChanged">
<el-option v-for="theme in config.codeThemeOption" :key="theme.value"
:label="theme.label"
:value="theme.value">
<span class="select-item-left">{{ theme.label }}</span>
<span class="select-item-right">{{ theme.desc }}</span>
</el-option>
</el-select>
</el-form-item>
<el-tooltip content="自定义颜色" :effect="effect" placement="top">
<el-color-picker v-model="selectColor" size="mini" show-alpha @change="colorChanged"></el-color-picker>
</el-tooltip>