LESSC(1)

๐Ÿ’– LESSC โ€” the Less compiler, bestie edition ๐Ÿ’–

okay so this is lessc, the compiler for Less (Leaner Style Sheets) โ€” it's the CSS extension that makes writing stylesheets not feel like a punishment. โœจ


๐ŸŒธ NAME ๐ŸŒธ

lessc โ€” Compiler for Less (Leaner Style Sheets) extension for CSS


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

Here's the whole vibe, the usage line, copy it exactly bestie:

lessc [option option=parameter ...] <source> [destination]

If source is set to - (that's a dash, or hyphen-minus if we're being fancy) then the input gets read from stdin. yes, pipe it in, she's flexible ๐Ÿ’…


โœจ options: โœจ

  • -h, --help โ€” prints help (aka literally this message) and dips out. bye! ๐Ÿ‘‹
  • --include-path=PATHS โ€” sets your include paths. separate them with :. on windows, ; works too ๐ŸชŸ
  • -M, --depends โ€” spits out a makefile import dependency list to stdout. very build-system-core of her ๐Ÿ› ๏ธ
  • --no-color โ€” turns off the colorized output. (sad, but sometimes you gotta ๐Ÿฅฒ)
  • --ie-compat โ€” enables IE8 compatibility checks. yes, IE8. we don't ask questions ๐Ÿซ 
  • --js โ€” enables inline JavaScript in less files ๐Ÿ”ฅ
  • -l, --lint โ€” syntax check only, that's the lint mode. no output, just judgment ๐Ÿ”
  • -s, --silent โ€” suppresses output of error messages. shhh ๐Ÿคซ
  • --strict-imports โ€” forces evaluation of imports. no shortcuts, we evaluate ๐Ÿ˜ค
  • --insecure โ€” allows imports from insecure https hosts. lowkey risky bestie, that's literally the name of the flag โš ๏ธ
  • -v, --version โ€” prints the version number and exits ๐Ÿท๏ธ
  • --verbose โ€” be verbose. she's chatty, and honestly? we respect it ๐Ÿ—ฃ๏ธ
  • --source-map[=FILENAME] โ€” outputs a v3 sourcemap to FILENAME (or if you don't give one, the output filename with .map slapped on) ๐Ÿ—บ๏ธ
  • --source-map-rootpath=X โ€” adds this path onto the sourcemap filename and the less file paths ๐ŸŒฟ
  • --source-map-basepath=X โ€” sets the sourcemap base path. defaults to the current working directory ๐Ÿ“
  • --source-map-include-source โ€” puts the less files into the map instead of just referencing them ๐Ÿ“ฆ
  • --source-map-inline โ€” puts the map (and any less files) as a base64 data uri straight into the output css file ๐Ÿงฌ
  • --source-map-url=URL โ€” sets a custom URL to the map file, for the sourceMappingURL comment in the generated CSS file ๐Ÿ”—
  • --source-map-no-annotation โ€” excludes that sourceMappingURL comment from the output css file ๐Ÿšซ
  • -rp, --rootpath=URL โ€” sets rootpath for url rewriting in relative imports and urls. works with or without the relative-urls option ๐Ÿ 
  • -ru=, --rewrite-urls= โ€” rewrites URLs to make them relative to the base less file. and here are the values you can hand her:
    • all โ€” rewrites all URLs ๐ŸŒ
    • local โ€” just the ones starting with a . ๐Ÿก
    • off โ€” off. nothing gets rewritten ๐Ÿ™…
  • -m=, --math= โ€” the math mode, and she has opinions:
    • always โ€” Less will eagerly perform math operations always ๐Ÿงฎ
    • parens-division โ€” math performed except for the division (/) operator โž—
    • parens | strict โ€” math only performed inside parentheses ๐Ÿงท
    • strict-legacy โ€” parens required in very strict terms (this is the legacy --strict-math) ๐Ÿ“œ
  • -su=on|off โ€” allows mixed units, e.g. 1px+1em or 1px*1px, which have units โš–๏ธ
  • --strict-units=on|off โ€” that cannot be represented. (yep, this description is the other half of the -su= one above โ€” they're a matched set, so the mixed-units rule and the "can't be represented" caveat both apply here too) ๐Ÿงฉ
  • --global-var='VAR=VALUE' โ€” defines a variable that can be referenced by the file ๐ŸŒ
  • --modify-var='VAR=VALUE' โ€” modifies a variable already declared in the file โœ๏ธ
  • --url-args='QUERYSTRING' โ€” adds params into url tokens (e.g. 42, cb=42 or 'a=1&b=2') ๐ŸŽฃ
  • --plugin=PLUGIN=OPTIONS โ€” loads a plugin. you can also omit the --plugin= if the plugin begins with less-plugin. e.g. the clean css plugin is called less-plugin-clean-css once installed (npm install less-plugin-clean-css), and you use it either with --plugin=less-plugin-clean-css or just --clean-css with options after it, e.g. --plugin=less-plugin-clean-css="advanced" or --clean-css="advanced" ๐Ÿ”Œ

๐Ÿ’€ Deprecated ๐Ÿ’€

okay these ones are the old era. still here, still working, but likeโ€ฆ girl, move on ๐Ÿ’…

  • -sm=on|off โ€” legacy parens-only math. use --math instead ๐Ÿ‘ต
  • --strict-math=on|off โ€” also legacy math territory ๐Ÿ•ฐ๏ธ
  • --line-numbers=TYPE โ€” outputs filename and line numbers. TYPE can be either 'comments' (outputs the debug info within comments), 'mediaquery' (outputs the info within a fake media query, which is compatible with the SASS format), or 'all' (does both, overachiever) ๐Ÿ”ข
  • -x, --compress โ€” compresses output by removing some whitespaces. we recommend you use a dedicated minifier like less-plugin-clean-css instead ๐Ÿ—œ๏ธ

๐Ÿฆ‹ REPORTING BUGS ๐Ÿฆ‹

found a bug? tell the devs, not me, I'm just the messenger ๐Ÿซถ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

The full documentation for lessc is maintained as a Texinfo manual. If the info and lessc programs are properly installed at your site, then this command:

info lessc

should give you access to the complete manual. iykyk ๐Ÿ“–โœจ


and that's the whole page bestie!! this one's from lessc 3.12.2 (Less Compiler) โ€” dated November 2022, and it's the LESSC(1) page from User Commands. go forth and compile something iconic ๐Ÿ‘‘๐Ÿ’–

๐Ÿ“ฆ where this page comes from