mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
Optimize the style of label tag
This commit is contained in:
parent
d194052d7e
commit
8e080e7e27
@ -13,7 +13,7 @@ function postLabel(args) {
|
|||||||
|
|
||||||
!text && hexo.log.warn('Label text must be defined!');
|
!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});
|
hexo.extend.tag.register('label', postLabel, {ends: false});
|
||||||
|
|||||||
@ -22,12 +22,10 @@
|
|||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: ' (';
|
content: ' (';
|
||||||
display: inline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: ') ';
|
content: ') ';
|
||||||
display: inline;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +1,10 @@
|
|||||||
.post-body .label {
|
.post-body .label {
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
display: inline;
|
|
||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
|
|
||||||
&.default {
|
for $type in $note-types {
|
||||||
background: $label-default;
|
&.{$type} {
|
||||||
}
|
background: lookup('$label-' + $type);
|
||||||
|
}
|
||||||
&.primary {
|
|
||||||
background: $label-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.info {
|
|
||||||
background: $label-info;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.success {
|
|
||||||
background: $label-success;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.warning {
|
|
||||||
background: $label-warning;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.danger {
|
|
||||||
background: $label-danger;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
.post-body .note {
|
.post-body .note {
|
||||||
$note-icons = hexo-config('note.icons');
|
$note-icons = hexo-config('note.icons');
|
||||||
$note-style = hexo-config('note.style');
|
$note-style = hexo-config('note.style');
|
||||||
$note-types = 'default' 'primary' 'info' 'success' 'warning' 'danger';
|
|
||||||
|
|
||||||
border-radius: $note-border-radius;
|
border-radius: $note-border-radius;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|||||||
@ -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.
|
// 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;
|
$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
|
// Default
|
||||||
$note-border-radius = 3px;
|
$note-border-radius = 3px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user