From 85c34b17aa074e67ed9263094cc0ee75a8f00e60 Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 4 Oct 2018 14:04:56 -0700 Subject: Add Flex and Container component --- packages/instant/src/style/util.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 packages/instant/src/style/util.ts (limited to 'packages/instant/src/style') diff --git a/packages/instant/src/style/util.ts b/packages/instant/src/style/util.ts new file mode 100644 index 000000000..7cf13133f --- /dev/null +++ b/packages/instant/src/style/util.ts @@ -0,0 +1,10 @@ +import * as _ from 'lodash'; + +export const cssRuleIfExists = (props: any, rule: string): string => { + const camelCaseRule = _.camelCase(rule); + const ruleValueIfExists = props[camelCaseRule]; + if (!_.isUndefined(ruleValueIfExists)) { + return `${rule}: ${ruleValueIfExists};`; + } + return ''; +}; -- cgit v1.2.3