Socket
Socket
Sign inDemoInstall

node-lessify

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-lessify

LESS precompiler and CSS plugin for Browserify v2


Version published
Weekly downloads
709
increased by27.52%
Maintainers
1
Weekly downloads
 
Created
Source

node-lessify

LESS precompiler and CSS plugin for Browserify v2. Inspired by node-underscorify.

When bundling an app using Browserify, it's often convenient to be able to include your CSS as a script that appends the style declarations to the head. This is particularly relevant for self-assembling apps that attach themselves to a page but otherwise have reserved real-estate on the DOM.

This small script allows you to require() your CSS or LESS files as you would any other script.

Usage

Write your LESS or CSS files as you normally would, and put them somewhere where your script can find it.

Then simply require them as you might anything else:

require('./styles.less');
require('./mysite.css');

To compile the stylesheets, pass this module to browserify as a transformation on the command line.

browserify -t node-lessify script.js > bundle.js

How it works

The stylesheets are compiled (in the case of LESS), minified, and bundle into a function that creates a new <style> element and appends it to the <head> using native Javascript.

Keywords

FAQs

Package last updated on 22 Nov 2013

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