[feat] custom default color for "mark"
This commit is contained in:
parent
365eed9f91
commit
7d10a24a4d
|
@ -194,7 +194,7 @@ footer:
|
||||||
tag_plugins:
|
tag_plugins:
|
||||||
# {% note text %}
|
# {% note text %}
|
||||||
note:
|
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 %}
|
||||||
checkbox:
|
checkbox:
|
||||||
interactive: false # enable interactive for user
|
interactive: false # enable interactive for user
|
||||||
|
@ -219,6 +219,9 @@ tag_plugins:
|
||||||
# {% timeline %}
|
# {% timeline %}
|
||||||
timeline:
|
timeline:
|
||||||
max-height: 80vh
|
max-height: 80vh
|
||||||
|
# {% mark %}
|
||||||
|
mark:
|
||||||
|
default_color: dark # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
|
||||||
|
|
||||||
|
|
||||||
######## JS Plugins ########
|
######## JS Plugins ########
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
|
|
||||||
hexo.extend.tag.register('mark', function(args) {
|
hexo.extend.tag.register('mark', function(args) {
|
||||||
args = hexo.args.map(args, ['color'], ['text']);
|
args = hexo.args.map(args, ['color'], ['text']);
|
||||||
|
if (args.color == null) {
|
||||||
|
args.color = hexo.theme.config.tag_plugins.mark.default_color
|
||||||
|
}
|
||||||
var el = '';
|
var el = '';
|
||||||
el += '<mark class="tag-plugin mark"';
|
el += '<mark class="tag-plugin mark"';
|
||||||
el += ' ' + hexo.args.joinTags(args, ['color']).join(' ');
|
el += ' ' + hexo.args.joinTags(args, ['color']).join(' ');
|
||||||
|
|
|
@ -66,13 +66,13 @@ set_text_black()
|
||||||
--theme-bg: #333
|
--theme-bg: #333
|
||||||
set_text_white()
|
set_text_white()
|
||||||
|
|
||||||
.tag-plugin.note[color='warning']
|
.tag-plugin[color='warning']
|
||||||
--theme: $c-yellow
|
--theme: $c-yellow
|
||||||
--theme-border: #ffe659
|
--theme-border: #ffe659
|
||||||
--theme-bg: #ffe659
|
--theme-bg: #ffe659
|
||||||
--theme-link: #ff453a
|
--theme-link: #ff453a
|
||||||
|
|
||||||
.tag-plugin.note[color='error']
|
.tag-plugin[color='error']
|
||||||
--theme: $c-yellow
|
--theme: $c-yellow
|
||||||
--theme-border: #ff453a
|
--theme-border: #ff453a
|
||||||
--theme-bg: #ff453a
|
--theme-bg: #ff453a
|
||||||
|
|
Loading…
Reference in New Issue