card helper added.

master
Luka Vandervelden 2020-01-07 07:42:24 +01:00
parent 31ec459db3
commit 6cb65ef94d
2 changed files with 23 additions and 0 deletions

View File

@ -93,6 +93,11 @@
var head, body, footer;
args || (args = {});
return h('div.hero', args, [(head = args.head) ? h('div.hero-head', head) : void 8, (body = args.body) ? h('div.hero-body', body) : void 8, (footer = args.footer) ? h('div.hero-footer', footer) : void 8]);
},
card: function(args){
var header, title, icon, content, footer;
args || (args = {});
return h('div.card', args, [(header = args.header) ? h('div.card-header', [(title = header.title) ? h('div.card-header-title', [title]) : void 8, (icon = header.icon) ? h('div.card-header-icon', [icon]) : void 8]) : void 8, (content = args.content) ? h('div.card-content', content) : void 8, (footer = args.footer) ? h('div.card-footer', footer) : void 8]);
}
};
}).call(this);

View File

@ -126,5 +126,23 @@ module.exports = {
if footer = args.footer
h \div.hero-footer footer
]
card: (args) ->
args or= {}
h \div.card args, [
if header = args.header
h \div.card-header [
if title = header.title
h \div.card-header-title [ title ]
if icon = header.icon
h \div.card-header-icon [ icon ]
]
if content = args.content
h \div.card-content content
if footer = args.footer
h \div.card-footer footer
]
}