less-theme-to-obj.ts

17 lines | 421 B Blame History Raw Download

import themeLess from '!!raw-loader!./theme.less';

export function getLessThemeObj(): any {
    var result: any = {};
    var lines = themeLess.split(";");

    for (let i = 0; i < lines.length; i++) {
        const line = lines[i].trim();
        var keyValPair = line.split(':');

        if (keyValPair[0] && keyValPair[1])
            result[keyValPair[0].trim()] = keyValPair[1].trim();
    }

    return result;
}