0.4.0 • Published 11 months ago

@solidpixels/less-plugin-json v0.4.0

Weekly downloads
61
License
ISC
Repository
github
Last release
11 months ago

JSON less.js file manager

Usage

In LESS file, you can import JSON file as variables file. Regular JSON property will be flattened with -- separator. To produce LESS maps or lists, prefix variable with dollar.

{
  "border": {
    "size": "10px",
    "color": "red"
  },
  "$features": ["a", "b"],
  "$colors": {
    "red": "#ff0000",
    "green": "#00ff00"
  }
}
@import './variables.json';

body {
  border: @border--size @border--color;
  features: @features;
  color: @colors[red];
}

Will compile to:

body {
  border: 10px red;
  features: a, b;
  colors red;
}

Use

lessc style.less --plugin=index.js

Inspired by https://github.com/fortes/less-plugin-load-json#readme.

0.4.0

11 months ago

0.3.0

1 year ago

0.3.1

1 year ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago