Optimize the style of label tag

This commit is contained in:
Mimi 2020-06-07 11:30:08 +08:00
parent d194052d7e
commit 8e080e7e27
5 changed files with 6 additions and 27 deletions

View File

@ -13,7 +13,7 @@ function postLabel(args) {
!text && hexo.log.warn('Label text must be defined!');
return `<span class="label ${classes.trim()}">${text}</span>`;
return `<mark class="label ${classes.trim()}">${text}</mark>`;
}
hexo.extend.tag.register('label', postLabel, {ends: false});

View File

@ -22,12 +22,10 @@
&::before {
content: ' (';
display: inline;
}
&::after {
content: ') ';
display: inline;
}
}

View File

@ -1,29 +1,10 @@
.post-body .label {
color: $text-color;
display: inline;
padding: 0 2px;
&.default {
background: $label-default;
}
&.primary {
background: $label-primary;
}
&.info {
background: $label-info;
}
&.success {
background: $label-success;
}
&.warning {
background: $label-warning;
}
&.danger {
background: $label-danger;
for $type in $note-types {
&.{$type} {
background: lookup('$label-' + $type);
}
}
}

View File

@ -1,7 +1,6 @@
.post-body .note {
$note-icons = hexo-config('note.icons');
$note-style = hexo-config('note.style');
$note-types = 'default' 'primary' 'info' 'success' 'warning' 'danger';
border-radius: $note-border-radius;
margin-bottom: 20px;

View File

@ -278,6 +278,7 @@ $post-eof-margin-bottom = 60px; // or 120px for less white space;
// --------------------------------------------------
// Read note light_bg_offset from NexT config and set in "$lbg%" to use it as string variable.
$lbg = hexo-config('note.light_bg_offset') is a 'unit' ? unit(hexo-config('note.light_bg_offset'), "%") : 0;
$note-types = 'default' 'primary' 'info' 'success' 'warning' 'danger';
// Default
$note-border-radius = 3px;