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 | |
parent | 4b8348da8cc50ef0da6e6b2bb7d276f1246437cf (diff) | |
download | dexon-0x-contracts-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar dexon-0x-contracts-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.gz dexon-0x-contracts-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.bz2 dexon-0x-contracts-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.lz dexon-0x-contracts-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.xz dexon-0x-contracts-85c34b17aa074e67ed9263094cc0ee75a8f00e60.tar.zst dexon-0x-contracts-85c34b17aa074e67ed9263094cc0ee75a8f00e60.zip |
Add Flex and Container component
Diffstat (limited to 'packages/instant/src/style')
-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 ''; +}; |