[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 -->
* left body
* <!-- cell right -->
* right body
* {% endsplit %}
* {% endgrid %}
*/
'use strict';
hexo.extend.tag.register('split', function(args, content) {
hexo.extend.tag.register('grid', function(args, content) {
args = hexo.args.map(args, ['bg']);
var el = '';
el += '<div class="tag-plugin split"';
el += '<div class="tag-plugin grid"';
el += ' ' + hexo.args.joinTags(args, ['bg']).join(' ');
el += '>';

View File

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