diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-11 20:25:47 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-11 20:25:47 +0800 |
commit | 295a8c760a6d5b567a12d6a2d83ae73021ea343c (patch) | |
tree | faf6810a6b5b810869e36c20641fd4fe25e03ddb /packages/instant/src/style/util.ts | |
parent | 9b147f14955c5f6a0b38e03ae30ac13b1be183d1 (diff) | |
parent | 1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4 (diff) | |
download | dexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.tar.gz dexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.tar.zst dexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.zip |
merge dev-section-redesign
Diffstat (limited to 'packages/instant/src/style/util.ts')
-rw-r--r-- | packages/instant/src/style/util.ts | 11 |
1 files changed, 11 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..c9df0f834 --- /dev/null +++ b/packages/instant/src/style/util.ts @@ -0,0 +1,11 @@ +import { ObjectMap } from '@0xproject/types'; +import * as _ from 'lodash'; + +export const cssRuleIfExists = (props: ObjectMap<any>, rule: string): string => { + const camelCaseRule = _.camelCase(rule); + const ruleValueIfExists = props[camelCaseRule]; + if (!_.isUndefined(ruleValueIfExists)) { + return `${rule}: ${ruleValueIfExists};`; + } + return ''; +}; |