From 6cb65ef94d086f0a08aa12c887c6fcf48a201564 Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Tue, 7 Jan 2020 07:42:24 +0100 Subject: [PATCH] card helper added. --- bulma.js | 5 +++++ bulma.ls | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/bulma.js b/bulma.js index 16eb759..18cbfba 100644 --- a/bulma.js +++ b/bulma.js @@ -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); diff --git a/bulma.ls b/bulma.ls index 30d6220..f22c844 100644 --- a/bulma.ls +++ b/bulma.ls @@ -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 + ] }