[opt] split -> grid

This commit is contained in:
xaoxuu 2022-12-10 22:29:24 +08:00
parent 9f1bcec031
commit f748cf4234
2 changed files with 8 additions and 8 deletions

View File

@ -1,21 +1,21 @@
/** /**
* split.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/ * grid.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
* 格式与官方标签插件一致使用空格分隔中括号内的是可选参数中括号不需要写出来 * 格式与官方标签插件一致使用空格分隔中括号内的是可选参数中括号不需要写出来
* *
* {% split [style:block/card] %} * {% grid [style:block/card] %}
* <!-- cell left --> * <!-- cell left -->
* left body * left body
* <!-- cell right --> * <!-- cell right -->
* right body * right body
* {% endsplit %} * {% endgrid %}
*/ */
'use strict'; 'use strict';
hexo.extend.tag.register('split', function(args, content) { hexo.extend.tag.register('grid', function(args, content) {
args = hexo.args.map(args, ['bg']); args = hexo.args.map(args, ['bg']);
var el = ''; var el = '';
el += '<div class="tag-plugin split"'; el += '<div class="tag-plugin grid"';
el += ' ' + hexo.args.joinTags(args, ['bg']).join(' '); el += ' ' + hexo.args.joinTags(args, ['bg']).join(' ');
el += '>'; el += '>';

View File

@ -1,4 +1,4 @@
.tag-plugin.split .tag-plugin.grid
display: grid display: grid
grid-gap: 16px grid-gap: 16px
grid-template-columns: repeat(auto-fill, "calc((100% - 1 * %s) / 2)" % 16px) grid-template-columns: repeat(auto-fill, "calc((100% - 1 * %s) / 2)" % 16px)
@ -19,11 +19,11 @@
margin-bottom: -0.25em margin-bottom: -0.25em
.tag-plugin.split .tag-plugin.grid
@media screen and (max-width: $device-tablet) @media screen and (max-width: $device-tablet)
display: block display: block
.tag-plugin.split .tag-plugin.grid
&[bg]>.cell &[bg]>.cell
padding: 1rem padding: 1rem
border-radius: $border-card border-radius: $border-card