aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/style/util.ts
blob: 7cf13133f3cdf7b79bae001f560306aae3b5a625 (plain) (blame)
1
2
3
4
5
6
7
8
9
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 '';
};