{
  "name": "less-plugin-dls",
  "version": "7.1.2",
  "description": "Less plugin for Baidu Light DLS.",
  "main": "dist/index.js",
  "bin": {
    "dls": "bin/dls"
  },
  "keywords": [
    "less",
    "plugin",
    "baidu",
    "dls",
    "ecosystem:less"
  ],
  "author": "Justineo (justice360@gmail.com)",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/ecomfe/light-dls.git"
  },
  "dependencies": {
    "arg": "^4.1.3",
    "dls-color-palette": "0.0.1-alpha.3",
    "esm": "^3.2.25",
    "fast-glob": "^3.0.4",
    "pkg-dir": "^4.2.0"
  },
  "devDependencies": {
    "@rollup/plugin-commonjs": "^15.0.0",
    "@rollup/plugin-node-resolve": "^9.0.0",
    "chalk": "^4.1.2",
    "color-converters": "^0.1.1",
    "diff": "^4.0.1",
    "less": "^3.13.0",
    "lodash.camelcase": "^4.3.0",
    "lodash.memoize": "^4.1.2",
    "postcss": "^8.3.6",
    "postcss-values-parser": "^6.0.2",
    "reduce-css-calc": "^2.1.6",
    "rollup": "^2.26.10",
    "strip-css-comments": "^4.0.0"
  },
  "scripts": {
    "test": "node -r esm test/run.js",
    "build": "rollup -c && cp src/index.js dist/index.js && node -r esm scripts/vars.js"
  },
  "readme": "# less-plugin-dls\n\nLess plugin for Baidu DLS.\n\n## Installation\n\n```sh\nnpm i --save-dev less-plugin-dls\n```\n\n## Usage\n\n### Autoinject with Less plugin\n\n```js\nimport less from 'less'\nimport dls from 'less-plugin-dls'\n\nless\n  .render('a { color: @dls-link-font-color-normal; }', {\n    plugins: [dls()]\n  })\n  .then(result => {\n    // handle result\n  })\n```\n\n### Import from stylesheets\n\nWith [less-loader](https://github.com/webpack-contrib/less-loader):\n\n```less\n@import \"~less-plugin-dls/tokens/index.less\";\n\na { color: @dls-link-font-color-normal; }\n```\n\n### Use CLI argument\n\n```sh\nlessc style.less --dls\n```\n\n## Custom functions\n\n### `dls-contextual(@color, @type)`\n\nTo generate contextual colors according to the given brand color.\n\n**Params**:\n\n- `@color: Color` - the brand color.\n- `@type: info | success | warning | error` - the color context.\n\n**Return value**:\n\n`Color` - the generated contextual color.\n\n```less\n@color: dls-contextual(#0052cc, success); // → #39bf45\n```\n\n### `dls-shade(@color, @level)`\n\nTo generate a specific shade level of the given base color.\n\n**Params**:\n\n- `@color: Color` - the base color.\n- `@level: Number` - the shade level.\n\n**Return value**:\n\n`Color` - the generated shaded color.\n\n```less\n@color: dls-shade(#3d88f2, 3); // → #b3cfff\n```\n\n### `dls-sum(...@dimensions)`\n\nTo get the sum of the given dimensions or `calc` expressions.\n\n**Params**:\n\n- `@dimensions: List<Dimension | Calc>` - A list of length values.\n\n**Return value**:\n\n`Dimension | Calc` - the total value of the given list.\n\n```less\n@width: dls-sum(1px, 30%); // → calc(1px + 30%)\n@height: dls-sum(1px, 10px, 100px); // → 111px\n@top: dls-sum(calc(1px + 5em), -1px); // → 5em\n@left: dls-sum(calc(1px + 5em), -1px, calc(-5em)); // → 0\n```\n\n### `dls-even(@dimension)`\n\nTo calculate the closest even integer value for a given dimension.\n\n**Params**:\n\n- `@dimension: Dimension` - The given length value.\n\n**Return value**:\n\n`Dimension` - the closest even value.\n\n```less\n@width: dls-even(1px); // → 2px\n@height: dls-even(2); // → 2\n@top: dls-even(19.6px); // → 20px\n@left: dls-even(2.8em); // → 2em\n```\n\n### `dls-line-height(@line-height, @font-size): Dimension`\n\nTo calculate the absolute `line-height` from the given `line-height` and `font-size` value.\n\nWill return `@line-height` directly if it is an absolute length (eg. `15px`, `2em`). Will return the product of `@line-height` and `@font-size` for relative lengths (eg. `1.5`, `200%`).\n\n**Params**:\n\n- `@line-height: Dimension` - the `line-height` value.\n- `@font-size: Dimension` - the `font-size` value.\n\n**Return value**:\n\nThe absolute length of the line-height.\n\n```less\n@h1: dls-line-height(1.5, 16px); // → 24px\n@h2: dls-line-height(120%, 15px); // → 18px\n@h3: dls-line-height(2em, 1.2em); // → 2em\n```\n\n## Options\n\n### `reduceCalc: boolean`\n\nIndicates whether to reduce `calc` expression to the simplest form or not.\n\nDefault value: `true`.\n\n## Tooling\n\n### CLI checker\n\n```sh\nnpx dls check -c -o result.log\n```\n\n#### Commands\n\n##### `check`\n\nTo check which variables are not used inside a directory. The current strategy is plain text search so that doesn't cover the case of Less's variable name interpolation.\n\n###### Options\n\n- `--dir` / `-d`\n\n  The target directory to check.\n\n  Default: `.`.\n\n- `--exclude` / `-x`\n\n  Comma-separated glob expression, indicates which files should be ignored.\n\n  Default: `node_modules,test`.\n\n  ```sh\n  npx dls check -x node_modules,test,dist # or --exclude=node_modules,test,dist\n  ```\n\n- `--components` / `-c`\n\n  Comma-separated component names to specify which component-level variables will be checked. `--components=all` will check all component-level variables.\n\n  Variables can be ignored if you put a `.dlsignore` file under the project root directory, with each variable (should be prefixed by `@`) on a single line. Lines led by `#` will be treated as comments.\n\n  ```sh\n  npx dls check -c button,select # or --components=button,select\n  npx dls check -c all # or --components=all\n  ```\n\n- `--output` / `-o`\n\n  The output file for the check result.\n\n  ```sh\n  npx dls check -o result.log # or --output=result.log\n  ```\n\n### Editor Extensions\n\n- **Baidu DLS (VS Code)**\n\n  [Marketplace](https://marketplace.visualstudio.com/items?itemName=justice360.vscode-dls) / [GitHub](https://github.com/Justineo/vscode-dls)\n\n## License\n\n[MIT](https://github.com/ecomfe/less-plugin-dls/blob/master/LICENSE)\n"
}