Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

less-openui5

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

less-openui5

Build OpenUI5 themes with Less.js

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
144K
increased by2.64%
Maintainers
1
Weekly downloads
 
Created
Source

OpenUI5

less-openui5

Build OpenUI5 themes with Less.js.

Install

npm install less-openui5

Usage

var lessOpenUI5 = require('less-openui5');

lessOpenUI5.build('@var: #ffffff; .class { color: @var; float: left }', function(err, result) {

  console.log(result.css); // => regular css
  /*
  .class {
   color: #ffffff;
   float: left;
  }
  */

  console.log(result.cssRtl); // => mirrored css for right-to-left support
  /*
  .class {
    color: #ffffff;
    float: right;
  }
  */

  console.log(result.variables); // => less variables with their values (only global ones)
  /*
  { var: "#ffffff" }
  */

  console.log(result.imports); // => paths to files imported via @import directives
  /*
  []
  */

});

API

build(input, [options,] callback)

input

Required
Type: string

Input less content.

options
rtl

Type: boolean
Default: true

Create mirrored css for right-to-left support.

rootPaths

Type: array of string

Root paths to use for import directives.

This option differs from the less compiler.paths option.
It is useful if less files are located in separate folders but referenced as they would all be in one.
If rootPaths are provided and a file can not be found, the compiler.paths option will be used instead.

Note: parser.filename has to be set to the path of the input file in order to get this working.

Example
rootPaths: [ './lib1', './lib2' ]

Folder structure

lib1
 my
  themes
   foo
    foo.less
lib2
 my
  themes
   bar
    bar.less

lib2/my/themes/bar/bar.less

@import "../foo/foo.less"; /* lib1/my/themes/foo/foo.less will be imported */
parser

Type: object

Options for the less parser (less.Parser).

compiler

Type object

Options for the less compiler (tree.toCss).

callback(error, result)

Required
Type: function

result.css

Type: string

Regular css output.

result.cssRtl

Type: string

Mirrored css for right-to-left support (if rtl option was enabled).

result.variables

Type: object

Key-value map of all global less variables (without @ prefix).

result.imports

Type: array

Paths to files imported via import directives.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Lisense

[Apache License 2.0](http: //www.apache.org/licenses/LICENSE-2.0) © 2014 SAP SE

Keywords

FAQs

Package last updated on 10 Oct 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc