Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import svg2react from './tasks/svg2react';
import svg2datauri, { sassMap, svg2sassvar } from './tasks/svg2datauri';
import getIconFontMetadataProvider from './tasks/getIconFontMetadataProvider';
import metadata from './tasks/metadata';
const remToPx = value => {
let parsed = null;
if (/rem$/.test(value)) {
parsed = parseFloat(value.replace(/rem/, '')) * 16;
}
return parsed || null;
};
const smallIconSize = tokens.props.ICON_SIZE_SM.value;
const smallIconPxSize = remToPx(smallIconSize);
const largeIconSize = tokens.props.ICON_SIZE_LG.value;
const largeIconPxSize = remToPx(largeIconSize);
const colors = _(tokens.props)
.filter({ category: 'colors', type: 'color' })
.keyBy('name')
.mapValues('value')
.mapKeys((value, key) => _.kebabCase(key).replace('color-', ''))
.mapValues(value => tinycolor(value).toHexString())
.value();
const svgoCommonPlugins = [
{ removeTitle: true },
{ removeStyleElement: true },
{ removeEmptyContainers: true },
import getIconFontMetadataProvider from './tasks/getIconFontMetadataProvider';
import metadata from './tasks/metadata';
const remToPx = value => {
let parsed = null;
if (/rem$/.test(value)) {
parsed = parseFloat(value.replace(/rem/, '')) * 16;
}
return parsed || null;
};
const smallIconSize = tokens.props.ICON_SIZE_SM.value;
const smallIconPxSize = remToPx(smallIconSize);
const largeIconSize = tokens.props.ICON_SIZE_LG.value;
const largeIconPxSize = remToPx(largeIconSize);
const colors = _(tokens.props)
.filter({ category: 'colors', type: 'color' })
.keyBy('name')
.mapValues('value')
.mapKeys((value, key) => _.kebabCase(key).replace('color-', ''))
.mapValues(value => tinycolor(value).toHexString())
.value();
const svgoCommonPlugins = [
{ removeTitle: true },
{ removeStyleElement: true },
{ removeEmptyContainers: true },
{ sortAttrs: true },
{ removeUselessDefs: true },
const _ = require('lodash');
const tinycolor = require('tinycolor2');
const tokens = require('bpk-tokens/tokens/base.raw.json');
const colors = _(tokens.props)
.filter({ category: 'colors', type: 'color' })
.keyBy('name')
.mapValues('value')
.mapKeys((value, key) => _.kebabCase(key).replace('color-', ''))
.mapValues(value => tinycolor(value).toHexString())
.value();
module.exports = function gruntConfig(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-svgmin');
grunt.loadNpmTasks('grunt-exec');
grunt.loadTasks('tasks');
grunt.initConfig({