1.1.1 • Published 3 years ago

less-json-vars v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

less-json-vars

A plugin for convert less vars to json.

usage

const getLessVariables: (content: string, options?: Partial<Options>) => Record<string, string>;

example

const { getLessVariables } = require('less-json-vars');

const content = '@primary-color: #ffffff;\n @color: #000000';

const variables = getLessVariables(content);

console.log(variables); // { '@primary-color': '#ffffff', 'color': '#000000' }

options

strip (boolean): Whether to remove the prefix. (default false)

debug (boolean): Whether open debug mode. (default false)

format('camelCase' | 'kebabCase' | 'none'): Format key of variables. (default 'none')

transform (boolean): Should transform current variable in values. (default true)

license

MIT