Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7654987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:23:49+00:00 2026-05-31T12:23:49+00:00

Can I parse LESS client side, and return the results? I am currently using

  • 0

Can I parse LESS client side, and return the results?

I am currently using as recommended in documentation, which is to include less file, and minified less parser afterwards. I want to be able to return the raw css so I can save it as a css file.

I do not want to install node.js and the likes, I want a client side solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:23:50+00:00Added an answer on May 31, 2026 at 12:23 pm

    A look at the less.js source brings up the Parser object. Assuming that less.js is included in the page:

    var data = "@colour: red; #example { background-color: @colour; }",
        parser = new less.Parser({});
    
    parser.parse(data, function (error, root) { 
        // code that handles the parsed data here...
        // e.g.:
        console.log( root.toCSS() ); 
    });
    

    will output the following to the console:

    #example {
      background-color: #ff0000;
    }
    

    The constructor for less.Parser actually takes series of settings, and I don’t understand enough of the internals of LESS to say what might be good to pass (though they are all optional so passing none should just use the defaults).

    The Parser.parse method takes two parameters: a string containing the LESS file, and a callback that handles the parsed data. The callback receives up to two parameters, an error object (error) and an object representing the parsed LESS (root). root isn’t passed if there was a fatal error, and error will be null if there was no error.

    Unfortunately, I can’t find any better documentation on the attributes of the error parameter than the place they are set in the source here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How i can parse and extract the parameters from an SQL Query using delphi?
I'm using RSS library so i can parse Atom and RSS in Ruby and
Is there any method I can send to an object, which will return an
Is there any tool that can parse a valid C program and generate a
Is there a tool that can parse C++ files within a project and generate
Does a tool exist that can parse text and output that text, hyper-linked to
I need a PHP Regex that can parse .strings files. In particular, it needs
I need a function that can parse both 1,123.12 and 1.123,12 to 1123.12 There
Is there any tool that can parse/conver xml files to this format? I have
Are there any .NET-specific tools out there that can parse / access the elementary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.