mirror of
https://github.com/doocs/md.git
synced 2024-11-25 03:18:36 +08:00
5f6ebd2281
添加默认主题,色盘颜色自动渲染至文章
13 lines
472 B
JavaScript
13 lines
472 B
JavaScript
function setColorWithTemplate(template) {
|
|
return function(color) {
|
|
let custom_theme = JSON.parse(JSON.stringify(template));
|
|
custom_theme.block.h1['border-bottom'] = `2px solid ${color}`;
|
|
custom_theme.block.h2['background'] = color;
|
|
custom_theme.block.h3['border-left'] = `3px solid ${color}`;
|
|
custom_theme.inline.strong['color'] = color;
|
|
return custom_theme
|
|
};
|
|
}
|
|
|
|
let setColor = setColorWithTemplate(default_theme);
|