Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
/ less2js Public archive

Read variable from your less file and export them as JavaScript Object.

Notifications You must be signed in to change notification settings

Hkmu/less2js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

less2js

Read variable from your less file and export them as JavaScript Object.

Features

  • Support less @import(comma seperated options eg. (less, optional) will be ignored)

Getting Started

Install

Install less2js using yarn :

yarn install less2js

Or using npm :

npm install less2js

Usage

import less2js from 'less2js';

less2js('./theme.less').then(res => {
    // res is like { '@color-brand': 'yellow', '@width': '100px' }
});

Options

Option Description Default
stripPrefix Remove the @ prefix from returned object keys false
camelCase Convert dash/dot/underscore/space separated keys to camelCase false

About

Read variable from your less file and export them as JavaScript Object.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published