diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-05 05:04:56 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-05 05:04:56 +0800 |
commit | 85c34b17aa074e67ed9263094cc0ee75a8f00e60 (patch) | |
tree | d2db68e31811d47f9092a051474073b07bfe260e /packages/instant/src/style/util.ts | |
parent | 4b8348da8cc50ef0da6e6b2bb7d276f1246437cf (diff) | |
download | dexon-sol-tools-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar dexon-sol-tools-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.gz dexon-sol-tools-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.bz2 dexon-sol-tools-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.lz dexon-sol-tools-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.xz dexon-sol-tools-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.zst dexon-sol-tools-85c34b17aa074e67ed9263094cc0ee75a8f00e60.zip |
Add Flex and Container component
Diffstat (limited to 'packages/instant/src/style/util.ts')
-rw-r--r-- | packages/instant/src/style/util.ts | 10 |
1 files changed, 10 insertions, 0 deletions
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 ''; +}; |