[feat] custom default color for "mark"

This commit is contained in:
xaoxuu 2022-11-21 23:10:33 +08:00
parent 365eed9f91
commit 7d10a24a4d
3 changed files with 9 additions and 3 deletions

View File

@ -194,7 +194,7 @@ footer:
tag_plugins:
# {% note text %}
note:
default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple
default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
# {% checkbox %}
checkbox:
interactive: false # enable interactive for user
@ -219,6 +219,9 @@ tag_plugins:
# {% timeline %}
timeline:
max-height: 80vh
# {% mark %}
mark:
default_color: dark # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
######## JS Plugins ########

View File

@ -10,6 +10,9 @@
hexo.extend.tag.register('mark', function(args) {
args = hexo.args.map(args, ['color'], ['text']);
if (args.color == null) {
args.color = hexo.theme.config.tag_plugins.mark.default_color
}
var el = '';
el += '<mark class="tag-plugin mark"';
el += ' ' + hexo.args.joinTags(args, ['color']).join(' ');

View File

@ -66,13 +66,13 @@ set_text_black()
--theme-bg: #333
set_text_white()
.tag-plugin.note[color='warning']
.tag-plugin[color='warning']
--theme: $c-yellow
--theme-border: #ffe659
--theme-bg: #ffe659
--theme-link: #ff453a
.tag-plugin.note[color='error']
.tag-plugin[color='error']
--theme: $c-yellow
--theme-border: #ff453a
--theme-bg: #ff453a