Socket
Socket
Sign inDemoInstall

less-vars-loader

Package Overview
Dependencies
24
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    less-vars-loader

webpack loader to load variables from less files


Version published
Maintainers
1
Install size
1.81 MB
Created

Readme

Source

less-vars-loader

Build status npm npm David node Commitizen friendly semantic-release Code Climate

webpack loader to load variables from less files

Install

npm install --save-dev less-vars-loader

Usage

// some.less
@my-var: 2px;
const vars = require("less-vars-loader!./some.less");
// vars == { 'my-var': '2px' }

Camel casing (?camelCase)

The exported keys can be camelCased. This is disabled by default.

const vars = require("less-vars-loader?camelCase!./some.less");
// vars == { myVar: '2px' }

Resolving variables (?resolveVariables)

For simple @x = @y assignments this module can follow the assigned variable replace it with the last assignment. This is disabled by default.

Attention: Circular assignments are not supported, neither are non-trivial assignment such as calculations.

// some.less
@a: 1px;
@b: @a;
@c: @b;
const vars = require("less-vars-loader?resolveVariables!./some.less");
// vars == { a: '1px', b: '1px', c: '1px' }

TODO

  • source map support

Keywords

FAQs

Last updated on 19 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc