[opt] split -> grid
This commit is contained in:
parent
9f1bcec031
commit
f748cf4234
|
@ -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 += '>';
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue