CSS::LESSp(3pm)

πŸ“¦
version 0.86 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– CSS::LESSp πŸ’–

okay bestie, gather round, because this is CSS::LESSp from the 3pm section of the User Contributed Perl Documentation β€” aka LESS for perl, aka the thing that parses your .less files and hands you back valid css. no cap. (and if you're like "what even is a less file", the vibes live at lesscss.org πŸ¦‹)


✨ NAME ✨

CSS::LESSp β€” LESS for perl. Parse .less files and returns valid css (lesscss.org for more info about less files) πŸ’…


🌸 SYNOPSIS 🌸

like, the whole thing in one go:

use CSS::LESSp;

my $buffer;
open(IN, "file.less");
for ( <IN> ) { $buffer .= $_ };
close(IN);

my @css = CSS::LESSp->parse($buffer);

print join("", @css);

or honestly you could simply use the lessp.pl tool in the package, because why do more work than you have to 🫢

$ lessp.pl css.less > css.css

πŸŽ€ DESCRIPTION πŸŽ€

this module is designed to parse and compile .less files in to .css files. that's the whole personality. it's giving compiler energy.

for the documentation and syntax of less files, please visit lesscss.org β€” go read, i'll wait πŸ’œ


πŸ‘‘ DIFFERENCE WITH THE ORIGINAL LESS FOR RUBY πŸ‘‘

so what are the benefits of LESS for perl, you ask? lemme put you on…

it's extremely fast πŸ”₯ like, look at this:

# time ./lessp.pl big.less > big.css

real    0m2.198s
user    0m2.174s
sys     0m0.020s
# time lessc big.less big.css

real    0m18.805s
user    0m18.437s
sys     0m0.184s

that's not a comparison, that's a slaughter. ate and left no crumbs fr fr πŸ‘‘


⭐ METHODS ⭐

  • parse β€” the main parse method, returns array of the css file ✨
  • copyFunction
  • copyTo
  • dump
  • getSelector
  • getValue
  • getVariable
  • insertChild
  • insertFunction
  • insertRule
  • insertVariable
  • isFunction
  • new
  • process
ngl the original page just vibes the last chunk of these out as a run-on line of =head3 markers mashed together instead of actual headings β€” dump =head3 getSelector =head3 getValue =head3 getVariable =head3 insertChild =head3 insertFunction =head3 insertRule =head3 insertVariable =head3 isFunction =head3 new =head3 process β€” so i've lovingly un-mangled them here and given each one its own little spotlight. the names are exactly the same, promise πŸ’–

πŸ’€ BUGS πŸ’€

a ) You can not import other less files ...

you can't do this, bestie, it will simply not work:

@import url('/other.less')

it might be added in future versions πŸ™ˆ

b ) You can not use hsl as a color

you can't do this either, sorry:

color: hsl(125,125,125);

all other bugs should be reported via <http://rt.cpan.org/Public/Dist/Display.html?Name=CSS-LESSp> or bug-CSS-LESSp@rt.cpan.org. don't be shy, report the bugs 🫢


πŸ’œ AUTHOR πŸ’œ

Ivan Drinchev <drinchev@gmail.com>


🌈 CONTRIBUTORS 🌈

people who've helped with this project :

  • Michael Schout <mschout@gkg.net>

Copyright (c) 2010.

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iconic license behaviour, honestly πŸ’…


aww and that's a wrap πŸŽ€ this whole page was served up as perl v5.40.1, dated 2025-08-02, under the CSS::LESSp(3pm) banner β€” so if you're reading this years later, bestie, the vibes are preserved but the version is historic. slay πŸ’–βœ¨
πŸ“¦ where this page comes from